How to add Environment map

Hi i need to add an environment map to my model, ( i am a programmer with limited knowledge of 3D art )

Working demo of the Model is found here:

Environment map is here: /webgl-env-map/assets/env.jpg

Code for the model is here:

If it is not possible to add this jpg map, then i need a map that makes this lamp looks like chrome, thank you i appreciate any help

Ok i used FBX loader and it loads normally,

so mtl and obj loaders will not load normal map

json loader will not load environment map,

but fbx loads everything, and works fine

1 Like

For future readers, it’s also fairly easy to add the environment map after loading the model, e.g. if you want the same model to have a different environment map in different contexts.

// Load envMap.
var textureLoader = new THREE.TextureLoader();
var texture = textureLoader.load('/path/to/env.jpg');

// Load model.
modelLoader.load('/path/to/', (object) => {
  // Apply envMap to model.
  object.traverse((node) => {
    if (node.isMesh) node.material.envMap = texture;

I have to set texture.mapping = THREE.EquirectangularReflectionMapping; to make it working.


Saved my day :slight_smile: