Jump to content

BEGINNER - Advanced lighting shadows causing ugliness .


fLUnKnhaXYU

Recommended Posts

I have a situation when I use a point light near other objects , static items , the soldier character model and character models I've made using make human . When shadows is enabled on the point light it makes a checkered pattern where the light is hitting the objects , when shadows are off then no such problem , This happens on objects with a relatively high poly count and doesnt affect nearby low poly items including trees . I dont know much at all about lighting but advanced is enabled and my settings are all high though I get quite a low frame rate , 20'ish , Also , this point light just disapperars depending on where I'm standing a very common occurrence for me using spot or point lights , I rotate around and they disappear , always while I am facing a certain location , any thoughts ? My equipment is not considered to be high end . 8GB DDR3 , GeForce GT 610 2GB

Link to comment
Share on other sites

You are probably using shadows enabled on point lights with cube projection, but that is broken as are almost all methods of casting shadows on regular lights, seems like you have to fix them.


I even had to disable shadows in a night level after even the last method of casting shadows broke in the last update.

Link to comment
Share on other sites

Yeah, we'd noted the issue with the cube projection. It was deigned a bit lower priority due to how expensive that mode of pointlights is, so it's less often used, but we're definitely aware of it.


Current suspicion is that it has something to do with depth precision. We want to do an inverse depth range, which may resolve the light acne if it is indeed related to depth precision.

Link to comment
Share on other sites

I did some tracking on that. most immediate way to cut out the checker pattern is taking that overDarkFactor and downing it:


zQFQ8Y9.jpg

bqff0N9.jpg


hopefully we'll be able to take a slice of time at some point and address that a bit simpler for folks. If someone want's to submit a notion themselves, the relevant codeline on the shader side would be : https://github.com/GarageGames/Torque3D/blob/0801a3cca87646e80a6f0e99ef47761d981cdec4/Templates/Full/game/shaders/common/lighting/advanced/pointLightP.hlsl#L201-L202 (lightParams.y)

Link to comment
Share on other sites

Very kind of you to bother , just as you said the cubeprojection was selected.

Also the texture size was 512 , default , i think , I certainly didnt set it at that for any clear reason . changing it to 1024 made a significant difference in the smoothness of the small cubes , what I was calling checkereds , I tried 2048 but seemed to start lagging quite severely , I couldnt sect PSSM , IDK why SO go with what you know . the parabaloid choices seemed to look nice , and to me , it looked VERY nice , very dramatic enhancement to the scene , very desirable even for a old school mentality . The now VERY nagging issue for me is with the flashing in and out of the light . Again , I Dont Know why it happens , I played around with the settings and nothing seemed to help with that issue . Could this be solely a hardware/performance issue ?


The overDarkFactor is something I havent had much luck with in trying to dial in in some nice hilly terrain . I saw it there but couldnt really imagine its effect on a small point light , but as you have suggested , I will have a go at downing that parameter .


Really appreciate your time and help .

Link to comment
Share on other sites

Thought Id go ahead and continue adding to this , hope not to waste your time .increasing the point light diameter has helped with the flashing problem . I was using 5 - 10 units while it kept flashing in and out . At 40 it becomes very stable . This also helped with the appearance of the cubes using the cubeProjection , at a radius of 500 and a texSize of 128 I couldnt see the cube pattern . If i walked close to a shadow then I could see the pattern . The dualParaboloidSinglePass was the best performer for me however none of the shadows at this time seem usable , be it for my lack uderstanding how to set it up or with my current equipment . which isnt very powerful in gaming or video editing , say , using DaVinci Resolve 14 , you know the free one , it'll run it but its not a very encouraging experience . So i guess I agree with Duion and that highly effective touch of realism might just have to wait . switchcing to the paraboloid selection tends to crash my program but not every time . Thanks again . Shadows are very nice .

Link to comment
Share on other sites

Well , not so fast , todays experimenting has left me quite optimistic about the use of lights and shadows even in my case .

 new PointLight() {
         radius = "90";
         isEnabled = "1";
         color = "1 0.603922 0 1";
         brightness = "0.6";
         castShadows = "1";
         staticRefreshFreq = "64";//<------------------------THIS WAS THE SLOWEST I COULD USE 128 WAS TOO JITTERY
         dynamicRefreshFreq = "8";
         priority = "3";
         animate = "1";
         animationType = "FireLightAnim";
         animationPeriod = "1";
         animationPhase = "1";
         flareScale = "1";
         attenuationRatio = "0.0001 100 0.0001";//<-----WHAT MIGHT BE SOME SENSIBLE RANGE FOR THESE VALUES ? THESE ALL SHOWED SOME AFFECT
         shadowType = "DualParaboloidSinglePass";
         texSize = "128";//<------------------------------------WOULD WORK FOR ME DOESNT LOOK REAL , JUST TRICKS THE EYE A BIT OLD SCHOOL (LIKE IT)
         overDarkFactor = "16 12 8 4"; //<-----------------JUST THINKING AROUND THE 40 UNIT DISTANCE OF THIS  OBJECTS SHADOW DISTANCE
         shadowDistance = "20";//<--------------------------WELL IT WAS 40   MUST'VE CHANGED IT , OK 20 HERE THEN, 
         shadowSoftness = "0.4";//<-------------------------TRYING TO KEEP IT SOFT , JUST ENOUGH TO TRICK THE EYE .
         numSplits = "1";
         logWeight = "1";
         fadeStartDistance = "16";//<------------------------THINKING IT MIGHT BE OK FOR THE 20 UNIT SHADOW DISTANCE .
         lastSplitTerrainOnly = "1";//<------------------------NOT SURE THIS MEANS ANYTHING IN THIS CASE WHERE PSSM IS NOT AN OPTION
         representedInLightmap = "0";//<-------------------? DOESNT SEEM LIKE A GOOD IDEA TO LEAVE AT FALSE , CHANGE TOMORROW
         shadowDarkenColor = "0 0 0 -1";
         includeLightmappedGeometryInShadow = "0";//<-? DOESNT SEEM LIKE A GOOD IDEA TO LEAVE AT FALSE , CHANGE TOMORROW
         position = "-805.831 -689.131 251.896";
         Rotation = "1 0 0 0";
         canSave = "1";
         canSaveDynamicFields = "1";
      };

 

Of course this is all tinkering around and many of the settings might make little sense as it was just a trial and error session of a noob . If I were to ask anything here it might be concerning the variables "representedInLightMap" and includeLightMappedGeometry InShadow" both of which are false by default , and how they might would correspond with the , mysterious , workings of the "dualParaboloidSinglePass" . Also , something which would clarify "attenuationRatio" .

With all of the post effects doing something , using scattersky , 3 frefabs with particles and point lights , couple of spotlights , shining through walls , My AMD A6 quadcore GeForce GT 610 (2GB) achieving 10'ish + FPS , CPU(WINDOWS7) around 18% RAM DDR3 8GB) around 18% . nothing to write a volume about but looks and plays just fine .I'll probably be moving back toward the beginner section now . I appreciate your help and your work in this area ,

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...