|
@@ -144,7 +144,7 @@ THREE.MMDLoader.prototype.loadVmds = function ( urls, callback, onProgress, onEr
|
|
|
|
|
|
}, onProgress, onError );
|
|
}, onProgress, onError );
|
|
|
|
|
|
- };
|
|
|
|
|
|
+ }
|
|
|
|
|
|
run();
|
|
run();
|
|
|
|
|
|
@@ -474,7 +474,7 @@ THREE.MMDLoader.prototype.loadFileAsText = function ( url, onLoad, onProgress, o
|
|
|
|
|
|
THREE.MMDLoader.prototype.loadFileAsShiftJISText = function ( url, onLoad, onProgress, onError ) {
|
|
THREE.MMDLoader.prototype.loadFileAsShiftJISText = function ( url, onLoad, onProgress, onError ) {
|
|
|
|
|
|
- var request = this.loadFile( url, onLoad, onProgress, onError, 'text', 'text/plain; charset=shift_jis' );
|
|
|
|
|
|
+ this.loadFile( url, onLoad, onProgress, onError, 'text', 'text/plain; charset=shift_jis' );
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
@@ -738,7 +738,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
|
|
attribute.array[ index * 3 + 1 ] += v.position[ 1 ] * ratio;
|
|
attribute.array[ index * 3 + 1 ] += v.position[ 1 ] * ratio;
|
|
attribute.array[ index * 3 + 2 ] += v.position[ 2 ] * ratio;
|
|
attribute.array[ index * 3 + 2 ] += v.position[ 2 ] * ratio;
|
|
|
|
|
|
- };
|
|
|
|
|
|
+ }
|
|
|
|
|
|
function updateVertices( attribute, m, ratio ) {
|
|
function updateVertices( attribute, m, ratio ) {
|
|
|
|
|
|
@@ -762,7 +762,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- };
|
|
|
|
|
|
+ }
|
|
|
|
|
|
var morphTargets = [];
|
|
var morphTargets = [];
|
|
var attributes = [];
|
|
var attributes = [];
|
|
@@ -881,7 +881,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
|
|
|
|
|
|
} catch ( e ) {
|
|
} catch ( e ) {
|
|
|
|
|
|
- console.warn( 'THREE.MMDLoader: ' + filePath + ' seems like not right default texture path. Using toon00.bmp instead.' )
|
|
|
|
|
|
+ console.warn( 'THREE.MMDLoader: ' + filePath + ' seems like not right default texture path. Using toon00.bmp instead.' );
|
|
fullPath = scope.defaultToonTextures[ 0 ];
|
|
fullPath = scope.defaultToonTextures[ 0 ];
|
|
|
|
|
|
}
|
|
}
|
|
@@ -930,7 +930,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
|
|
|
|
|
|
return uuid;
|
|
return uuid;
|
|
|
|
|
|
- };
|
|
|
|
|
|
+ }
|
|
|
|
|
|
function getTexture( name, textures ) {
|
|
function getTexture( name, textures ) {
|
|
|
|
|
|
@@ -942,7 +942,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
|
|
|
|
|
|
return textures[ name ];
|
|
return textures[ name ];
|
|
|
|
|
|
- };
|
|
|
|
|
|
+ }
|
|
|
|
|
|
for ( var i = 0; i < model.metadata.materialCount; i++ ) {
|
|
for ( var i = 0; i < model.metadata.materialCount; i++ ) {
|
|
|
|
|
|
@@ -1120,7 +1120,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
|
|
|
|
|
|
return ctx.getImageData( 0, 0, c.width, c.height );
|
|
return ctx.getImageData( 0, 0, c.width, c.height );
|
|
|
|
|
|
- };
|
|
|
|
|
|
+ }
|
|
|
|
|
|
function detectTextureTransparency( image, uvs, indices ) {
|
|
function detectTextureTransparency( image, uvs, indices ) {
|
|
|
|
|
|
@@ -1168,7 +1168,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
|
|
|
|
|
|
return false;
|
|
return false;
|
|
|
|
|
|
- };
|
|
|
|
|
|
+ }
|
|
|
|
|
|
/*
|
|
/*
|
|
* This method expects
|
|
* This method expects
|
|
@@ -1201,7 +1201,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
|
|
|
|
|
|
return image.data[ index * 4 + 3 ];
|
|
return image.data[ index * 4 + 3 ];
|
|
|
|
|
|
- };
|
|
|
|
|
|
+ }
|
|
|
|
|
|
var imageData = t.image.data !== undefined ? t.image : createImageData( t.image );
|
|
var imageData = t.image.data !== undefined ? t.image : createImageData( t.image );
|
|
var indices = geometry.index.array.slice( m.faceOffset * 3, m.faceOffset * 3 + m.faceNum * 3 );
|
|
var indices = geometry.index.array.slice( m.faceOffset * 3, m.faceOffset * 3 + m.faceNum * 3 );
|
|
@@ -1260,7 +1260,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress
|
|
|
|
|
|
return n.match( /toon(10|0[0-9]).bmp/ ) === null ? false : true;
|
|
return n.match( /toon(10|0[0-9]).bmp/ ) === null ? false : true;
|
|
|
|
|
|
- };
|
|
|
|
|
|
+ }
|
|
|
|
|
|
m.outlineParameters = {
|
|
m.outlineParameters = {
|
|
thickness: p2.edgeFlag === 1 ? 0.003 : 0.0,
|
|
thickness: p2.edgeFlag === 1 ? 0.003 : 0.0,
|
|
@@ -2039,7 +2039,7 @@ THREE.ShaderLib[ 'mmd' ] = {
|
|
"#define RE_Direct RE_Direct_BlinnMMD",
|
|
"#define RE_Direct RE_Direct_BlinnMMD",
|
|
// ---- MMD specific for toon mapping
|
|
// ---- MMD specific for toon mapping
|
|
|
|
|
|
- "void main()",
|
|
|
|
|
|
+ "void main()"
|
|
|
|
|
|
].join( "\n" ) )
|
|
].join( "\n" ) )
|
|
|
|
|