File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed
Assets/ScriptableRenderLoop
HDRenderLoop/Lighting/TilePass Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 19
19
20
20
float FetchDepth (Texture2D depthTexture, uint2 pixCoord)
21
21
{
22
- return 1.0 - LOAD_TEXTURE2D (depthTexture, pixCoord.xy).x;
22
+ float zdpth = LOAD_TEXTURE2D (depthTexture, pixCoord.xy).x;
23
+ #if !defined (SHADER_API_GLES3) && !defined (SHADER_API_GLCORE)
24
+ zdpth = 1.0 - zdpth;
25
+ #endif
26
+ return zdpth;
23
27
}
24
28
25
29
float FetchDepthMSAA (Texture2DMS <float > depthTexture, uint2 pixCoord, uint sampleIdx)
26
30
{
27
- return 1.0 - LOAD_TEXTURE2D_MSAA (depthTexture, pixCoord.xy, sampleIdx).x;
31
+ float zdpth = LOAD_TEXTURE2D_MSAA (depthTexture, pixCoord.xy, sampleIdx).x;
32
+ #if !defined (SHADER_API_GLES3) && !defined (SHADER_API_GLCORE)
33
+ zdpth = 1.0 - zdpth;
34
+ #endif
35
+ return zdpth;
28
36
}
29
37
30
38
#endif
Original file line number Diff line number Diff line change 31
31
32
32
float FetchDepth (Texture2D depthTexture , uint2 pixCoord )
33
33
{
34
- return 1 - depthTexture .Load (uint3 (pixCoord .xy , 0 )).x ;
34
+ float zdpth = depthTexture .Load (uint3 (pixCoord .xy , 0 )).x ;
35
+ #if !defined(SHADER_API_GLES3 ) && !defined(SHADER_API_GLCORE )
36
+ zdpth = 1.0 - zdpth ;
37
+ #endif
38
+ return zdpth ;
35
39
}
36
40
37
41
float FetchDepthMSAA (Texture2DMS < float > depthTexture , uint2 pixCoord , uint sampleIdx )
38
42
{
39
- return 1 - depthTexture .Load (uint3 (pixCoord .xy , 0 ), sampleIdx ).x ;
43
+ float zdpth = depthTexture .Load (uint3 (pixCoord .xy , 0 ), sampleIdx ).x ;
44
+ #if !defined(SHADER_API_GLES3 ) && !defined(SHADER_API_GLCORE )
45
+ zdpth = 1.0 - zdpth ;
46
+ #endif
47
+ return zdpth ;
40
48
}
41
49
42
50
#endif
You can’t perform that action at this time.
0 commit comments