ray-tracing-renderer icon indicating copy to clipboard operation
ray-tracing-renderer copied to clipboard

Add support for THREE.HemisphereLight

Open jaxry opened this issue 6 years ago • 2 comments
trafficstars

The renderer currently supports lighting in the form of our new HDRI EnvironmentLight, as well as Three's DirectionalLight. We'd like to continue extending this cross-compatibility with Three.js.

The most useful and straightforward to add would be Three's AmbientLight and HemisphereLight in the same way that we've implemented the DirectionalLight.

Inside envMapCreation.js we bake the various lights into an equirectangular texture that encompasses the entire scene. New code would specifically fit inside generateEnvMapFromSceneComponents

  • [FINISHED] Adding an AmbientLight would simply involve iterating over the entire texture and adding a constant color and intensity according to the AmbientLight.
  • HemisphereLight would be much the same, but you'd gradient the color across the y-axis as you iterate through the texture.

If you would like to take on this feature, let me know! I can help with any questions you may have.

jaxry avatar Oct 02 '19 19:10 jaxry

Hi, is this issue available?

danielharvilik avatar Oct 04 '19 10:10 danielharvilik

Yes it is! Would you like to take a stab at it?

The relevant files include envMapCreation.js and the decomposeScene function. @lyonsno is currently refactoring parts of the file (https://github.com/hoverinc/ray-tracing-renderer/pull/17/), but most of the changes relate to directional lights, so merge conflicts should only be slight, if any.

jaxry avatar Oct 04 '19 18:10 jaxry