Closed
Description
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:
var texture = new THREE.TextureLoader().load( "textures/water.jpg" );
texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 4, 4 );
if i add:
var texFoo = texture.clone()
texFoo.repeat.set(2,2)
var texBar = texture.clone()
texBar.repeat.set(6,6)
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?
var myMaterial = new THREE.MeshPhongMaterial({
map: texture,
specularMap: texFoo,
normalMap: texBar,
})
And will this still upload only one image to the gpu?
var oneGeometry = new BoxGeom()
var squares_5x5_units_in_world_space = loadTexture()
for ( var i = 0 ; i < 1000 ; i ++ ){
var mesh = new THREE.Mesh( oneGeometry , new Material())
var meshScale = Math.random()
mesh.scale.multiplyScalar(meshScale)
mesh.position.set(Math.random(),Math.random(),Math.random())
mesh.material.map = squares_5x5_units_in_world_space.clone() //should still use one image?
mesh.material.map.repeat(meshScale, meshScale)
}
I guess I can test both.
Three.js version
- Dev
- r88