Hi everyone
When I use CustomPass in HDRP to perform the drawing process of material overlay, CoreUtils.DrawRendererList ();
HDUtils.DrawRendererList();
CommandBuffer.DrawRendererList();
These methods all require RenderList parameters, and this parameter cannot specify a specific Renderer.
I tried to use LayerMask to filter specific Renderers (in fact, I have done this when implementing X-ray effects), but LayerMask obviously cannot solve all problems.
Then I tried to use CommandBuffer.DrawRenderer(); Add components on GameObject to get Renderers and add them to a List, and finally perform rendering through polling, which is close to what I ultimately want But when I check in FrameDebuger, I find that each time CommandBuffer.DrawRenderer() is executed A rendering process will be added and SRPBatch will not be performed.
It all started because I wanted to achieve an effect that allows me to overlay a material on any existing Renderer and perform some animation effects. For example, when the character is upgraded, the body is covered with golden light.
I don’t want to write material effects into each Shader, and I don’t want to modify the Renderer.SharedMaterial array because some models have SubMeshes.
I hope there is a way to render a specified Renderer and trigger SRPBatch
I hope to get your help, thank you.