Set RenderConfiguration flags when not drawing via ScriptableRenderContext.DrawRenderers

Hi,

We have a custom render pipeline in development for our project. We have full custom shaders, but they take advantage of built-in indirect lighting shader constants (unity_SHAr, unity_SHAg, …, unity_SpecCube0, unity_SpecCube0_HDR, …).

It is easy to utilize this when using ScriptableRenderContext.DrawRenderers, all you have to do is set
RendererConfiguration.PerObjectReflectionProbes | RendererConfiguration.PerObjectLightProbe flags to the RendererConfiguration of the DrawRendererSettings structure passed to the DrawRenderers funcion, and the system sets these constants to the shader when rendering.

In our project, some of our objects are not rendered by renderer components (MeshRenderer, SkinnedMeshRenderer, …). Their mesh is drawn manually via CommandBuffer.DrawMesh or CommandBuffer.DrawMeshInstancedIndirect in a command buffer that is passed from our render pipeline. The lighting constants I mentioned above are still set when drawing manually in editor, but they are missing in build.

Is there a way to ask the context to set these constants to a command buffer, so they can be expected in a shader when rendering manually? Or can I get these resources somehow, so I can set them manually?

Thanks in advance,
Gábor Szalóki

Any idea?

I reported a bug on this: Unity Issue Tracker - No lighting is received when Mesh is drawn with CommandBuffer.DrawRenderer in Build