I'm currently working on implementing a particle system using a dedicated Vertex shader. I have provided a code example for reference: https://jsfiddle.net/dthevenin/7arntcog/
My approach involves utilizing a Raycaster for mouse picking to enable interaction with individual particles.
The code functions as intended until I attempt to adjust the position of a vertex directly in the Vertex Shader. In the provided example, I am passing a time value as a Uniform and modifying the x position based on that time's value.
vec4 mvPosition = modelViewMatrix * vec4(position.x + time, position.y, position.z, 1.0);
Subsequently, the Raycaster fails to calculate intersections accurately.
To observe the issue, you can uncomment line 86; after doing so, clicking on a particle will not work correctly.
What might be the issue with this code or solution?