Skip to content

Commit

Permalink
Editor: Added background color support to pathtracer.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jan 30, 2024
1 parent 1e771e1 commit e06a8b3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions editor/js/Viewport.Pathtracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,26 @@ function ViewportPathtracer( renderer ) {
ptMaterial.materials.updateFrom( materials, textures );
ptMaterial.lights.updateFrom( lights );

//

const background = scene.background;

if ( background ) {

if ( background.isColor ) {

ptMaterial.backgroundMap = buildColorTexture( background );

}

} else {

ptMaterial.backgroundMap = buildColorTexture( new THREE.Color( 0x000000 ) );

}

//

const environment = scene.environment;

if ( environment && environment.isTexture === true ) {
Expand Down

0 comments on commit e06a8b3

Please sign in to comment.