|
@@ -1618,7 +1618,7 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
materialProperties.lightsStateVersion = lightsStateVersion;
|
|
|
|
|
|
- if ( material.lights ) {
|
|
|
+ if ( materialNeedsLights( material ) ) {
|
|
|
|
|
|
// wire up the material to this renderer's lighting state
|
|
|
|
|
@@ -1684,7 +1684,7 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
material.needsUpdate = true;
|
|
|
|
|
|
- } else if ( material.lights && materialProperties.lightsStateVersion !== lights.state.version ) {
|
|
|
+ } else if ( materialNeedsLights( material ) && materialProperties.lightsStateVersion !== lights.state.version ) {
|
|
|
|
|
|
material.needsUpdate = true;
|
|
|
|
|
@@ -1868,7 +1868,7 @@ function WebGLRenderer( parameters ) {
|
|
|
p_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure );
|
|
|
p_uniforms.setValue( _gl, 'toneMappingWhitePoint', _this.toneMappingWhitePoint );
|
|
|
|
|
|
- if ( material.lights ) {
|
|
|
+ if ( materialNeedsLights( material ) ) {
|
|
|
|
|
|
// the current material requires lighting info
|
|
|
|
|
@@ -2475,6 +2475,14 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ function materialNeedsLights( material ) {
|
|
|
+
|
|
|
+ return material.isMeshLambertMaterial || material.isMeshPhongMaterial ||
|
|
|
+ material.isMeshStandardMaterial || material.isShadowMaterial ||
|
|
|
+ ( material.isShaderMaterial && material.lights === true );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
//
|
|
|
this.setFramebuffer = function ( value ) {
|
|
|
|