I’m trying to upgrade a Babylon 4 project to 5. It works out of the box for the most part, except for an issue with shadows not generating. I’m relatively new to shaders, so I was wondering if it might be obvious to one of you why this code works in 4.2.1Babylon.js Playground but https://playground.babylonjs.com/#TWD7EG#1 does not load shadows in latest.
When upgrading to 5, I did have to change two includes because it seems there were some name changes. #include<shadowMapVertexDeclaration> to #include<shadowMapVertexExtraDeclaration> and #include<shadowMapFragmentDeclaration> to #include<shadowMapFragmentExtraDeclaration>.
Is there an upgrade guide for shaders that I may have missed as well?
I don’t have an answer for the problem, but I have a feeling it may be something related to the changes to the shader store, the new material plugin system, and changes to nme. I did a general search on the docs, maybe some of the examples that come up on the right side could be helpful .Search page | Babylon.js Documentation ,
especially this one is using an NME snippet with BABYLON.CascadedShadowGenerator and BABYLON.ShadowGenerator
here are the docs on the new material plugin. I don’t think its required to manually upgrade or anything, but probably just generally useful to read sometime. It’s kind of hard to find without knowing it’s there.
Yes, for optimization sake we are now using the mesh/scene ubos in the shadow generator code. Note that in your case you also need to remove the declaration of world which is coming from the vertex include.