Accessing all Camera properties in HDRP

Hello, I was just trying to modify the aperture property of a camera in C#, but I realized I couldn’t access it and many others directly. I added the “UnityEngine.Rendering.HighDefinition” and “UnityEngine.Rendering.HighDefinition.Attributes” namespaces which allow using the HDCamera and HDPhysicalCamera classes, but I still don’t understand how to access their properties in a camera component. Can anyone please explain me how to do that ? Thanks in advance !

Maybe you’re looking for this? The Universal Additional Camera Data component | Universal RP | 9.0.0-preview.72

You sent me a URP doc link, but it has an equivalent in HDRP : the HDAdditionalCameraData, an empty component attached to every camera. It’s the first time I am using it ! It doesn’t have a manual page of its own though, it’s only mentioned in the HDCamera page Redirecting to latest version of com.unity.render-pipelines.high-definition

Anyway, thanks for your help, you put me on the right track :3

Oops sorry! I googled the HDRP one but apparently found the URP one by accident. Anyway glad I was able to clumsily prod you in the right direction :smile:

For completeness, HDCamera.GetOrCreate(camera) gives access to the HDCamera associated with a Camera.

3 Likes