2

I repeat this example in my code:

https://threejs.org/examples/?q=RGBELoader#webgl_loader_gltf

Source: https://github.com/mrdoob/three.js/blob/master/examples/webgl_loader_gltf.html#L53

HDRI lighting works great. But i cant hide hdr map from background. Is there way to do this? To leave this hdri lightning and set a custom color for background.

Bruno Leveque
  • 2,647
  • 2
  • 23
  • 33

1 Answers1

5

Using the example you provided, and assuming you want to keep the reflections of the photo on the helmet but remove the photo from the background, all you have to do is remove (or comment out) the following line:

scene.background = cubeGenerator.renderTarget;

This will remove the photo from the background which will then display as the default color (black), as you can see from this screenshot:

enter image description here

Julien
  • 2,217
  • 2
  • 28
  • 49