Skip to content

Shader issue in WebGLBackend with WebXR when using Line2 and LineSegments2 #31084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
danrossi opened this issue May 11, 2025 · 0 comments
Open

Comments

@danrossi
Copy link
Contributor

danrossi commented May 11, 2025

Description

I am trying to migrate the WebXR controller line to WebGPURenderer to also support linewidths and somehow drop off in opacity. There seems to be a shader compile issue when going into WebXR. It may not be liking the position and colors arrays given.

Error given

Error 0 - VALIDATE_STATUS false

Program Info Log: Vertex shader is not compiled.

ERROR: 0:107: 'cameraProjectionMatrix' : undeclared identifier
ERROR: 0:107: 'expression' :  left of '[' is not of type array, matrix, or vector 
ERROR: 0:107: 'expression' :  left of '[' is not of type array, matrix, or vector 
ERROR: 0:133: 'cameraProjectionMatrix' : undeclared identifier
ERROR: 0:134: 'cameraProjectionMatrix' : undeclared identifier

Reproduction steps

1.Setup Line2 or LineSegments2
2. Launch into WebXR with the emulator, Rift, Quest etc
3. Shader compile error in the console will appear

Code

const line = new LineSegments2( );
line.geometry.setPositions([ 10, 10, -10, 0, 0, -0.8 ]);
line.geometry.setColors([ 0.5, 0.5, 0.5, 0, 0, 0 ]);
line.material.linewidth = 4;
line.material.color.setHex(0xffffff);
line.computeLineDistances();
line.scale.set( 1, 1, 1 );

or

 const line = new Line2( );
 line.material.linewidth = 4;
 line.material.color.setHex(0xffffff);
 line.geometry.setPositions([ 10, 10, -10, 0, 0, -0.8 ]);
line.geometry.setColors([ 0.5, 0.5, 0.5, 0, 0, 0 ]);

Live example

Screenshots

No response

Version

r176

Device

Desktop

Browser

Chrome

OS

Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants