Unable to transform mesh instance using shader material

Recommended Posts

I was unable to transform mesh instance if the original mesh had a shader material. Is this a bug?


I have created a playground example using box mesh. If you open the debug -> mesh panel, you realize there are 6 meshes, but only 5 are displayed. This is because one of the instances in the second row was not transformed properly. On the other hand, clones of meshes with shader material can be transformed properly.

Share this post

Link to post
Share on other sites

Thank you @Deltakosh, you solved my problem but explained it wrong. It's actually not because I was using a different material than the original mesh, but rather I did not know that in order to render transformed mesh instance with custom shader:

1. You need to use #include<instanceDeclaration> and #include<instanceVertex> in the custom shader.

2. You need to use ”viewprojection” and ”finalworld” instead of ”worldviewprojection” in the custom shader. 

However the above variables are not documented in the custom shader session. Wondering if there is any more hidden variables that we need to know when working with custom shader?

Anyway thanks a lot for your solution!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.