I have a single face Mesh in Three.js that I want to apply a shader to.
When I apply the shader material on the mesh, it appears to be reading a single pixel of the shader and applying that value to the entire face. I'm testing this in the following example: https://threejs.org/examples/?q=shader#webgl_shader2
A single face mesh has been added to each shader example, it's the same problem across all examples.
// how geometry is defined (right after BoxGeometry in example)
let triangleGeometry = new THREE.Geometry();
triangleGeometry.vertices.push(new THREE.Vector3( 0.0, 1.0, 0.0 ));
triangleGeometry.vertices.push(new THREE.Vector3( -1.0, -1.0, 0.0 ));
triangleGeometry.vertices.push(new THREE.Vector3( 1.0, -1.0, 0.0 ));
triangleGeometry.faces.push(new THREE.Face3( 0, 1, 2 ));
// how mesh is defined (right after box mesh in example)
let triangleMesh = new THREE.Mesh( triangleGeometry, material );
triangleMesh.position.x = i - ( params.length - 1 ) / 2;
triangleMesh.position.y = i % 2 - 0.5;
scene.add( triangleMesh );
I've tried this on every example I can find and have the same issue. I wonder what I'm not seeing.