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
Is your feature request related to a problem? Please describe.
Yes, as document describes, material cannot be shared by Mesh and InstanceMesh. So when I set override material of scene, it would no work on one of Mesh and InstanceMesh.
I guess this is because the material will be compiled before rendering. Once a Mesh object is rendered first, the vertexShader of the material will not contain the code blocks required by InstanceMesh.
So, for example, when I render a scene contains Mesh and InstanceMesh, and use a BokehPass which required a override material to render a depth buffer, it will trigger a visual bug.
Describe the solution you'd like
Add an overriedMaterialForInstance property to Scene, and once the overrideMaterial is set, we clone it to overriedMaterialForInstance.
Inside the renderObjects function of WebGLRenderer. we override object's material based on whether it is instanceof Mesh or InstanceMesh.
If you think the solution I proposed is feasible, I am willing to submit a PR.
Describe alternatives you've considered
None.
Additional context
None.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Yes, as document describes, material cannot be shared by Mesh and InstanceMesh. So when I set override material of scene, it would no work on one of Mesh and InstanceMesh.
I guess this is because the material will be compiled before rendering. Once a Mesh object is rendered first, the vertexShader of the material will not contain the code blocks required by InstanceMesh.
So, for example, when I render a scene contains Mesh and InstanceMesh, and use a BokehPass which required a override material to render a depth buffer, it will trigger a visual bug.
Describe the solution you'd like
If you think the solution I proposed is feasible, I am willing to submit a PR.
Describe alternatives you've considered
None.
Additional context
None.
The text was updated successfully, but these errors were encountered: