I am quite new to three.js and to programming language in general, but I recently started to experiment with Google’s model viewer and AR.js, they are quite similar in the way they work, and I am trying to do something in three that I managed to do in both of them.
Basically I have created a scene with a .glb model (so same kind of deal as .gltf), the material applied on the model on export is a reflective metal. I can see that the material is working correctly because a light added into the scene can be seen reflected onto the surface, and using the online gltf viewer gives correct results.
The issue is that in my scene the material is mostly black because it does not have an environment to reflect. I am trying to add an HDRI, but after some digging I still did not understood how to do it.
I copied the HDRCubeTextureLoader.js into my project folder, prepared the 6 images (ny.hdr,nx.hdr,nz.hdr,…etc) and tried to make it work by using existing examples, but for the life of me I cannot make it work.
At this point I am open to suggestions, because maybe is a simple thing, which is not clear to me due to my lack of coding knowledge.
I have tried to use this example as reference but no luck: three.js examples
on a smaller note I would like to not have the hdri visible in the background, only use it for the reflections as I have done in this model-viewer example : https://gabriele-lorusso.github.io/AV_AR_modelviewer/
Thank you in advance for any suggestion.