Skip to content
Advertisement

Can lights be reused in three js?

Is it mandatory to specify three JS lights every time a 3d model is loaded?

When rendering is done on software’s like Maya, there is a light and camera config that is done. Is there a way to export that as a part of OBJ file? If we can reuse the same light config, then the code can be generic for every 3d model or is there a default light config that will work for 90% of the 3d models?

Advertisement

Answer

Is there a way to export that as a part of OBJ file?

No since OBJ does not supports lights and cameras. However, other formats like glTF do.

If we can reuse the same light config, then the code can be generic for every 3d model or is there a default light config that will work for 90% of the 3d models?

It depends on the materials in your scene what lighting setup makes sense. E.g. in a scene with PBR materials, you definitely want to use a HDR environment map for image based lighting. A more simple scene with a lambert material does not require such a setup (so an ambient in combination with a point or directional light is sufficient).

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement