Hello,
I have to draw object silhouettes. For each object that I draw I may have to change material properties.
I managed to do this easily with non-skinned meshes using material property blocks and RasterCommandBuffer.DrawMesh().
However, I also want to draw skinned mesh renderers and here lies the problem. The RasterCommandBuffer.DrawRenderer() function doesn’t accept material property blocks. It accepts a material only. The problem is that I would like to change the material properties between different DrawRenderer calls. However, this doesn’t work because the command buffer doesn’t execute immediately. So only the last set properties will be used.
It seems like the only way to solve this would be to execute each DrawRenderer call on the spot. Does anybody know how to do this? Is there some kind of Execute function that I can use. Using Graphics.ExecuteCommandBuffer() only works with the CommandBuffer class. There is no overload for the RasterCommandBuffer class.
Also, is there a way to draw terrain geometry using the RasterCommandBuffer?
I am using URP RenderGraph to do the rendering.
Thanks,
Andrew