No matter what I set it to for this animated-gltf file, it resets to (0.1,0.1)
I added needsUpdate, set matrixAutoUpdate to false, and a few other things, but nothing seems to work. Any ideas? Thanks!
mesh.material.normalMap.offset.set(ofsx,ofsy);
mesh.material.normalMap.needsUpdate = true;
Texture UV transforms are shared among textures that use the same UVs. So in this case if you have a .map
on the material, then material.map.offset
is probably taking precedence here.
Details:
opened 03:21PM - 03 Aug 16 UTC
Enhancement
[plunker](https://plnkr.co/edit/UT9rs0Q6TO0gBxwdxLVK?p=preview)
When setting th… e `map` to repeat the `alphaMap` is also affected.
I'm expecting each face of the cube to have a giant whole in the middle with the edges of the taco time texture showing near the edges of the cube in a 3x4 pattern.
I'm getting the 3x4 pattern of the taco time texture but the `alphaMap`, although it does not repeat it does scale down to the size of the other map. It also produces some nasty streaks.
If you comment out line 35 `material.map.repeat.set(3,4);` you can see what I'm expecting from the `alphaMap`.
##### Three.js version
- [x] Dev
- [x] r79
- [x] ...
##### Browser
- [x] All of them
- [ ] Chrome
- [ ] Firefox
- [ ] Internet Explorer
##### OS
- [x] All of them
- [ ] Windows
- [ ] Linux
- [ ] Android
- [ ] IOS
##### Hardware Requirements (graphics card, VR Device, ...)
Thanks for the response, looks like both material.map.offset and material.normalMap.offset are stuck at 0.01 regardless what I set them to:
ofsy += 0.01;
m.mesh.children[2].children[4].material.normalMap.offset.set(ofsy,ofsy);
m.mesh.children[2].children[4].material.map.offset.set(ofsy,ofsy);
if(ofsy>1){ofsy=0;}
console.log(m.mesh.children[2].children[4].material.map.offset.y); //always 0.1
console.log(m.mesh.children[2].children[4].material.normalMap.offset.y); //always 0.1
It might be that a material.needsUpdate = true
is also needed, at least the first time? If that’s not working, and all the textures using that UV set have the same transform but it’s still ignored, a JSFiddle or other demo might help.