-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TSL: Using a custom vertexNode is breaking the normalLocal of a BatchedMesh #29393
Comments
Sorry I reopened it because I found a fix for InstancedMesh using |
I added a jsfiddle example here, I hope this can help: You can see here the lighting is broken when I use my custom vertexNode (I used a directionnal light), if I comment this line : |
I found a fix using |
When adding a point light to the scene, the lights seems totally broken again : https://jsfiddle.net/oc0gkyqa/8/ |
@Makio64 To handle lights you also need to update the positionView accodingly: |
@RenaudRohlinger Merci! This was bugging me so hard! 🙇♂️ |
Description
I'm using TSL with a MeshStandardNodeMaterial on a BatchedMesh. I have a custom vertexNode reusing the logic of BatchNode so I can apply custom bending effect on it later on.
However when doing that the lights of my BatchedMesh are broken (not in the correct direction). When I remove the vertexNode (using the default shader) it fixes it.
Does it mean the vertexNode is overwriting the normalLocal so the fragment doesn't have the correct vNormals anymore? but weirdly I have the normalLocal assigned.
Does it also mean if I want to customise the fragment part I will have to rewrite the whole StandardNodeMaterial fragment shader in the outputNode to get the lights right?
Thank you
Reproduction steps
Code
Version
0.168.0
The text was updated successfully, but these errors were encountered: