diff --git a/src/AcDream.App/Rendering/Shaders/portal_stencil.frag b/src/AcDream.App/Rendering/Shaders/portal_stencil.frag index ba71c36..7ff1582 100644 --- a/src/AcDream.App/Rendering/Shaders/portal_stencil.frag +++ b/src/AcDream.App/Rendering/Shaders/portal_stencil.frag @@ -10,25 +10,16 @@ // Matches WorldBuilder's PortalStencil.frag at // references/WorldBuilder/Chorizite.OpenGLSDLBackend/Shaders/PortalStencil.frag -out vec4 FragColor; - uniform int uWriteFarDepth; void main() { if (uWriteFarDepth != 0) { - // Write far depth to clear the depth buffer in the portal region. - // This punches through the building exterior's depth so interior - // geometry at any depth can be rendered through the stencil mask. gl_FragDepth = 1.0; } else { gl_FragDepth = gl_FragCoord.z; } - - // Color writes are suppressed via ColorMask(false) on the CPU side. - // Output is required by GLSL but will not be written to the framebuffer. - FragColor = vec4(0.0); } diff --git a/src/AcDream.App/Rendering/Shaders/portal_stencil.vert b/src/AcDream.App/Rendering/Shaders/portal_stencil.vert index adb4d60..bdd118f 100644 --- a/src/AcDream.App/Rendering/Shaders/portal_stencil.vert +++ b/src/AcDream.App/Rendering/Shaders/portal_stencil.vert @@ -12,14 +12,5 @@ uniform mat4 uViewProjection; void main() { - vec4 pos = uViewProjection * vec4(aPosition, 1.0); - - // Prevent near-zero clipping issues when the camera is perfectly - // coplanar with the portal polygon. - if (abs(pos.w) < 0.001) - { - pos.w = pos.w < 0.0 ? -0.001 : 0.001; - } - - gl_Position = pos; + gl_Position = uViewProjection * vec4(aPosition, 1.0); }