@@ -49,7 +49,6 @@ function ViewportPathtracer( renderer ) {
4949
5050 }
5151
52- pathtracer . material . backgroundBlur = scene . backgroundBlurriness ;
5352 pathtracer . reset ( ) ;
5453
5554 const { bvh, textures, materials, lights } = generator . generate ( scene ) ;
@@ -72,10 +71,7 @@ function ViewportPathtracer( renderer ) {
7271
7372 //
7473
75- setBackground ( scene . background ) ;
76-
77- //
78-
74+ setBackground ( scene . background , scene . backgroundBlurriness ) ;
7975 setEnvironment ( scene . environment ) ;
8076
8177 }
@@ -89,26 +85,30 @@ function ViewportPathtracer( renderer ) {
8985
9086 }
9187
92- function setBackground ( background ) {
88+ function setBackground ( background , blurriness ) {
9389
9490 if ( pathtracer === null ) return ;
9591
9692 const ptMaterial = pathtracer . material ;
93+
9794 if ( background ) {
9895
9996 if ( background . isTexture ) {
10097
10198 ptMaterial . backgroundMap = background ;
99+ ptMaterial . backgroundBlur = blurriness ;
102100
103101 } else if ( background . isColor ) {
104102
105103 ptMaterial . backgroundMap = buildColorTexture ( background ) ;
104+ ptMaterial . backgroundBlur = 0 ;
106105
107106 }
108107
109108 } else {
110109
111110 ptMaterial . backgroundMap = buildColorTexture ( new THREE . Color ( 0 ) ) ;
111+ ptMaterial . backgroundBlur = 0 ;
112112
113113 }
114114
@@ -121,6 +121,7 @@ function ViewportPathtracer( renderer ) {
121121 if ( pathtracer === null ) return ;
122122
123123 const ptMaterial = pathtracer . material ;
124+
124125 if ( environment && environment . isDataTexture === true ) {
125126
126127 // Avoid calling envMapInfo() with the same hdr
0 commit comments