0

I am loading a BM3 file which contains definitions of (geometry and) material information as below:

{
  type: "Phong",
  opacity: 1,
  name: "",
  diffuseMap: 0,
  color: [
    0.254902,
    0.2,
    0.129412,
  ],
  transparent: false,
  specularMap: 1,
  specular: [
    0.811765,
    0.811765,
    0.811765,
  ],
  shininessInSpecMap: true,
  shininess: 174,
  refractionRatioMap: 2,
  refractionRatio: 3.35294,
  normalMap: 3,
  LUTPublications: [
    "pot",
  ],
  lightMap: 4,
}

I then am using ThreeJS to create a Mesh object and MeshPhongMaterial. Below are maps in this order: diffuseMap, normalMap, specularMap, refrationRatioMap, lightMap. The MeshPhongMaterial is created using above maps except the lightMap.

diffuseMap normalMap specularMap refrationRatioMap lightMap

If I load this mesh I get below dark image:

image 1 (original settings)

If I change the color property to (1,1,1) instead. I get just a brighter orange color, but the pot is still dark.

enter image description here

However if I load this object in another application it looks like this: The pot looks bright. It looks to me as if the metal/steel side of the material is not handled correctly, as this is the case with any other model I tried which has a part that looks like steel. Any idea why the material is rendered dark (while it should be rendered differently/brighter)?

enter image description here

ali
  • 529
  • 4
  • 26

1 Answers1

0

Your normal map is likely reversed, which is causing light to reflect away from the camera. In the software where you're generating the normal map, look for a setting like Y+, Y-up, bottom-up, or OpenGL.

Phil N.
  • 650
  • 4
  • 11
  • That might be. But why is the orange bit is not dark then? If the normal map is wrong, it should affect all parts, isn't it? – ali Jan 25 '22 at 22:00
  • I think it is affecting all parts, actually. If you look really closely at your "correct" image, you'll see very slight specular highlights running the length of the orange handles, which are absent from your "incorrect but brighter" image. If the normals are wrong, those spec highlights are going to bounce away from the camera in each case. To test if it is the spec/shininess, have you tried manually setting `.specularMap = null` and `.specular = new Color.fromHex(0xffffff)` after the model is loaded? – Phil N. Jan 25 '22 at 22:30
  • I did actually and still getting same dark image. But I will try I again to be certain about it. Very weird. Also if the normal is wrong even the diffuse component should be zero due to the Lambert law max(0,coś incident angle), isn't it? – ali Jan 25 '22 at 23:07
  • Or if it was the normal map, would setting it to null not fixing it? – ali Jan 25 '22 at 23:13