Setting unity_LightData manually

Hey there,

I’ve written a custom ScriptableRenderPass that uses CommandBuffer.DrawRenderer to draw stuff instead of ScriptableRenderContext.DrawRenderers. I thought since the command buffer is executed via ScriptableRenderContext.ExecuteCommandBuffer that all the per object light data would be set automatically however it seems that ScriptableRenderContext.DrawRenderers is responsible for doing this per draw via the PerObjectData flag mechanism.

So I’m wondering if I can somehow mimic what ScriptableRenderContext.DrawRenderers is doing under the hood to set the per object lighting data?

bump… encountering similar issue. IMO Universal should not be using these legacy things as it limits what is possible with extending via custom passes, a lot of this “it just works” internal engine stuff is rarely documented and ends up being a blocker.

It would be great if instead Unity on the engine side gets updated to allow defining custom per-object render data, which URP and HDRP and user-created rendering solutions could make use of.

Bump I need this also

no shadow no additional Light

I’ve been having the same problem all day. Am doing a sort of ray marching in a post processing effect inside a render pass and would need to have lighting data. So far it’s been really hard to get this working. Values seem set by Unity as global uniforms but they’re not always updated.