Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Accessing all Camera properties in HDRP

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

  1. Cheo6

    Cheo6

    Joined:
    Nov 20, 2017
    Posts:
    22
    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,722
  3. Cheo6

    Cheo6

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

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,722
    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:
    41
    For completeness,
    HDCamera.GetOrCreate(camera)
    gives access to the HDCamera associated with a Camera.
     
    Glaswyll, GregBahm and PraetorBlue like this.