I’m trying to get world space texture coordinate for instanced meshes in three.js using glsl, it works for individual objects but not for instanced meshes.
W_Pos = (modelMatrix * vec4(position,1.0)).xyz;
any help?
I'm so dumb, the answer was in the docs, i had read that before but it completely slipped my mind lel.
W_Pos = instanceMatrix * vec3(position,1.0).xyz;
https://threejs.org/docs/?q=web#api/en/renderers/webgl/WebGLProgram