Possible to repeat textures independently?

This is my first post, so let me just first say that I am completely giddy that there is finally a three forum! Thank you so much mrdoob & Co!

Okay, so on my UV’d meshes, I have dynamic materials (MeshPhongMaterial) using canvases for the color maps and those are 1:1, but I want to be able to hit the bumpMap and/or specularMap independently with a tiled (repeating) seamless texture. Changing the repeat appears to yield no difference whatsoever between: xxx.repeat.set( 1, 1 ); and xxx.repeat.set( 4, 4 ); etc. Can different maps in the same material be scaled/tiled independently? Please advise.

Hello FrankSilvaHM,

Yes, you can have different “repeating” settings for your Phong material texture instance, i.e.:

var mapUV = new THREE.TextureLoader().load( UVmapimagefilename );
mapUV.anisotropy = 3;
mapUV.repeat.set( 0.5, 0.5 );

var mapHeight = new THREE.TextureLoader().load( heightmapimagefilename );
mapHeight.anisotropy = 4;
mapHeight.repeat.set( 0.998, 0.998 );
mapHeight.offset.set( 0.001, 0.001 );

var material = new THREE.MeshPhongMaterial( {
			map: mapUV,
			bumpMap: mapHeight
} );
1 Like

I liked this but then realised that it doesn’t really work. Three does not support different offsets on the same material (without hacking the shaders). Yet it supports flipping each texture, for example flipY