@@ -632,7 +632,9 @@ function WebGLRenderer( parameters ) {
632
632
633
633
_gl . bindBuffer ( _gl . ARRAY_BUFFER , buffers . normal ) ;
634
634
635
- if ( material . type !== 'MeshPhongMaterial' && material . type !== 'MeshStandardMaterial' && material . type !== 'MeshPhysicalMaterial' && material . shading === FlatShading ) {
635
+ if ( ! material . isMeshPhongMaterial &&
636
+ ! material . isMeshStandardMaterial &&
637
+ material . shading === FlatShading ) {
636
638
637
639
for ( var i = 0 , l = object . count * 3 ; i < l ; i += 9 ) {
638
640
@@ -1442,7 +1444,7 @@ function WebGLRenderer( parameters ) {
1442
1444
1443
1445
var geometry = objects . update ( object ) ;
1444
1446
1445
- if ( material && material . isMultiMaterial ) {
1447
+ if ( material . isMultiMaterial ) {
1446
1448
1447
1449
var groups = geometry . groups ;
1448
1450
var materials = material . materials ;
@@ -1625,9 +1627,9 @@ function WebGLRenderer( parameters ) {
1625
1627
1626
1628
var uniforms = materialProperties . __webglShader . uniforms ;
1627
1629
1628
- if ( ! ( material && material . isShaderMaterial ) &&
1629
- ! ( material && material . isRawShaderMaterial ) | |
1630
- material . clipping === true ) {
1630
+ if ( ! material . isShaderMaterial &&
1631
+ ! material . isRawShaderMaterial |
1632
+ material . clipping === true ) {
1631
1633
1632
1634
materialProperties . numClippingPlanes = _clipping . numPlanes ;
1633
1635
uniforms . clippingPlanes = _clipping . uniform ;
@@ -1806,10 +1808,10 @@ function WebGLRenderer( parameters ) {
1806
1808
// load material specific uniforms
1807
1809
// (shader material also gets them for the sake of genericity)
1808
1810
1809
- if ( ( material && material . isShaderMaterial ) ||
1810
- ( material && material . isMeshPhongMaterial ) ||
1811
- ( material && material . isMeshStandardMaterial ) ||
1812
- material . envMap ) {
1811
+ if ( material . isShaderMaterial ||
1812
+ material . isMeshPhongMaterial ||
1813
+ material . isMeshStandardMaterial ||
1814
+ material . envMap ) {
1813
1815
1814
1816
var uCamPos = p_uniforms . map . cameraPosition ;
1815
1817
@@ -1822,12 +1824,12 @@ function WebGLRenderer( parameters ) {
1822
1824
1823
1825
}
1824
1826
1825
- if ( ( material && material . isMeshPhongMaterial ) ||
1826
- ( material && material . isMeshLambertMaterial ) ||
1827
- ( material && material . isMeshBasicMaterial ) ||
1828
- ( material && material . isMeshStandardMaterial ) ||
1829
- ( material && material . isShaderMaterial ) ||
1830
- material . skinning ) {
1827
+ if ( material . isMeshPhongMaterial ||
1828
+ material . isMeshLambertMaterial ||
1829
+ material . isMeshBasicMaterial ||
1830
+ material . isMeshStandardMaterial ||
1831
+ material . isShaderMaterial ||
1832
+ material . skinning ) {
1831
1833
1832
1834
p_uniforms . setValue ( _gl , 'viewMatrix' , camera . matrixWorldInverse ) ;
1833
1835
@@ -1892,48 +1894,48 @@ function WebGLRenderer( parameters ) {
1892
1894
1893
1895
}
1894
1896
1895
- if ( ( material && material . isMeshBasicMaterial ) ||
1896
- ( material && material . isMeshLambertMaterial ) ||
1897
- ( material && material . isMeshPhongMaterial ) ||
1898
- ( material && material . isMeshStandardMaterial ) ||
1899
- ( material && material . isMeshDepthMaterial ) ) {
1897
+ if ( material . isMeshBasicMaterial ||
1898
+ material . isMeshLambertMaterial ||
1899
+ material . isMeshPhongMaterial ||
1900
+ material . isMeshStandardMaterial ||
1901
+ material . isMeshDepthMaterial ) {
1900
1902
1901
1903
refreshUniformsCommon ( m_uniforms , material ) ;
1902
1904
1903
1905
}
1904
1906
1905
1907
// refresh single material specific uniforms
1906
1908
1907
- if ( material && material . isLineBasicMaterial ) {
1909
+ if ( material . isLineBasicMaterial ) {
1908
1910
1909
1911
refreshUniformsLine ( m_uniforms , material ) ;
1910
1912
1911
- } else if ( material && material . isLineDashedMaterial ) {
1913
+ } else if ( material . isLineDashedMaterial ) {
1912
1914
1913
1915
refreshUniformsLine ( m_uniforms , material ) ;
1914
1916
refreshUniformsDash ( m_uniforms , material ) ;
1915
1917
1916
- } else if ( material && material . isPointsMaterial ) {
1918
+ } else if ( material . isPointsMaterial ) {
1917
1919
1918
1920
refreshUniformsPoints ( m_uniforms , material ) ;
1919
1921
1920
- } else if ( material && material . isMeshLambertMaterial ) {
1922
+ } else if ( material . isMeshLambertMaterial ) {
1921
1923
1922
1924
refreshUniformsLambert ( m_uniforms , material ) ;
1923
1925
1924
- } else if ( material && material . isMeshPhongMaterial ) {
1926
+ } else if ( material . isMeshPhongMaterial ) {
1925
1927
1926
1928
refreshUniformsPhong ( m_uniforms , material ) ;
1927
1929
1928
- } else if ( material && material . isMeshPhysicalMaterial ) {
1930
+ } else if ( material . isMeshPhysicalMaterial ) {
1929
1931
1930
1932
refreshUniformsPhysical ( m_uniforms , material ) ;
1931
1933
1932
- } else if ( material && material . isMeshStandardMaterial ) {
1934
+ } else if ( material . isMeshStandardMaterial ) {
1933
1935
1934
1936
refreshUniformsStandard ( m_uniforms , material ) ;
1935
1937
1936
- } else if ( material && material . isMeshDepthMaterial ) {
1938
+ } else if ( material . isMeshDepthMaterial ) {
1937
1939
1938
1940
if ( material . displacementMap ) {
1939
1941
@@ -1943,7 +1945,7 @@ function WebGLRenderer( parameters ) {
1943
1945
1944
1946
}
1945
1947
1946
- } else if ( material && material . isMeshNormalMaterial ) {
1948
+ } else if ( material . isMeshNormalMaterial ) {
1947
1949
1948
1950
m_uniforms . opacity . value = material . opacity ;
1949
1951
@@ -2055,7 +2057,7 @@ function WebGLRenderer( parameters ) {
2055
2057
if ( uvScaleMap !== undefined ) {
2056
2058
2057
2059
// backwards compatibility
2058
- if ( ( uvScaleMap && uvScaleMap . isWebGLRenderTarget ) ) {
2060
+ if ( uvScaleMap . isWebGLRenderTarget ) {
2059
2061
2060
2062
uvScaleMap = uvScaleMap . texture ;
2061
2063
@@ -2120,12 +2122,12 @@ function WebGLRenderer( parameters ) {
2120
2122
2121
2123
uniforms . fogColor . value = fog . color ;
2122
2124
2123
- if ( fog && fog . isFog ) {
2125
+ if ( fog . isFog ) {
2124
2126
2125
2127
uniforms . fogNear . value = fog . near ;
2126
2128
uniforms . fogFar . value = fog . far ;
2127
2129
2128
- } else if ( fog && fog . isFogExp2 ) {
2130
+ } else if ( fog . isFogExp2 ) {
2129
2131
2130
2132
uniforms . fogDensity . value = fog . density ;
2131
2133
@@ -2323,13 +2325,13 @@ function WebGLRenderer( parameters ) {
2323
2325
2324
2326
shadowMap = ( light . shadow && light . shadow . map ) ? light . shadow . map . texture : null ;
2325
2327
2326
- if ( light && light . isAmbientLight ) {
2328
+ if ( light . isAmbientLight ) {
2327
2329
2328
2330
r += color . r * intensity ;
2329
2331
g += color . g * intensity ;
2330
2332
b += color . b * intensity ;
2331
2333
2332
- } else if ( light && light . isDirectionalLight ) {
2334
+ } else if ( light . isDirectionalLight ) {
2333
2335
2334
2336
var uniforms = lightCache . get ( light ) ;
2335
2337
@@ -2353,7 +2355,7 @@ function WebGLRenderer( parameters ) {
2353
2355
_lights . directionalShadowMatrix [ directionalLength ] = light . shadow . matrix ;
2354
2356
_lights . directional [ directionalLength ++ ] = uniforms ;
2355
2357
2356
- } else if ( light && light . isSpotLight ) {
2358
+ } else if ( light . isSpotLight ) {
2357
2359
2358
2360
var uniforms = lightCache . get ( light ) ;
2359
2361
@@ -2386,7 +2388,7 @@ function WebGLRenderer( parameters ) {
2386
2388
_lights . spotShadowMatrix [ spotLength ] = light . shadow . matrix ;
2387
2389
_lights . spot [ spotLength ++ ] = uniforms ;
2388
2390
2389
- } else if ( light && light . isPointLight ) {
2391
+ } else if ( light . isPointLight ) {
2390
2392
2391
2393
var uniforms = lightCache . get ( light ) ;
2392
2394
@@ -2422,7 +2424,7 @@ function WebGLRenderer( parameters ) {
2422
2424
2423
2425
_lights . point [ pointLength ++ ] = uniforms ;
2424
2426
2425
- } else if ( light && light . isHemisphereLight ) {
2427
+ } else if ( light . isHemisphereLight ) {
2426
2428
2427
2429
var uniforms = lightCache . get ( light ) ;
2428
2430
0 commit comments