Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit 9557fcc

Browse files
committed
Merge branch 'ldr-lut-srgb' into v2
2 parents afe4b85 + 7d99986 commit 9557fcc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

PostProcessing/Shaders/Builtins/Uber.shader

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ Shader "Hidden/PostProcessing/Uber"
215215
#elif COLOR_GRADING_LDR_2D
216216
{
217217
color = saturate(color);
218+
219+
// LDR Lut lookup needs to be in sRGB - for HDR stick to linear
220+
color.rgb = LinearToSRGB(color.rgb);
218221
color.rgb = ApplyLut2D(TEXTURE2D_PARAM(_Lut2D, sampler_Lut2D), color.rgb, _Lut2D_Params);
222+
color.rgb = SRGBToLinear(color.rgb);
219223
}
220224
#endif
221225

PostProcessing/Shaders/Colors.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ half3 ApplyLut2D(TEXTURE2D_ARGS(tex, samplerTex), float3 uvw, float3 scaleOffset
468468
{
469469
// Strip format where `height = sqrt(width)`
470470
uvw.z *= scaleOffset.z;
471-
half shift = floor(uvw.z);
471+
float shift = floor(uvw.z);
472472
uvw.xy = uvw.xy * scaleOffset.z * scaleOffset.xy + scaleOffset.xy * 0.5;
473473
uvw.x += shift * scaleOffset.y;
474474
uvw.xyz = lerp(

0 commit comments

Comments
 (0)