Hi.
How can I check that my raycast crosses exactly into a visible part of the mesh and not into the full geometry? Maybe I should somehow rely on a face id from picked result? Raycast doesn’t take into account that I multiply the unnecessary vertices by 0
const custom = new BABYLON.CustomMaterial("material");
custom.Vertex_Definitions('in vec2 range;')
custom.Vertex_Before_PositionUpdated(`
float id = float(gl_VertexID);
if (id < range[0] || id > range[1]) {
positionUpdated *= 0.0;
}
`);
custom.AddAttribute("range");
const ray = scene.createPickingRay(scene.pointerX, scene.pointerY, Matrix.Identity(), scene.activeCamera);
const p = scene.pickWithRay(ray).pickedPoint;