Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | tor |
Hi,
I would like to use a single ShaderMaterial for multiple mesh instances while being able to change some specific shader parameters for each mesh instance, but I couldn’t.
The reason is that I send large textures to this shader, but I don’t want to send them again and again for each mesh (performance issue). This is not a problem as it would be enough for all the mesh instances to share the same material, but the thing is that I need some parameters to change according to the mesh being drawn.
How can I do that? Is there some method called before the actual draw process in which I can set the shader parameters before the mesh is drawn? Is there another way I can achieve what I am trying to do?
Thanks a lot.