I'm having trouble getting bump and specular mapping working on an imported model in three.js.
I'm exporting a model from 3DS Max to a .obj file, then using the convert_obj_three.py script to convert it to .js. Inside the model.js file I can see that bump and specular maps are coming across:
"materials": [ {
"DbgColor" : 15658734,
"DbgIndex" : 0,
"DbgName" : "flloor_bump_test",
"illumination" : 2,
"mapAmbient" : "sat_8.jpg",
"mapBump" : "sat_8_bump.jpg",
"mapDiffuse" : "sat_8.jpg",
"mapSpecular" : "sat_8_spec.png",
"opticalDensity" : 1.5,
"specularCoef" : 25.0,
"transparency" : 0.0
},
Here's how I load the model into my scene:
var jsonLoader = new THREE.JSONLoader();
jsonLoader.load( "model.js", addModelToScene );
function addModelToScene( geometry, materials )
{
var material = new THREE.MeshFaceMaterial( materials );
model = new THREE.Mesh( geometry, material );
model.scale.set(0.01,0.01,0.01);
model.castShadow = true;
model.receiveShadow = true;
scene.add( model );
}
Any ideas greatly appreciated! Thanks!!
EDIT
Here is a link to my live demo - http://benbeckford.com/temp/
EDIT 2
So after playing with it I can see that the following data was missing from the converted .js model:
"shading" : "phong",
"mapSpecular" : "powerday_sat_8_specular.png",
"shininess" : 1000,
"mapBumpScale" : 5,
So obviously there is a problem in my export from Max to .obj, or the conversion of .obj to .js. If anyone has solved this problem I would really appreciate how you did it! Thanks :)