Wingnut Posted June 28, 2017 Share Posted June 28, 2017 I hope that info helps, @Lynxerious... but I'm not sure it will. Positioning AND light.setDirectionToTarget(), or other aiming-methods... is very important for directionalLights used as shadow sources. For pointLights... just position, no aiming (as you know) but... there is a distance-to-shadow-caster issue with pointLights... which I will now repro-dude. Also, sorry for mis-identifying issue as 'acne', earlier, guys. My mistake on that. @Deltakosh, or anyone... thx for help on these issues. http://www.babylonjs-playground.com/#1EVNNB#94 In this version, I have light2 pointLight active (lines 33-36). When light is .positioned 450 units above dude, shadows start failing. I think this will cause problems for people who use pointLight for sun. It seems pointLight range has no affect. Any thoughts? If pointLight-sun maximum-distance is 450 units, I am buying stock in sunblock lotion and fireproof umbrellas. Light1 directionalLight seems to lose shadows at 10000+ units distance. Better range, but still an issue? thx. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 29, 2017 Share Posted June 29, 2017 Unfortunately this is a precision question here with 1024x1024 pixels the map is not precise enough to accomodate the distance You will have to use a bigger map Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 30, 2017 Share Posted June 30, 2017 @Deltakosh, are you sure? http://www.babylonjs-playground.com/#1EVNNB#95 Line 58: 4096 map for light2. 8192 crashed my webGL context in FF . Line 35: Light2 height = 150; No shadows. Change line 35 to height 250; Got shadows (jaggy). Change to height 350; No shadows. Does shadow generator hate the numbers 150 and 350 ? Change to height 450; Got shadows (jaggy). Something is strange, it seems. Could be Wingnut. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 30, 2017 Share Posted June 30, 2017 It is still a precision problem due to the distance. Here is what the point light see at a distance of 100 (there is not a lot of info here :)): Now the same at 350: At 450, all pixels are at the same place so the shadow of the sphere starts to be used by the dude Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 30, 2017 Share Posted June 30, 2017 hmmm. http://www.babylonjs-playground.com/#1EVNNB#96 @Deltakosh/anyone... watch console and shadows on that PG. I am slowly-increasing light2.position.y and reporting it to console. Are we seeing shadows ON, OFF, ON, OFF, etc? If that's normal, I'm cool with it. I wonder if spotlights (and their shadows) will work for far-away sun. Perhaps directionals. I think many game proggers will want sun position > 600 units from Earth - for solar system sims. hmm. Maybe not. Checking Spots & Directionals: [link #97] Spots and Directionals seem consistent (working fine) beyond 2500 units. PointLights though... they are different. Their shadowMaps go in ALL directions. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 2, 2017 Share Posted July 2, 2017 Hi again. I decided to build a PG pointLight shadow torture test. PointLight is in center of big sphere. Camera is NOT in center... but it is a freeCamera, so fly it around with arrow keys. Each knot is 4000 units away from center pointLight. Yet, the shadows look great, in all 6 primary directions. This puzzles me. In this PG, the pointLight is 600 units from Dude (line 15)... and shadows look less-than-optimal (kind of crappy) Wingnut is confused. 4000 units from pointLight, knots make good shadows (first link). 600 units from pointLight, Dude makes ugly shadow (2nd link). *scratch scratch ponder ponder* Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 3, 2017 Share Posted July 3, 2017 knot is 4000 units away BUT they are far bigger than the dude. Here is what the point light sees: Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 3, 2017 Share Posted July 3, 2017 Oh, dude is small-sized. I forgot to check that. ah ha! THX! Ok, for #96 playground... shadows appear/disappear as light rises. You see that, @Deltakosh? Looks normal? Perhaps I worry too much. I want BJS 3+ series to be max-sweet, and I want to be an informed forum helper. When light is 35 units Y, the first "shadow disappearing" happens (see line 35, here). It also happens when light is 75 or 155 units. Same for higher values, too. User might ask "Why do shadows work with light at 25 or 45 Y-units, but NOT at 35 Y-units?". We might need to answer them. Perhaps a "precision-range change-over" happens when light is at Y-pos 35, 75, and 155 height? I'm not sure how to answer user question, and/or how to write this in docs. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 3, 2017 Share Posted July 3, 2017 We are fighting with precision still but in a different way this time the light can see the shadow casters but due to inherent precision lost we are facing...shadow depth fighting you can fix it by helping the shadow generator with a small bias: http://www.babylonjs-playground.com/#1EVNNB#100 This is the same reason we can have shadow acne Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.