When I add a Line2 object to the scene/loaded GLTF file, I’m getting this weird plane showing up on the corner of my model. When I remove the Line2 object the weird plane goes away.
Here is the new working code for the next person who runs into this problem:
// creates the floorplan outlines for the currently selected room
function CreateLines(verts){
line = new THREE.Group();
for(var i = 0; i < verts.length; i++){
let nextIndex = i + 1 > verts.length - 1 ? 0 : i + 1;
let distance = getDistance(verts[i], verts[nextIndex]);
//get the midpoint between the current and next vertex
let midX = (verts[i].x + verts[nextIndex].x) / 2.0;
let midY = (verts[i].y + verts[nextIndex].y) / 2.0;
let midZ = (verts[i].z + verts[nextIndex].z) / 2.0;
//create box, size it, and apply material
const boxSize = 0.2;
const geometry = new THREE.BoxGeometry( boxSize, boxSize / 2, distance );
const cube = new THREE.Mesh( geometry, lineMaterial );
//position box between points
cube.position.x = midX;
cube.position.y = midY;
cube.position.z = midZ;
//look at the next point
cube.lookAt(verts[nextIndex].x, verts[nextIndex].y, verts[nextIndex].z);
//add the box to the line group
line.add( cube );
}
//add the line group to the scene
houseGLTF.add( line );
}
i’ve seen this often enough to think this is the postpro pass being unable to handle the line shader and instead it renders, i don’t know, the screen quad? i get the same thing with ssr and it’s annoying to say the least.