25
2019
Enable HDR Color picker for Shader or Script
I needed HDR color for some old Unlit/Color-shader, and for c# script also, found out that you can add this attribute for the shader:
// BEFORE (no hdr color picker)
_Color ("Main Color", Color) = (1,1,1,1)
// AFTER (hdr color picker)
[HDR]_Color ("Main Color", Color) = (1,1,1,1)
And for the script:
// BEFORE
public Color shouldbeHDR = Color.white;
// AFTER
[ColorUsage(true, true)]
public Color shouldbeHDR = Color.white;
More info:
https://docs.unity3d.com/ScriptReference/ColorUsageAttribute.html
https://docs.unity3d.com/Manual/SL-Properties.html
Also make sure your Camera has [x] HDR enabled

Related Posts
5 Comments + Add Comment
Leave a comment
Recent posts
- .unityignore : Hide files from Project window
- PostBuild Script to Create Single exe Standalone File
- Game Loop Designer
- Favorites in PackageManager
- LudumDare59 : Signal
- Unity Editor: Tree Generator
- Leaf/Foliage Generator Tools (Runs in Browser)
- Testing Unity AI Beta
- Ways to Support UnityCoder Development
- Using UI Slider to Create 5-Star Rating Element
- Game Music Library For Unity (editor plugin)
- Fontastic : Easily Test Fonts in Unity Editor!
Recent Comments
Coin:
CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS
An article by












Hi there i have a shader that im trying to make HDR can you please explain more
im in the script i added the code no error i saved it and nothing change still the same color picker
[…] La Source Étiquetteswhatever […]
[…] Kaynak whatever whatever […]
Thanks