babbleon Posted January 19, 2018 Share Posted January 19, 2018 Hello, I am using shadowGenerator.useBlurCloseExponentialShadowMap = true; to cast shadows. Oddly, the closer the shadow casting mesh is to the shadow receiving mesh, the lighter the shadows.. see attached pic. I am not using this for self-shadowing, just to cast a shadow from one mesh to another. I appreciate shadow / lighting setup is or can be complex, but is this behaviour expected or am I misusing useBlurCloseExponentialShadowMap ? Thank you Quote Link to comment Share on other sites More sharing options...
Wingnut Posted January 19, 2018 Share Posted January 19, 2018 Hiya babbleon! Ummm, boy, I'm not very experienced with these fancy shadows, but I noticed one thing (possibly worthless)... https://www.babylonjs-playground.com/#ITTNDX#12 Play-around with activating/de-activating lines 29/30. I don't know if anything helpful can be discovered in this playground, but maybe. useBlurExponentialShadowMap seems to eliminate the gap. But, I did not answer your "Is this expected behavior? ...question, did I? Sorry. Perhaps others will comment soon. Stay tuned. renjianfeng 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 19, 2018 Share Posted January 19, 2018 Hello close shadows are really useful when the extends of the scene is near 1. Furthermore you have to precisely define the light.shadowMaxZ/MinZ in this mode. Quote Link to comment Share on other sites More sharing options...
babbleon Posted January 23, 2018 Author Share Posted January 23, 2018 Many thanks @Wingnut & @Deltakosh and sorry for the late reply. Using useBlurExponentialShadowMap makes my shadows start at the base of the leg. However, I am intrigued by the use of useBlurCloseExponentialShadowMap and if somehow it's possible to reverse the falloff of the shadow so that it is more intense on the ground closest to the base of the leg and then eventually disappears. I have played around with the light.shadowMaxZ & light.shadowMinZ but I cannot make it look how I imagined, not a great example but a bit like the image in the link below: https://pixabay.com/en/furniture-dining-table-chair-wood-964584/ (see how the shadow is more intense on floor closer to the leg and then just fades away). This isn't vital to get the shadow falloff like on the above, but would be cool if I could! Cheers, Wingnut 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 23, 2018 Share Posted January 23, 2018 This is based on a tech named contact hardening shadows which is not really (or at least directly) supported by Bjs so far Quote Link to comment Share on other sites More sharing options...
babbleon Posted March 5, 2018 Author Share Posted March 5, 2018 @Deltakosh - would you be able to point me to the relevant part of the code where the magic of useBlurCloseExponentialShadowMap happens please? I feel as though the (useBlurCloseExponentialShadowMap) shadows currently have an inverted intensity - see my first post in this thread. Thank you Quote Link to comment Share on other sites More sharing options...
babbleon Posted March 6, 2018 Author Share Posted March 6, 2018 sorry...found it: https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/ShadersInclude/shadowsFragmentFunctions.fx GameMonetize 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.