three-gpu-pathtracer icon indicating copy to clipboard operation
three-gpu-pathtracer copied to clipboard

Replace support for gradient backgrounds with env map texture

Open gkjohnson opened this issue 2 years ago • 0 comments

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();

gkjohnson avatar May 13 '22 23:05 gkjohnson