summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_occlude_props.sc
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_occlude_props.sc')
-rw-r--r--3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_occlude_props.sc7
1 files changed, 7 insertions, 0 deletions
diff --git a/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_occlude_props.sc b/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_occlude_props.sc
index aced7da3c44..2648eb4d075 100644
--- a/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_occlude_props.sc
+++ b/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_occlude_props.sc
@@ -51,6 +51,9 @@ void main()
//transform World space aaBox to NDC
vec4 clipPos = mul( u_viewProj, vec4(boxCorners[i], 1) );
+#if BGFX_SHADER_LANGUAGE_GLSL
+ clipPos.z = 0.5 * ( clipPos.z + clipPos.w );
+#endif
clipPos.z = max(clipPos.z, 0);
clipPos.xyz = clipPos.xyz / clipPos.w;
@@ -83,6 +86,10 @@ void main()
if (dims.x <= 2 && dims.y <= 2)
mip = level_lower;
+#if BGFX_SHADER_LANGUAGE_GLSL
+ boxUVs.y = 1.0 - boxUVs.y;
+ boxUVs.w = 1.0 - boxUVs.w;
+#endif
//load depths from high z buffer
vec4 depth =
{