Pārlūkot izejas kodu

ProgressiveLightMap: Make normals mandatory. (#31825)

Michael Herzog 5 mēneši atpakaļ
vecāks
revīzija
2a9049ff43

+ 6 - 0
examples/jsm/misc/ProgressiveLightMap.js

@@ -123,6 +123,12 @@ class ProgressiveLightMap {
 
 			}
 
+			if ( object.geometry.hasAttribute( 'normal' ) === false ) {
+
+				console.warn( 'THREE.ProgressiveLightMap: All lightmap objects need normals.' ); continue;
+
+			}
+
 			if ( this.blurringPlane === null ) {
 
 				this._initializeBlurPlane( this.res, this.progressiveLightMap1 );

+ 6 - 0
examples/jsm/misc/ProgressiveLightMapGPU.js

@@ -101,6 +101,12 @@ class ProgressiveLightMap {
 
 			}
 
+			if ( object.geometry.hasAttribute( 'normal' ) === false ) {
+
+				console.warn( 'THREE.ProgressiveLightMap: All lightmap objects need normals.' ); continue;
+
+			}
+
 			if ( this._blurringPlane === null ) {
 
 				this._initializeBlurPlane();

粤ICP备19079148号