Fridolin Posted June 7, 2017 Share Posted June 7, 2017 I have a large model exported from a software with a lot of nested instances. I added a shadow generator with defaults and added most meshes to its renderList. The console recommends to use Exponential Shadow Maps (ESM) which look also a lot nicer ("VSM are now replaced by ESM. Please use useExponentialShadowMap instead"). With ESM enabled, the scene turns mostly black because shadows are rendered also on top of those meshes that cast that part of the shadow. The issue only disappears when the shadow generator has only a single mesh in the renderList. See here: http://www.babylonjs-playground.com/#7CPG3X Is this a bug? Is ESM not yet stable (although the console recommends using it)? Is there a work-around? --- Another question: My model is mostly static. Are shadow maps regenerated at every frame or only when something (lights, meshes) changes? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 7, 2017 Share Posted June 7, 2017 You have multiple options: - Remove the caster from the list of shadow receivers. This is the best option by far - Play with bias and depthScale: http://www.babylonjs-playground.com/#7CPG3X#1 (doc: http://doc.babylonjs.com/tutorials/shadows#exponential-shadow-map) Regarding update of the shadow map, you can set the refreshRate to 0 (The refreshrate property is set to 0 if you want the texture to only render once. If set to 1, it will render every frame, 2 every two frames, etc.) Quote Link to comment Share on other sites More sharing options...
Fridolin Posted June 7, 2017 Author Share Posted June 7, 2017 Thank you very much! I cannot keep shadow casters and receivers completely separate (due to self-shadowing). But if select self-shadowing objects in the same depthmap are not too distant, I can mitigate the issue with bias and depthScale. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 8, 2017 Share Posted June 8, 2017 On behalf of all of us, welcome to the forum, Fridolin... good to have you with us. Feel free to teach us things that you learn (thx). Freely adjust our documentation, if you think adjustments need to be made. You can also write NEW documentation/tutorials, such as "Advanced ESM Shadow Techniques". It needs to be written in GitHub .md markdown... which is real easy to learn. Then put the .md file into the correct GitHub folder. Finally, adjust/add-to a file called statics.json. After a fresh "docs-build", your new document will be rendered-as-HTML, and included in the BJS docs site (and you'll become a BJS super-hero). More info here. Welcome again. 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.