fix(retro): CRT vertex shader failed to compile, rendering the 3D canvas black

vec4(position, 0.0, 1.0) passes a vec3 plus two floats into a vec4 - five
components into four. Invalid GLSL ES on both WebGL 1 and 2:

  THREE.WebGLProgram: Shader Error 0 - VALIDATE_STATUS false
  ERROR: 0:71: 'constructor' : too many arguments

The whole post-processing pass failed and the game canvas read back as one
colour, 0/64000 non-black pixels. position.xy is the vec2 the fullscreen quad
needs.

Verified headlessly with SwiftShader: 55-143 distinct colours, 63750/64000
lit pixels, no shader errors, scene hash changes after throttle + pitch.
This commit is contained in:
Hermes Cron Job committed 2026-10-07 13:31:23 +00:00
1 parent ab96608cdd
commit 04e3400ab9
1 file changed
+1 -1
+1 -1
View File
@@ -26,7 +26,7 @@ export class RetroEffect {
varying vec2 vUv;
void main() {
vUv = uv;
gl_Position = vec4(position, 0.0, 1.0);
gl_Position = vec4(position.xy, 0.0, 1.0);
}
`,
fragmentShader: `