-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCameraDebuggerPasses.hlsl
More file actions
62 lines (49 loc) · 1.2 KB
/
CameraDebuggerPasses.hlsl
File metadata and controls
62 lines (49 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef CAMERA_DEBUGGER_PASSES_INCLUDED
#define CAMERA_DEBUGGER_PASSES_INCLUDED
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Debug.hlsl"
float _DebugOpacity;
TEXTURE2D(_SourceTexture);
struct Varyings
{
float4 positionCS : SV_POSITION;
float2 screenUV : VAR_SCREEN_UV;
};
Varyings DefaultPassVertex (uint vertexID : SV_VertexID)
{
Varyings output;
output.positionCS = float4
(
vertexID <= 1 ? -1.0 : 3.0,
vertexID == 1 ? 3.0 : -1.0,
0.0, 1.0
);
output.screenUV = float2
(
vertexID <= 1 ? 0.0 : 2.0,
vertexID == 1 ? 2.0 : 0.0
);
if (_ProjectionParams.x < 0.0)
{
output.screenUV.y = 1.0 - output.screenUV.y;
}
return output;
}
float4 ForwardPlusTilesPassFragment(Varyings input) : SV_TARGET
{
ForwardPlusTile tile = GetForwardPlusTile(input.screenUV);
float3 color;
if (tile.IsMinimumEdgePixel(input.screenUV))
{
color = 1.0;
}
else
{
color = OverlayHeatMap(
input.screenUV * _CameraBufferSize.zw, tile.GetScreenSize(),
tile.GetLightCount(), tile.GetMaxLightsPerTile(), 1.0).rgb;
}
//color = float3(input.screenUV / _ForwardPlusTileSettings.xy, 1);
//color = float3(tile.GetMaxLightsPerTile() / 10, 1, 1);
return float4(color, _DebugOpacity);
}
#endif