Skip to content

Commit e06a8b3

Browse files
committed
Editor: Added background color support to pathtracer.
1 parent 1e771e1 commit e06a8b3

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

editor/js/Viewport.Pathtracer.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,26 @@ function ViewportPathtracer( renderer ) {
6060
ptMaterial.materials.updateFrom( materials, textures );
6161
ptMaterial.lights.updateFrom( lights );
6262

63+
//
64+
65+
const background = scene.background;
66+
67+
if ( background ) {
68+
69+
if ( background.isColor ) {
70+
71+
ptMaterial.backgroundMap = buildColorTexture( background );
72+
73+
}
74+
75+
} else {
76+
77+
ptMaterial.backgroundMap = buildColorTexture( new THREE.Color( 0x000000 ) );
78+
79+
}
80+
81+
//
82+
6383
const environment = scene.environment;
6484

6585
if ( environment && environment.isTexture === true ) {

0 commit comments

Comments
 (0)