Currently, I am working on importing a glTF model that includes a UV set. My goal is to dynamically assign a texture to it in ThreeJS by injecting shader code into the existing using onBeforeCompile()
.
So far, everything functions properly. However, when I remove the test texture from the model in Blender and re-export it, the shader encounters a vUv undeclared identifier
error. The debugging console shows that the UV maps are defined in the geometry buffer attributes, but they are not being defined in the shader for some unknown reason.
I prefer not to export the model with a texture because this would require loading the texture twice (once during model loading and once dynamically).
If anyone has any suggestions or workaround solutions, I would greatly appreciate it!