File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -161,24 +161,32 @@ export class SDRMaterial extends ShaderMaterial {
161161
162162 get toneMapping ( ) { return this . _toneMapping }
163163 set toneMapping ( value : ToneMapping ) {
164+ let valid = false
164165 switch ( value ) {
165166 case ACESFilmicToneMapping :
166167 this . defines . TONEMAPPING_FUNCTION = 'ACESFilmicToneMapping'
168+ valid = true
167169 break
168170 case ReinhardToneMapping :
169171 this . defines . TONEMAPPING_FUNCTION = 'ReinhardToneMapping'
172+ valid = true
170173 break
171174 case CineonToneMapping :
172175 this . defines . TONEMAPPING_FUNCTION = 'CineonToneMapping'
176+ valid = true
173177 break
174178 case LinearToneMapping :
175179 this . defines . TONEMAPPING_FUNCTION = 'LinearToneMapping'
180+ valid = true
176181 break
177182 default :
178- console . error ( 'Unsupported toneMapping' )
179- return
183+ console . error ( `Unsupported toneMapping: ${ value } . Using LinearToneMapping.` )
184+ this . defines . TONEMAPPING_FUNCTION = 'LinearToneMapping'
185+ this . _toneMapping = LinearToneMapping
186+ }
187+ if ( valid ) {
188+ this . _toneMapping = value
180189 }
181- this . _toneMapping = value
182190 this . needsUpdate = true
183191 }
184192
You can’t perform that action at this time.
0 commit comments