alexolotl Posted November 27, 2016 Share Posted November 27, 2016 I'm morphing an object's vertices using a vertex shader in Babylon.js. The morphed object looks great, but I can't figure out a way to cause the object's shadow to update as well. I know in Three.js there is a customDepthMaterial for a mesh where you can pass in the same custom vertex shader and correctly update the object's shadow, but is there something similar in Babylon.js? Thanks! Quote Link to comment Share on other sites More sharing options...
Klaas Posted November 28, 2016 Share Posted November 28, 2016 Hi alexolotl, babylon replaces the material when rendering the depthpass for a shadowmap. Therefore your vertex shader did not apply on the shadow pass. Currently babylon has no method to assign custom depthMaterial (but it would be a nice to have) The only way by now would be to customize the shadowGenerator class and the shadowVertex shader. dbawel 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 28, 2016 Share Posted November 28, 2016 Yep @Klaas is correct this is the shader you need to update: https://github.com/BabylonJS/Babylon.js/blob/master/src/Shaders/shadowMap.vertex.fx 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.