-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ambiguity with texture transformation and texture cloning #12788
Comments
t1.wrapS = THREE.RepeatWrapping
t1.wrapT = THREE.RepeatWrapping
t1.repeat.set(10,10)
mesh.material.map = t1
const t2 = t1.clone()
t2.repeat.set(5,5)
t2.rotation = Math.PI / 2
t2.needsUpdate = true;
mesh.material.specularMap = t2
mesh.material.needsUpdate = true with material.map, only that transformation is honored with material.map === null, the transformation from specularMap is used I'd maybe edit thus note from the docs for more clarity:
|
On the second question:
Yields:
However, this code:
Also yields:
Which is interesting. I see the All i did here is define how this data ( Also might be worth visiting why is this transformation on a texture at all? The material seems like it will always honor only one texture's transformation. The transformation is thus one to one with the material. The material also does most of the draw call management, where this uniform ends up being used. This would make more sense:
Expect:
With the transform achieved.
or
or maybe even
|
Thanks to @usefulthink for pointing this out: While i'm not a huge fan of this, perhaps all that's needed is to document it.
|
Same issue i think: Textures are probably not the best place to have the transform Can easily be solved / prototyped with |
An example for an interface that treats textures independently: |
Closing since this issue is essentially a duplicate of existing ones.
|
Took just a bit too long but #25721 finishes all the work solving this. |
One of the more recent threads on stack overflow suggests modifying geometry to index into a texture atlas. . I believe i've seen the same answer before though.
I also remember three.js had an issue when cloning the texture, they would get duplicated on the gpu.
This conversation happened a while ago:
#5876
This PR more recent:
#11863
Docs say:
if i add:
What should the expectation be here? Mine is that some UV attribute (call it
channel0
for example) would get scaled by the.repeat
value of the texture, and display all the textures with their appropriate values?And will this still upload only one image to the gpu?
I guess I can test both.
Three.js version
The text was updated successfully, but these errors were encountered: