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

Call SRGBToLinear in Bloom FragPrefilter Pass #629

Open
wants to merge 3 commits into
base: v2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion PostProcessing/Shaders/Builtins/Bloom.shader
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Shader "Hidden/PostProcessing/Bloom"
{
HLSLINCLUDE

#include "../StdLib.hlsl"
#include "../Colors.hlsl"
#include "../Sampling.hlsl"
Expand Down Expand Up @@ -31,12 +31,26 @@ Shader "Hidden/PostProcessing/Bloom"
half4 FragPrefilter13(VaryingsDefault i) : SV_Target
{
half4 color = DownsampleBox13Tap(TEXTURE2D_PARAM(_MainTex, sampler_MainTex), i.texcoord, UnityStereoAdjustedTexelSize(_MainTex_TexelSize).xy);

#if UNITY_COLORSPACE_GAMMA
{
color = SRGBToLinear(color);
}
#endif

return Prefilter(SafeHDR(color), i.texcoord);
}

half4 FragPrefilter4(VaryingsDefault i) : SV_Target
{
half4 color = DownsampleBox4Tap(TEXTURE2D_PARAM(_MainTex, sampler_MainTex), i.texcoord, UnityStereoAdjustedTexelSize(_MainTex_TexelSize).xy);

#if UNITY_COLORSPACE_GAMMA
{
color = SRGBToLinear(color);
}
#endif

return Prefilter(SafeHDR(color), i.texcoord);
}

Expand Down