#world normals from camera

1 messages · Page 1 of 1 (latest)

past apex
#

how do I spawn a camera and write the world normals of everything that camera sees to a rendertexture? I've read about RenderWithShader and it apparently isnt supported in urp and I have no idea how else to achieve this.

modest raven
#

If you need normals from the view of the Main Camera, URP can generate it for you by using a custom renderer feature with pass.ConfigureInput(ScriptableRenderPassInput.Normal);. Some provided features like SSAO and Fullscreen should already have options (source/requirements) to make URP generate it too

If you need it from a different view/camera. Could probably set up an additional Universal Renderer asset with a Fullscreen feature. Assign it to URP asset and select that on the camera's Renderer dropdown.
For material/shader on feature, sample _CameraNormalsTexture or use URP Sample Buffer node in a Fullscreen Graph to output that to the camera. And assign a RenderTexture asset to the camera's output texture field to capture that.