Bump texture not working with object

textures
materials
loaders

#1

Hello Sir,
I am applying two texture on obj file but working only one can u help me how i do bump texture with obj file.

Code :

texture = THREE.ImageUtils.loadTexture(image_path + 'YSW16_NORMAL.png');
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
texture.offset.set(0, 0);
texture.repeat.set(4, 4);
normalMap = THREE.ImageUtils.loadTexture(image_path + 'YSW16_48.15X50.98DIFFUSE.png' );
texture.needsUpdate = true;
pongMaterial = new THREE.MeshPhongMaterial({
   color: 0xffffff, 
   specular: 0x222222,
   shininess: 100,
   map: texture,
   normalMap: normalMap,
   alphaTest: 0.5,
   visible: true
});

#2

a bump map and a normal map are completely different images and techniques.

a bump map ( material.bumpMap ) is a grey texture representing a height map: white: hight, black: low.

a normal map ( material.normalMap ) is a RGB texture (purple-ish images), where R, G and B channels map X, Y and Z values of a normal vector.

if you use a bump map (black and white images) as normal map, or if you use a normal map (purple-ish ones) as bump map, they will produce weird results or nothing.

Another important thing is that you must have some lights in your scene to let bump and normal maps do their job.

Please be more accurate and produce a jsfiddle to let us help you, because from your code it’s impossible to know where the problem is


#3

Hello,
normalMap: normalMap,
texture not working i did it is correct way or not.


#4

Your code looks correct although THREE.ImageUtils is deprecated. You should use a single instance of TextureLoader instead. It should also not be necessary to call texture.needsUpdate = true;.

Without providing more input (e.g. a live example) it will be hard to help you further.


#5

anyway, just interpreting the texture names it looks that you may have inverted them.
Y…_NORMAL.PNG may be the normal map, and YS—DIFFUSE.PNG may be the diffuse map,
so try inverting image paths.