three-gpu-pathtracer
three-gpu-pathtracer copied to clipboard
Replace support for gradient backgrounds with env map texture
Related to #48
If gradients are going to be supported / used for backgrounds / environments it would simplify things to just support them via a texture rather than interpolated uniforms in the shader. A GradientEnvMapTexture
could be written that lets you set colors and update the texture contents as needed. Long term different falloff functions or gradients could be used to generate the map.
const envMap = new GradientEnvMapTexture();
envMap.resolution = 10;
envMap.topColor.set( 0xff0000 );
envMap.botColor.set( 0x000000 );
envMap.update();