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
- [GreaseMonkey] Unity Forum Fixer
- UnityHub: Make Hub application background Translucent
- Customize SpriteShapeRenderer quality (but has issues)
- Editor tool: Copy selected gameobject’s names into clipboard as rows (for Excel)
- Editor tool: Replace string in selected gameobject’s names
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
- Custom Unity Hub Project Template Preview Image/Video (using HTML+CSS in package description)
Recent Comments
- Vector3 maths for dummies! on
- UnityHub: Make Hub application background Translucent on
- UnityHub: Make Hub application background Translucent on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- [Asset Store] Point Cloud Viewer & Tools on
- [Asset Store] Point Cloud Viewer & Tools on
- ffmpeg stream raw video into Unity Texture2D on
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