19848
19848
19849
19849
_gl.bindBuffer( _gl.ARRAY_BUFFER, buffers.normal );
19850
19850
19851
- if ( material.type !== 'MeshPhongMaterial' && material.type !== 'MeshStandardMaterial' && material.type !== 'MeshPhysicalMaterial' && material.shading === FlatShading ) {
19851
+ if ( ! material.isMeshPhongMaterial &&
19852
+ ! material.isMeshStandardMaterial &&
19853
+ material.shading === FlatShading ) {
19852
19854
19853
19855
for ( var i = 0, l = object.count * 3; i < l; i += 9 ) {
19854
19856
20658
20660
20659
20661
var geometry = objects.update( object );
20660
20662
20661
- if ( material && material .isMultiMaterial ) {
20663
+ if ( material.isMultiMaterial ) {
20662
20664
20663
20665
var groups = geometry.groups;
20664
20666
var materials = material.materials;
20841
20843
20842
20844
var uniforms = materialProperties.__webglShader.uniforms;
20843
20845
20844
- if ( ! ( material && material .isShaderMaterial ) &&
20845
- ! ( material && material.isRawShaderMaterial ) | |
20846
- material.clipping === true ) {
20846
+ if ( ! material.isShaderMaterial &&
20847
+ ! material.isRawShaderMaterial |
20848
+ material.clipping === true ) {
20847
20849
20848
20850
materialProperties.numClippingPlanes = _clipping.numPlanes;
20849
20851
uniforms.clippingPlanes = _clipping.uniform;
@@ -21022,10 +21024,10 @@
21022
21024
// load material specific uniforms
21023
21025
// (shader material also gets them for the sake of genericity)
21024
21026
21025
- if ( ( material && material .isShaderMaterial ) ||
21026
- ( material && material.isMeshPhongMaterial ) ||
21027
- ( material && material.isMeshStandardMaterial ) ||
21028
- material.envMap ) {
21027
+ if ( material.isShaderMaterial ||
21028
+ material.isMeshPhongMaterial ||
21029
+ material.isMeshStandardMaterial ||
21030
+ material.envMap ) {
21029
21031
21030
21032
var uCamPos = p_uniforms.map.cameraPosition;
21031
21033
@@ -21038,12 +21040,12 @@
21038
21040
21039
21041
}
21040
21042
21041
- if ( ( material && material .isMeshPhongMaterial ) ||
21042
- ( material && material.isMeshLambertMaterial ) ||
21043
- ( material && material.isMeshBasicMaterial ) ||
21044
- ( material && material.isMeshStandardMaterial ) ||
21045
- ( material && material.isShaderMaterial ) ||
21046
- material.skinning ) {
21043
+ if ( material.isMeshPhongMaterial ||
21044
+ material.isMeshLambertMaterial ||
21045
+ material.isMeshBasicMaterial ||
21046
+ material.isMeshStandardMaterial ||
21047
+ material.isShaderMaterial ||
21048
+ material.skinning ) {
21047
21049
21048
21050
p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse );
21049
21051
@@ -21108,48 +21110,48 @@
21108
21110
21109
21111
}
21110
21112
21111
- if ( ( material && material .isMeshBasicMaterial ) ||
21112
- ( material && material.isMeshLambertMaterial ) ||
21113
- ( material && material.isMeshPhongMaterial ) ||
21114
- ( material && material.isMeshStandardMaterial ) ||
21115
- ( material && material.isMeshDepthMaterial ) ) {
21113
+ if ( material.isMeshBasicMaterial ||
21114
+ material.isMeshLambertMaterial ||
21115
+ material.isMeshPhongMaterial ||
21116
+ material.isMeshStandardMaterial ||
21117
+ material.isMeshDepthMaterial ) {
21116
21118
21117
21119
refreshUniformsCommon( m_uniforms, material );
21118
21120
21119
21121
}
21120
21122
21121
21123
// refresh single material specific uniforms
21122
21124
21123
- if ( material && material .isLineBasicMaterial ) {
21125
+ if ( material.isLineBasicMaterial ) {
21124
21126
21125
21127
refreshUniformsLine( m_uniforms, material );
21126
21128
21127
- } else if ( material && material .isLineDashedMaterial ) {
21129
+ } else if ( material.isLineDashedMaterial ) {
21128
21130
21129
21131
refreshUniformsLine( m_uniforms, material );
21130
21132
refreshUniformsDash( m_uniforms, material );
21131
21133
21132
- } else if ( material && material .isPointsMaterial ) {
21134
+ } else if ( material.isPointsMaterial ) {
21133
21135
21134
21136
refreshUniformsPoints( m_uniforms, material );
21135
21137
21136
- } else if ( material && material .isMeshLambertMaterial ) {
21138
+ } else if ( material.isMeshLambertMaterial ) {
21137
21139
21138
21140
refreshUniformsLambert( m_uniforms, material );
21139
21141
21140
- } else if ( material && material .isMeshPhongMaterial ) {
21142
+ } else if ( material.isMeshPhongMaterial ) {
21141
21143
21142
21144
refreshUniformsPhong( m_uniforms, material );
21143
21145
21144
- } else if ( material && material .isMeshPhysicalMaterial ) {
21146
+ } else if ( material.isMeshPhysicalMaterial ) {
21145
21147
21146
21148
refreshUniformsPhysical( m_uniforms, material );
21147
21149
21148
- } else if ( material && material .isMeshStandardMaterial ) {
21150
+ } else if ( material.isMeshStandardMaterial ) {
21149
21151
21150
21152
refreshUniformsStandard( m_uniforms, material );
21151
21153
21152
- } else if ( material && material .isMeshDepthMaterial ) {
21154
+ } else if ( material.isMeshDepthMaterial ) {
21153
21155
21154
21156
if ( material.displacementMap ) {
21155
21157
21159
21161
21160
21162
}
21161
21163
21162
- } else if ( material && material .isMeshNormalMaterial ) {
21164
+ } else if ( material.isMeshNormalMaterial ) {
21163
21165
21164
21166
m_uniforms.opacity.value = material.opacity;
21165
21167
21271
21273
if ( uvScaleMap !== undefined ) {
21272
21274
21273
21275
// backwards compatibility
21274
- if ( ( uvScaleMap && uvScaleMap .isWebGLRenderTarget) ) {
21276
+ if ( uvScaleMap.isWebGLRenderTarget ) {
21275
21277
21276
21278
uvScaleMap = uvScaleMap.texture;
21277
21279
@@ -21336,12 +21338,12 @@
21336
21338
21337
21339
uniforms.fogColor.value = fog.color;
21338
21340
21339
- if ( fog && fog .isFog ) {
21341
+ if ( fog.isFog ) {
21340
21342
21341
21343
uniforms.fogNear.value = fog.near;
21342
21344
uniforms.fogFar.value = fog.far;
21343
21345
21344
- } else if ( fog && fog .isFogExp2 ) {
21346
+ } else if ( fog.isFogExp2 ) {
21345
21347
21346
21348
uniforms.fogDensity.value = fog.density;
21347
21349
@@ -21539,13 +21541,13 @@
21539
21541
21540
21542
shadowMap = ( light.shadow && light.shadow.map ) ? light.shadow.map.texture : null;
21541
21543
21542
- if ( light && light .isAmbientLight ) {
21544
+ if ( light.isAmbientLight ) {
21543
21545
21544
21546
r += color.r * intensity;
21545
21547
g += color.g * intensity;
21546
21548
b += color.b * intensity;
21547
21549
21548
- } else if ( light && light .isDirectionalLight ) {
21550
+ } else if ( light.isDirectionalLight ) {
21549
21551
21550
21552
var uniforms = lightCache.get( light );
21551
21553
21569
21571
_lights.directionalShadowMatrix[ directionalLength ] = light.shadow.matrix;
21570
21572
_lights.directional[ directionalLength ++ ] = uniforms;
21571
21573
21572
- } else if ( light && light .isSpotLight ) {
21574
+ } else if ( light.isSpotLight ) {
21573
21575
21574
21576
var uniforms = lightCache.get( light );
21575
21577
21602
21604
_lights.spotShadowMatrix[ spotLength ] = light.shadow.matrix;
21603
21605
_lights.spot[ spotLength ++ ] = uniforms;
21604
21606
21605
- } else if ( light && light .isPointLight ) {
21607
+ } else if ( light.isPointLight ) {
21606
21608
21607
21609
var uniforms = lightCache.get( light );
21608
21610
21638
21640
21639
21641
_lights.point[ pointLength ++ ] = uniforms;
21640
21642
21641
- } else if ( light && light .isHemisphereLight ) {
21643
+ } else if ( light.isHemisphereLight ) {
21642
21644
21643
21645
var uniforms = lightCache.get( light );
21644
21646
0 commit comments