[LWRP 5.x] where would you put Shader.SetGlobalFloat now?

Before 5.x we put Shader.SetGlobalFloat in IBeforeCameraRender, that’s gone now.

The new approach is a completely “material-based”, how do I go about passing some data via code?

Update: looks like new way to do it is to implement ScriptableRenderPass and ScriptableRendererFeature.

It’s in the example’s Scripts folder:

https://github.com/Unity-Technologies/LWRP-CustomRendererExamples

You can set global per-frame or per-camera shader data with begin camera or frame callbacks Unity - Scripting API: RenderPipelineManager

1 Like