I am trying to migrate the WebXR controller Line to LineSegments2 to be able to have a line wider than 1 pixel. I am running into a shader compilation issue with the migration. It doesnt like the position array. Any ideas
const line = new LineSegments2( );
line.geometry.setPositions([ 0, 0, 0, 0, 0, -0.8 ]);
line.geometry.setColors([ 0.5, 0.5, 0.5, 0, 0, 0 ]);
line.material.linewidth = 4;
line.computeLineDistances();
line.scale.set( 1, 1, 1 );
From this
geometry = new THREE.BufferGeometry();
geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( [ 0, 0, 0, 0, 0, -0.8 ], 3 ) );
geometry.setAttribute( 'color', new THREE.Float32BufferAttribute( [ 0.5, 0.5, 0.5, 0, 0, 0 ], 3 ) );
material = new THREE.LineBasicMaterial( { vertexColors: true, blending: THREE.AdditiveBlending } );
return new THREE.Line( geometry, material );
produces this
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