@@ -181,7 +181,23 @@ function SidebarScene( editor ) {
181
181
backgroundEquirectangularTexture . setDisplay ( 'none' ) ;
182
182
backgroundRow . add ( backgroundEquirectangularTexture ) ;
183
183
184
+ const backgroundColorSpaceRow = new UIRow ( ) ;
185
+ backgroundColorSpaceRow . setDisplay ( 'none' ) ;
186
+ backgroundColorSpaceRow . setMarginLeft ( '120px' ) ;
187
+
188
+ const backgroundColorSpace = new UISelect ( ) . setOptions ( {
189
+
190
+ [ THREE . NoColorSpace ] : 'No Color Space' ,
191
+ [ THREE . LinearSRGBColorSpace ] : 'srgb-linear' ,
192
+ [ THREE . SRGBColorSpace ] : 'srgb' ,
193
+
194
+ } ) . setWidth ( '150px' ) ;
195
+ backgroundColorSpace . setValue ( THREE . NoColorSpace ) ;
196
+ backgroundColorSpace . onChange ( onBackgroundChanged ) ;
197
+ backgroundColorSpaceRow . add ( backgroundColorSpace ) ;
198
+
184
199
container . add ( backgroundRow ) ;
200
+ container . add ( backgroundColorSpaceRow ) ;
185
201
186
202
const backgroundEquirectRow = new UIRow ( ) ;
187
203
backgroundEquirectRow . setDisplay ( 'none' ) ;
@@ -205,6 +221,7 @@ function SidebarScene( editor ) {
205
221
backgroundColor . getHexValue ( ) ,
206
222
backgroundTexture . getValue ( ) ,
207
223
backgroundEquirectangularTexture . getValue ( ) ,
224
+ backgroundColorSpace . getValue ( ) ,
208
225
backgroundBlurriness . getValue ( ) ,
209
226
backgroundIntensity . getValue ( ) ,
210
227
backgroundRotation . getValue ( )
@@ -222,6 +239,16 @@ function SidebarScene( editor ) {
222
239
backgroundEquirectangularTexture . setDisplay ( type === 'Equirectangular' ? '' : 'none' ) ;
223
240
backgroundEquirectRow . setDisplay ( type === 'Equirectangular' ? '' : 'none' ) ;
224
241
242
+ if ( type === 'Texture' || type === 'Equirectangular' ) {
243
+
244
+ backgroundColorSpaceRow . setDisplay ( '' ) ;
245
+
246
+ } else {
247
+
248
+ backgroundColorSpaceRow . setDisplay ( 'none' ) ;
249
+
250
+ }
251
+
225
252
}
226
253
227
254
// environment
@@ -412,13 +439,16 @@ function SidebarScene( editor ) {
412
439
413
440
}
414
441
442
+ backgroundColorSpace . setValue ( scene . background . colorSpace ) ;
443
+
415
444
}
416
445
417
446
} else {
418
447
419
448
backgroundType . setValue ( 'None' ) ;
420
449
backgroundTexture . setValue ( null ) ;
421
450
backgroundEquirectangularTexture . setValue ( null ) ;
451
+ backgroundColorSpace . setValue ( THREE . NoColorSpace ) ;
422
452
423
453
}
424
454
0 commit comments