You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
please correct me if I am wrong, but it seems that your material is not working with InstancedMesh. Basically the positioning doesn't have any effect.
I've found this reddit thread , while not directly tied to your material the suggestion is to use this gl_Position = projectionMatrix * viewMatrix * modelMatrix * instanceMatrix * vec4(position, 1.0).
Which I did and swapped the gl_Position line in your shader code with the above and it worked.
Is this the right approach if using InstancedMesh?
The text was updated successfully, but these errors were encountered:
Hey. Thank you very much for your feedback. This is awesome. If you can, just send me a PR and I can merge it okay? I tested with animated meshes but not with instanced meshes so your approach is probably right!
No problem, glad that I could help. I'll submit PR tomorrow if it is ok with you, I am away from the computer right now.
P.S.
How would you check if InstancedMesh is used? I haven't tried, but I guess that the above line won't work for regular meshes. This is just my guess, I am far from expert.
Hey,
please correct me if I am wrong, but it seems that your material is not working with
InstancedMesh
. Basically the positioning doesn't have any effect.I've found this reddit thread , while not directly tied to your material the suggestion is to use this
gl_Position = projectionMatrix * viewMatrix * modelMatrix * instanceMatrix * vec4(position, 1.0)
.Which I did and swapped the
gl_Position
line in your shader code with the above and it worked.Is this the right approach if using
InstancedMesh
?The text was updated successfully, but these errors were encountered: