SvenFrankson Posted June 15, 2017 Share Posted June 15, 2017 Hi, I'm currently trying to have shadows layered on top of the other, with several objects in front of the light. Here is a small playground demonstrating the topic https://www.babylonjs-playground.com/#4SHZMX#1 Box1 and Box2 are shadowed by their own shape, but I can't find a way to work around it. By toggling "receiveShadows" off for them, we can't see Box2 shadow projected on Box1. I'm not so familiar with ShadowMaps, but as far as I understood it, it contains a depth value so my issue should be solvable. Or is it something we can't do with BabylonJS ? Many thanks for your inputs on this, have a nice day ! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 15, 2017 Share Posted June 15, 2017 You are doing great But you face one of the most painful part of dynamic shadows: the self shadowing You have to REALLY fine tune the shadows to get the result you need: https://www.babylonjs-playground.com/#4SHZMX#5 Quote Link to comment Share on other sites More sharing options...
SvenFrankson Posted June 15, 2017 Author Share Posted June 15, 2017 Okay, I had not thought depthScale had to be so high, thanks ! As we have quite a dynamic scene concerning objects positions, with elements of very different scales, etc, I'm pretty sure it will be to complex to predict these values from the scene layout. I'll try to update the Playground with another attempt using different ShadowGenerator (we already do something like this for Reflection cubeTexture using probes, and it kinda works fine). Obviously, thanks again for you impressive reactivity. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 15, 2017 Share Posted June 15, 2017 My pleasure. Please also consider using directional light instead of point. Both work obviously but point are expensive as they generate a cubemap on every frame (plus blurring if you use blurred ESM) 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.