@@ -4523,15 +4523,7 @@ THREE.WebGLRenderer = function ( parameters ) {
4523
4523
4524
4524
uniforms . opacity . value = material . opacity ;
4525
4525
4526
- if ( _this . gammaInput ) {
4527
-
4528
- uniforms . diffuse . value . copyGammaToLinear ( material . color , _this . gammaFactor ) ;
4529
-
4530
- } else {
4531
-
4532
- uniforms . diffuse . value = material . color ;
4533
-
4534
- }
4526
+ uniforms . diffuse . value = material . color ;
4535
4527
4536
4528
uniforms . map . value = material . map ;
4537
4529
uniforms . lightMap . value = material . lightMap ;
@@ -4595,17 +4587,7 @@ THREE.WebGLRenderer = function ( parameters ) {
4595
4587
uniforms . envMap . value = material . envMap ;
4596
4588
uniforms . flipEnvMap . value = ( material . envMap instanceof THREE . WebGLRenderTargetCube ) ? 1 : - 1 ;
4597
4589
4598
- if ( _this . gammaInput ) {
4599
-
4600
- //uniforms.reflectivity.value = material.reflectivity * material.reflectivity;
4601
- uniforms . reflectivity . value = material . reflectivity ;
4602
-
4603
- } else {
4604
-
4605
- uniforms . reflectivity . value = material . reflectivity ;
4606
-
4607
- }
4608
-
4590
+ uniforms . reflectivity . value = material . reflectivity ;
4609
4591
uniforms . refractionRatio . value = material . refractionRatio ;
4610
4592
4611
4593
}
@@ -4657,20 +4639,9 @@ THREE.WebGLRenderer = function ( parameters ) {
4657
4639
4658
4640
uniforms . shininess . value = material . shininess ;
4659
4641
4660
- if ( _this . gammaInput ) {
4661
-
4662
- uniforms . ambient . value . copyGammaToLinear ( material . ambient , _this . gammaFactor ) ;
4663
- uniforms . emissive . value . copyGammaToLinear ( material . emissive , _this . gammaFactor ) ;
4664
- uniforms . specular . value . copyGammaToLinear ( material . specular , _this . gammaFactor ) ;
4665
-
4666
-
4667
- } else {
4668
-
4669
- uniforms . ambient . value = material . ambient ;
4670
- uniforms . emissive . value = material . emissive ;
4671
- uniforms . specular . value = material . specular ;
4672
-
4673
- }
4642
+ uniforms . ambient . value = material . ambient ;
4643
+ uniforms . emissive . value = material . emissive ;
4644
+ uniforms . specular . value = material . specular ;
4674
4645
4675
4646
if ( material . wrapAround ) {
4676
4647
@@ -4682,17 +4653,8 @@ THREE.WebGLRenderer = function ( parameters ) {
4682
4653
4683
4654
function refreshUniformsLambert ( uniforms , material ) {
4684
4655
4685
- if ( _this . gammaInput ) {
4686
-
4687
- uniforms . ambient . value . copyGammaToLinear ( material . ambient , _this . gammaFactor ) ;
4688
- uniforms . emissive . value . copyGammaToLinear ( material . emissive , _this . gammaFactor ) ;
4689
-
4690
- } else {
4691
-
4692
- uniforms . ambient . value = material . ambient ;
4693
- uniforms . emissive . value = material . emissive ;
4694
-
4695
- }
4656
+ uniforms . ambient . value = material . ambient ;
4657
+ uniforms . emissive . value = material . emissive ;
4696
4658
4697
4659
if ( material . wrapAround ) {
4698
4660
@@ -5157,16 +5119,6 @@ THREE.WebGLRenderer = function ( parameters ) {
5157
5119
5158
5120
}
5159
5121
5160
- //
5161
-
5162
- function setColorGamma ( array , offset , color , intensity , gammaFactor ) {
5163
-
5164
- array [ offset ] = Math . pow ( color . r * intensity , gammaFactor ) ;
5165
- array [ offset + 1 ] = Math . pow ( color . g * intensity , gammaFactor ) ;
5166
- array [ offset + 2 ] = Math . pow ( color . b * intensity , gammaFactor ) ;
5167
-
5168
- }
5169
-
5170
5122
function setColorLinear ( array , offset , color , intensity ) {
5171
5123
5172
5124
array [ offset ] = color . r * intensity ;
@@ -5233,19 +5185,9 @@ THREE.WebGLRenderer = function ( parameters ) {
5233
5185
5234
5186
if ( ! light . visible ) continue ;
5235
5187
5236
- if ( _this . gammaInput ) {
5237
-
5238
- r += Math . pow ( color . r , _this . gammaFactor ) ;
5239
- g += Math . pow ( color . g , _this . gammaFactor ) ;
5240
- b += Math . pow ( color . b , _this . gammaFactor ) ;
5241
-
5242
- } else {
5243
-
5244
- r += color . r ;
5245
- g += color . g ;
5246
- b += color . b ;
5247
-
5248
- }
5188
+ r += color . r ;
5189
+ g += color . g ;
5190
+ b += color . b ;
5249
5191
5250
5192
} else if ( light instanceof THREE . DirectionalLight ) {
5251
5193
@@ -5264,15 +5206,7 @@ THREE.WebGLRenderer = function ( parameters ) {
5264
5206
dirPositions [ dirOffset + 1 ] = _direction . y ;
5265
5207
dirPositions [ dirOffset + 2 ] = _direction . z ;
5266
5208
5267
- if ( _this . gammaInput ) {
5268
-
5269
- setColorGamma ( dirColors , dirOffset , color , intensity , _this . gammaFactor ) ;
5270
-
5271
- } else {
5272
-
5273
- setColorLinear ( dirColors , dirOffset , color , intensity ) ;
5274
-
5275
- }
5209
+ setColorLinear ( dirColors , dirOffset , color , intensity ) ;
5276
5210
5277
5211
dirLength += 1 ;
5278
5212
@@ -5284,15 +5218,7 @@ THREE.WebGLRenderer = function ( parameters ) {
5284
5218
5285
5219
pointOffset = pointLength * 3 ;
5286
5220
5287
- if ( _this . gammaInput ) {
5288
-
5289
- setColorGamma ( pointColors , pointOffset , color , intensity , _this . gammaFactor ) ;
5290
-
5291
- } else {
5292
-
5293
- setColorLinear ( pointColors , pointOffset , color , intensity ) ;
5294
-
5295
- }
5221
+ setColorLinear ( pointColors , pointOffset , color , intensity ) ;
5296
5222
5297
5223
_vector3 . setFromMatrixPosition ( light . matrixWorld ) ;
5298
5224
@@ -5312,15 +5238,7 @@ THREE.WebGLRenderer = function ( parameters ) {
5312
5238
5313
5239
spotOffset = spotLength * 3 ;
5314
5240
5315
- if ( _this . gammaInput ) {
5316
-
5317
- setColorGamma ( spotColors , spotOffset , color , intensity , _this . gammaFactor ) ;
5318
-
5319
- } else {
5320
-
5321
- setColorLinear ( spotColors , spotOffset , color , intensity ) ;
5322
-
5323
- }
5241
+ setColorLinear ( spotColors , spotOffset , color , intensity ) ;
5324
5242
5325
5243
_direction . setFromMatrixPosition ( light . matrixWorld ) ;
5326
5244
@@ -5361,17 +5279,8 @@ THREE.WebGLRenderer = function ( parameters ) {
5361
5279
skyColor = light . color ;
5362
5280
groundColor = light . groundColor ;
5363
5281
5364
- if ( _this . gammaInput ) {
5365
-
5366
- setColorGamma ( hemiSkyColors , hemiOffset , skyColor , intensity , _this . gammaFactor ) ;
5367
- setColorGamma ( hemiGroundColors , hemiOffset , groundColor , intensity , _this . gammaFactor ) ;
5368
-
5369
- } else {
5370
-
5371
- setColorLinear ( hemiSkyColors , hemiOffset , skyColor , intensity ) ;
5372
- setColorLinear ( hemiGroundColors , hemiOffset , groundColor , intensity ) ;
5373
-
5374
- }
5282
+ setColorLinear ( hemiSkyColors , hemiOffset , skyColor , intensity ) ;
5283
+ setColorLinear ( hemiGroundColors , hemiOffset , groundColor , intensity ) ;
5375
5284
5376
5285
hemiLength += 1 ;
5377
5286
0 commit comments