Search Unity

HDR Colour Picker?

Discussion in 'Shaders' started by simba2222, Jan 14, 2022.

  1. simba2222

    simba2222

    Joined:
    Sep 30, 2021
    Posts:
    1
    I'm new to this unity thing and I keep seeing a HDR Colour Picker that has an intensity slider, can anyone tell me how to access it?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    For c# script variables, use:
    Code (csharp):
    1. [ColorUsageAttribute(false, true)] public Color myColor;
    or
    Code (csharp):
    1. [ColorUsageAttribute(false, true), SerializeField] private Color myColor;
    The first bool is whether or not the color picker should show an alpha slider, the second is if the color is HDR or not.
    https://docs.unity3d.com/ScriptReference/ColorUsageAttribute-ctor.html

    For shader properties, use:
    Code (csharp):
    1. [HDR] _Color ("HDR Color", Color) = (1,1,1,1)