Search Unity

Resolved Accessing all Camera properties in HDRP

Discussion in 'Scripting' started by Cheo6, May 20, 2020.

  1. Cheo6

    Cheo6

    Joined:
    Nov 20, 2017
    Posts:
    28
    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 !
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,911
  3. Cheo6

    Cheo6

    Joined:
    Nov 20, 2017
    Posts:
    28
  4. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,911
    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 :D
     
  5. berniegp

    berniegp

    Unity Technologies

    Joined:
    Sep 9, 2020
    Posts:
    42
    For completeness,
    HDCamera.GetOrCreate(camera)
    gives access to the HDCamera associated with a Camera.
     
    Glaswyll, GregBahm and PraetorBlue like this.