瀏覽代碼

Exampels: Clean up.

Mugen87 5 年之前
父節點
當前提交
c162ae7d76
共有 3 個文件被更改,包括 13 次插入27 次删除
  1. 2 9
      examples/js/loaders/MMDLoader.js
  2. 9 9
      examples/js/utils/UVsDebug.js
  3. 2 9
      examples/jsm/loaders/MMDLoader.js

+ 2 - 9
examples/js/loaders/MMDLoader.js

@@ -1076,8 +1076,7 @@ THREE.MMDLoader = ( function () {
 
 							params.envMap = this._loadTexture(
 								fileNames[ 1 ],
-								textures,
-								{ sphericalReflectionMapping: true }
+								textures
 							);
 
 							params.combine = extension === '.sph'
@@ -1128,7 +1127,7 @@ THREE.MMDLoader = ( function () {
 
 						params.envMap = this._loadTexture(
 							data.textures[ material.envTextureIndex ],
-							textures, { sphericalReflectionMapping: true }
+							textures
 						);
 
 						params.combine = material.envFlag === 1
@@ -1344,12 +1343,6 @@ THREE.MMDLoader = ( function () {
 
 			}, onProgress, onError );
 
-			if ( params.sphericalReflectionMapping === true ) {
-
-				texture.mapping = THREE.SphericalReflectionMapping;
-
-			}
-
 			texture.readyCallbacks = [];
 
 			textures[ fullPath ] = texture;

+ 9 - 9
examples/js/utils/UVsDebug.js

@@ -34,13 +34,13 @@ THREE.UVsDebug = function ( geometry, size ) {
 	canvas.height = height;
 
 	var ctx = canvas.getContext( '2d' );
-	ctx.lineWidth = 2;
-	ctx.strokeStyle = 'rgba( 0, 0, 0, 1.0 )';
+	ctx.lineWidth = 1;
+	ctx.strokeStyle = 'rgb( 63, 63, 63 )';
 	ctx.textAlign = 'center';
 
 	// paint background white
 
-	ctx.fillStyle = 'rgba( 255, 255, 255, 1.0 )';
+	ctx.fillStyle = 'rgb( 255, 255, 255 )';
 	ctx.fillRect( 0, 0, width, height );
 
 	if ( geometry.isGeometry ) {
@@ -129,11 +129,11 @@ THREE.UVsDebug = function ( geometry, size ) {
 
 			if ( j === 0 ) {
 
-				ctx.moveTo( uv.x * width, ( 1 - uv.y ) * height );
+				ctx.moveTo( uv.x * ( width - 2 ) + 0.5, ( 1 - uv.y ) * ( height - 2 ) + 0.5 );
 
 			} else {
 
-				ctx.lineTo( uv.x * width, ( 1 - uv.y ) * height );
+				ctx.lineTo( uv.x * ( width - 2 ) + 0.5, ( 1 - uv.y ) * ( height - 2 ) + 0.5 );
 
 			}
 
@@ -148,8 +148,8 @@ THREE.UVsDebug = function ( geometry, size ) {
 
 		// label the face number
 
-		ctx.font = '12pt Arial bold';
-		ctx.fillStyle = 'rgba( 0, 0, 0, 1.0 )';
+		ctx.font = '18px Arial';
+		ctx.fillStyle = 'rgb( 63, 63, 63 )';
 		ctx.fillText( index, a.x * width, ( 1 - a.y ) * height );
 
 		if ( a.x > 0.95 ) {
@@ -162,8 +162,8 @@ THREE.UVsDebug = function ( geometry, size ) {
 
 		//
 
-		ctx.font = '8pt Arial bold';
-		ctx.fillStyle = 'rgba( 0, 0, 0, 1.0 )';
+		ctx.font = '12px Arial';
+		ctx.fillStyle = 'rgb( 191, 191, 191 )';
 
 		// label uv edge orders
 

+ 2 - 9
examples/jsm/loaders/MMDLoader.js

@@ -1110,8 +1110,7 @@ var MMDLoader = ( function () {
 
 							params.envMap = this._loadTexture(
 								fileNames[ 1 ],
-								textures,
-								{ sphericalReflectionMapping: true }
+								textures
 							);
 
 							params.combine = extension === '.sph'
@@ -1162,7 +1161,7 @@ var MMDLoader = ( function () {
 
 						params.envMap = this._loadTexture(
 							data.textures[ material.envTextureIndex ],
-							textures, { sphericalReflectionMapping: true }
+							textures
 						);
 
 						params.combine = material.envFlag === 1
@@ -1378,12 +1377,6 @@ var MMDLoader = ( function () {
 
 			}, onProgress, onError );
 
-			if ( params.sphericalReflectionMapping === true ) {
-
-				texture.mapping = SphericalReflectionMapping;
-
-			}
-
 			texture.readyCallbacks = [];
 
 			textures[ fullPath ] = texture;