Hello guys , please i have a problem that a dont found the solution . I want to put a physicalmaterial into a geometrie that i loaded with the objLoader and mtlLoader , i need to add a roughness and metalness value to the geometrie . this is the Js code and mtl code : ( I think i need to keep the mtlLoader for good Uv )
var pmaterial = new THREE.MeshPhysicalMaterial({
color: 0x0000ff,
metalness: 0.2,
roughness: 0.4,
roughnessMap: new THREE.TextureLoader().load('obj/rough.jpg'),
});
//****mtlloader
var mtlLoader1 = new THREE.MTLLoader();
mtlLoader1.setTexturePath('obj/');
mtlLoader1.setPath('obj/');
mtlLoader1.load('geo.mtl', function(materials) {
materials.preload();
var objLoader1 = new THREE.OBJLoader();
objLoader1.setMaterials(materials);
objLoader1.setPath('obj/');
objLoader1.load('geo.obj', function(object1) {
pscene.add(object1);
});
and the .mtl code :
newmtl Mat
Ka 1 1 1
Kd 0.80000001192093 0.80000001192093 0.80000001192093
map_Kd diffuse.jpg
Ks 1 1 1
Ns 50
illum 7
Thanks !