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

Commit 82f0ab9

Browse files
committed
Merge remote-tracking branch 'refs/remotes/Unity-Technologies/master'
2 parents 839b431 + 97d8387 commit 82f0ab9

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

PostProcessing/Editor/Models/BuiltinDebugViewsEditor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public override void OnInspectorGUI()
8686
else
8787
{
8888
CheckActiveEffect(mode == (int)Mode.AmbientOcclusion && !profile.ambientOcclusion.enabled, "Ambient Occlusion");
89+
CheckActiveEffect(mode == (int)Mode.FocusPlane && !profile.depthOfField.enabled, "Depth Of Field");
8990
CheckActiveEffect(mode == (int)Mode.EyeAdaptation && !profile.eyeAdaptation.enabled, "Eye Adaptation");
9091
CheckActiveEffect((mode == (int)Mode.LogLut || mode == (int)Mode.PreGradingLog) && !profile.colorGrading.enabled, "Color Grading");
9192
CheckActiveEffect(mode == (int)Mode.UserLut && !profile.userLut.enabled, "User Lut");

PostProcessing/Resources/Shaders/BuiltinDebugViews.shader

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ Shader "Hidden/Post FX/Builtin Debug Views"
2929
{
3030
float depth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, UnityStereoScreenSpaceUVAdjust(i.uv, _CameraDepthTexture_ST));
3131
depth = Linear01Depth(depth) * _DepthScale;
32-
return float4(depth.xxx, 1.0);
32+
float3 d = depth.xxx;
33+
34+
#if !UNITY_COLORSPACE_GAMMA
35+
d = GammaToLinearSpace(d);
36+
#endif
37+
38+
return float4(d, 1.0);
3339
}
3440

3541
// -----------------------------------------------------------------------------
@@ -49,6 +55,11 @@ Shader "Hidden/Post FX/Builtin Debug Views"
4955
float4 FragNormals(VaryingsDefault i) : SV_Target
5056
{
5157
float3 n = SampleNormal(UnityStereoScreenSpaceUVAdjust(i.uv, _CameraDepthNormalsTexture_ST));
58+
59+
#if UNITY_COLORSPACE_GAMMA
60+
n = LinearToGammaSpace(n);
61+
#endif
62+
5263
return float4(n, 1.0);
5364
}
5465

PostProcessing/Resources/Shaders/DepthOfField.shader

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Shader "Hidden/Post FX/Depth Of Field"
1818
Pass
1919
{
2020
CGPROGRAM
21+
#pragma multi_compile __ UNITY_COLORSPACE_GAMMA
2122
#pragma vertex VertDOF
2223
#pragma fragment FragPrefilter
2324
#include "DepthOfField.cginc"

0 commit comments

Comments
 (0)