Jump to content

Updating shadow based on vertex shader displacements


alexolotl
 Share

Recommended Posts

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!

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...