fix(render): Phase A8 — remove over-engineered shader guards (Task 4)
Removes the pos.w clamp in portal_stencil.vert and the FragColor
declaration in portal_stencil.frag added in 2d31d49. Both were
speculative defensive code not in the spec or the WB reference. The
shaders now match the spec verbatim (except the locally-conventional
`core` profile qualifier which is correct).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2d31d490d1
commit
344034bcd3
2 changed files with 1 additions and 19 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue