瀏覽代碼

JSM: Rebuild files

Mugen87 6 年之前
父節點
當前提交
0544f229dd
共有 2 個文件被更改,包括 10 次插入5 次删除
  1. 7 1
      examples/jsm/loaders/GLTFLoader.js
  2. 3 4
      examples/jsm/renderers/RaytracingRenderer.js

+ 7 - 1
examples/jsm/loaders/GLTFLoader.js

@@ -2705,7 +2705,13 @@ var GLTFLoader = ( function () {
 							? new SkinnedMesh( geometry, material )
 							: new Mesh( geometry, material );
 
-						if ( mesh.isSkinnedMesh === true ) mesh.normalizeSkinWeights(); // #15319
+						if ( mesh.isSkinnedMesh === true && !mesh.geometry.attributes.skinWeight.normalized ) {
+
+							// we normalize floating point skin weight array to fix malformed assets (see #15319)
+							// it's important to skip this for non-float32 data since normalizeSkinWeights assumes non-normalized inputs
+							mesh.normalizeSkinWeights();
+
+						}
 
 						if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP ) {
 

+ 3 - 4
examples/jsm/renderers/RaytracingRenderer.js

@@ -130,8 +130,6 @@ var RaytracingRenderer = function ( parameters ) {
 		canvasWidth = canvas.width;
 		canvasHeight = canvas.height;
 
-		context.fillStyle = 'white';
-
 		pool.forEach( updateSettings );
 
 	};
@@ -181,7 +179,6 @@ var RaytracingRenderer = function ( parameters ) {
 		} );
 
 		context.fillStyle = '#' + worker.color;
-
 		context.fillRect( blockX, blockY, blockSize, blockSize );
 
 	}
@@ -252,7 +249,9 @@ var RaytracingRenderer = function ( parameters ) {
 
 		} );
 
-		context.clearRect( 0, 0, canvasWidth, canvasHeight );
+		context.fillStyle = clearColor.getStyle();
+		context.fillRect( 0, 0, canvasWidth, canvasHeight );
+
 		reallyThen = Date.now();
 
 		xblocks = Math.ceil( canvasWidth / blockSize );