1

Welcome, I have a little struggle with Three.js lately. I'm trying to put some texture maps on terrain and my texture code looks like this:

var textures = {
    snow: THREE.ImageUtils.loadTexture( 'img/snow.jpg' ),
    snowNorm: THREE.ImageUtils.loadTexture( 'img/snonormal.jpg' ),
}
textures.snow.wrapS = textures.snow.wrapT = THREE.RepeatWrapping;
textures.snowNorm.wrapS = textures.snowNorm.wrapT = THREE.RepeatWrapping;
textures.snow.repeat.set( 100, 100 );
textures.snowNorm.repeat.set( 10, 10 );



 snow: new THREE.MeshPhongMaterial({
        color: 0xaaaaaa,
        specular: 0xffffff,
        shininess: 8,
        map: textures.snow,
        normalMap: textures.snowNorm
    }),

My mesh is 100x100 simple grid and I foolishly expected that i'd have an 100 times repeated texture map with 10x reapeated normal map over it, but all i got is 100x repeated texture map with 100x repeated normal map over it.

Is there any way i can achieve having normalMap and map having different repeat values?

Thanks in advance for help.

gman
  • 100,619
  • 31
  • 269
  • 393
  • Not using a pre-defined material. See http://stackoverflow.com/questions/14371385/can-a-three-js-material-have-separate-repeat-values-for-a-bump-map-and-a-texture/14372235#14372235. You would have to write your own custom `ShaderMaterial`. – WestLangley Sep 29 '15 at 20:17
  • Damn i hoped that there would be an another way – user2872173 Sep 30 '15 at 21:13

0 Answers0