提交 ea619a19 编写于 作者: M Mr.doob

Updated builds.

上级 9d4b774d
......@@ -21384,7 +21384,7 @@ THREE.PointsMaterial.prototype.copy = function ( source ) {
*
* parameters = {
* defines: { "label" : "value" },
* uniforms: { "parameter1": { type: "f", value: 1.0 }, "parameter2": { type: "i" value2: 2 } },
* uniforms: { "parameter1": { type: "1f", value: 1.0 }, "parameter2": { type: "1i" value2: 2 } },
*
* fragmentShader: <string>,
* vertexShader: <string>,
......@@ -23917,7 +23917,7 @@ THREE.UniformsLib = {
common: {
"diffuse": { type: "c", value: new THREE.Color( 0xeeeeee ) },
"opacity": { type: "f", value: 1.0 },
"opacity": { type: "1f", value: 1.0 },
"map": { type: "t", value: null },
"offsetRepeat": { type: "v4", value: new THREE.Vector4( 0, 0, 1, 1 ) },
......@@ -23926,23 +23926,23 @@ THREE.UniformsLib = {
"alphaMap": { type: "t", value: null },
"envMap": { type: "t", value: null },
"flipEnvMap": { type: "f", value: - 1 },
"reflectivity": { type: "f", value: 1.0 },
"refractionRatio": { type: "f", value: 0.98 }
"flipEnvMap": { type: "1f", value: - 1 },
"reflectivity": { type: "1f", value: 1.0 },
"refractionRatio": { type: "1f", value: 0.98 }
},
aomap: {
"aoMap": { type: "t", value: null },
"aoMapIntensity": { type: "f", value: 1 }
"aoMapIntensity": { type: "1f", value: 1 }
},
lightmap: {
"lightMap": { type: "t", value: null },
"lightMapIntensity": { type: "f", value: 1 }
"lightMapIntensity": { type: "1f", value: 1 }
},
......@@ -23955,7 +23955,7 @@ THREE.UniformsLib = {
bumpmap: {
"bumpMap": { type: "t", value: null },
"bumpScale": { type: "f", value: 1 }
"bumpScale": { type: "1f", value: 1 }
},
......@@ -23969,8 +23969,8 @@ THREE.UniformsLib = {
displacementmap: {
"displacementMap": { type: "t", value: null },
"displacementScale": { type: "f", value: 1 },
"displacementBias": { type: "f", value: 0 }
"displacementScale": { type: "1f", value: 1 },
"displacementBias": { type: "1f", value: 0 }
},
......@@ -23988,24 +23988,24 @@ THREE.UniformsLib = {
fog: {
"fogDensity": { type: "f", value: 0.00025 },
"fogNear": { type: "f", value: 1 },
"fogFar": { type: "f", value: 2000 },
"fogDensity": { type: "1f", value: 0.00025 },
"fogNear": { type: "1f", value: 1 },
"fogFar": { type: "1f", value: 2000 },
"fogColor": { type: "c", value: new THREE.Color( 0xffffff ) }
},
lights: {
"ambientLightColor": { type: "fv", value: [] },
"ambientLightColor": { type: "3fv", value: [] },
"directionalLights": { type: "sa", value: [], properties: {
"direction": { type: "v3" },
"color": { type: "c" },
"shadow": { type: "i" },
"shadowBias": { type: "f" },
"shadowRadius": { type: "f" },
"shadow": { type: "1i" },
"shadowBias": { type: "1f" },
"shadowRadius": { type: "1f" },
"shadowMapSize": { type: "v2" }
} },
......@@ -24016,14 +24016,14 @@ THREE.UniformsLib = {
"color": { type: "c" },
"position": { type: "v3" },
"direction": { type: "v3" },
"distance": { type: "f" },
"coneCos": { type: "f" },
"penumbraCos": { type: "f" },
"decay": { type: "f" },
"shadow": { type: "i" },
"shadowBias": { type: "f" },
"shadowRadius": { type: "f" },
"distance": { type: "1f" },
"coneCos": { type: "1f" },
"penumbraCos": { type: "1f" },
"decay": { type: "1f" },
"shadow": { type: "1i" },
"shadowBias": { type: "1f" },
"shadowRadius": { type: "1f" },
"shadowMapSize": { type: "v2" }
} },
......@@ -24033,12 +24033,12 @@ THREE.UniformsLib = {
"pointLights": { type: "sa", value: [], properties: {
"color": { type: "c" },
"position": { type: "v3" },
"decay": { type: "f" },
"distance": { type: "f" },
"decay": { type: "1f" },
"distance": { type: "1f" },
"shadow": { type: "i" },
"shadowBias": { type: "f" },
"shadowRadius": { type: "f" },
"shadow": { type: "1i" },
"shadowBias": { type: "1f" },
"shadowRadius": { type: "1f" },
"shadowMapSize": { type: "v2" }
} },
......@@ -24056,9 +24056,9 @@ THREE.UniformsLib = {
points: {
"diffuse": { type: "c", value: new THREE.Color( 0xeeeeee ) },
"opacity": { type: "f", value: 1.0 },
"size": { type: "f", value: 1.0 },
"scale": { type: "f", value: 1.0 },
"opacity": { type: "1f", value: 1.0 },
"size": { type: "1f", value: 1.0 },
"scale": { type: "1f", value: 1.0 },
"map": { type: "t", value: null },
"offsetRepeat": { type: "v4", value: new THREE.Vector4( 0, 0, 1, 1 ) }
......@@ -24229,7 +24229,7 @@ THREE.ShaderLib = {
{
"emissive" : { type: "c", value: new THREE.Color( 0x000000 ) },
"specular" : { type: "c", value: new THREE.Color( 0x111111 ) },
"shininess": { type: "f", value: 30 }
"shininess": { type: "1f", value: 30 }
}
] ),
......@@ -24257,9 +24257,9 @@ THREE.ShaderLib = {
{
"emissive" : { type: "c", value: new THREE.Color( 0x000000 ) },
"roughness": { type: "f", value: 0.5 },
"metalness": { type: "f", value: 0 },
"envMapIntensity" : { type: "f", value: 1 } // temporary
"roughness": { type: "1f", value: 0.5 },
"metalness": { type: "1f", value: 0 },
"envMapIntensity" : { type: "1f", value: 1 } // temporary
}
] ),
......@@ -24291,9 +24291,9 @@ THREE.ShaderLib = {
THREE.UniformsLib[ "fog" ],
{
"scale" : { type: "f", value: 1 },
"dashSize" : { type: "f", value: 1 },
"totalSize": { type: "f", value: 2 }
"scale" : { type: "1f", value: 1 },
"dashSize" : { type: "1f", value: 1 },
"totalSize": { type: "1f", value: 2 }
}
] ),
......@@ -24307,9 +24307,9 @@ THREE.ShaderLib = {
uniforms: {
"mNear": { type: "f", value: 1.0 },
"mFar" : { type: "f", value: 2000.0 },
"opacity" : { type: "f", value: 1.0 }
"mNear": { type: "1f", value: 1.0 },
"mFar" : { type: "1f", value: 2000.0 },
"opacity" : { type: "1f", value: 1.0 }
},
......@@ -24322,7 +24322,7 @@ THREE.ShaderLib = {
uniforms: {
"opacity" : { type: "f", value: 1.0 }
"opacity" : { type: "1f", value: 1.0 }
},
......@@ -24339,7 +24339,7 @@ THREE.ShaderLib = {
uniforms: {
"tCube": { type: "t", value: null },
"tFlip": { type: "f", value: - 1 }
"tFlip": { type: "1f", value: - 1 }
},
vertexShader: THREE.ShaderChunk['cube_vert'],
......@@ -24355,7 +24355,7 @@ THREE.ShaderLib = {
uniforms: {
"tEquirect": { type: "t", value: null },
"tFlip": { type: "f", value: - 1 }
"tFlip": { type: "1f", value: - 1 }
},
vertexShader: THREE.ShaderChunk['equirect_vert'],
......@@ -26692,12 +26692,12 @@ THREE.WebGLRenderer = function ( parameters ) {
} else if ( type === 'i' ) {
// single integer
console.warn( 'THREE.WebGLRenderer: Uniform "i" is now "1i".' );
_gl.uniform1i( location, value );
} else if ( type === 'f' ) {
// single float
console.warn( 'THREE.WebGLRenderer: Uniform "f" is now "1f".' );
_gl.uniform1f( location, value );
} else if ( type === 'v2' ) {
......@@ -26758,22 +26758,22 @@ THREE.WebGLRenderer = function ( parameters ) {
} else if ( type === 'iv1' ) {
// flat array of integers (JS or typed array)
console.warn( 'THREE.WebGLRenderer: Uniform "iv1" is now "1iv".' );
_gl.uniform1iv( location, value );
} else if ( type === 'iv' ) {
// flat array of integers with 3 x N size (JS or typed array)
console.warn( 'THREE.WebGLRenderer: Uniform "iv" is now "3iv".' );
_gl.uniform3iv( location, value );
} else if ( type === 'fv1' ) {
// flat array of floats (JS or typed array)
console.warn( 'THREE.WebGLRenderer: Uniform "fv1" is now "1fv".' );
_gl.uniform1fv( location, value );
} else if ( type === 'fv' ) {
// flat array of floats with 3 x N size (JS or typed array)
console.warn( 'THREE.WebGLRenderer: Uniform "fv" is now "3fv".' );
_gl.uniform3fv( location, value );
} else if ( type === 'v2v' ) {
......@@ -29760,16 +29760,16 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) {
this.getProgramCode = function ( material, parameters ) {
var chunks = [];
var array = [];
if ( parameters.shaderID ) {
chunks.push( parameters.shaderID );
array.push( parameters.shaderID );
} else {
chunks.push( material.fragmentShader );
chunks.push( material.vertexShader );
array.push( material.fragmentShader );
array.push( material.vertexShader );
}
......@@ -29777,8 +29777,8 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) {
for ( var name in material.defines ) {
chunks.push( name );
chunks.push( material.defines[ name ] );
array.push( name );
array.push( material.defines[ name ] );
}
......@@ -29786,11 +29786,11 @@ THREE.WebGLPrograms = function ( renderer, capabilities ) {
for ( var i = 0; i < parameterNames.length; i ++ ) {
chunks.push( parameters[ parameterNames[ i ] ] );
array.push( parameters[ parameterNames[ i ] ] );
}
return chunks.join();
return array.join();
};
......@@ -31092,14 +31092,14 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
occlusionTexture = gl.createTexture();
state.bindTexture( gl.TEXTURE_2D, tempTexture );
gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGB, 16, 16, 0, gl.RGB, gl.UNSIGNED_BYTE, new Uint8Array( 16 * 16 * 3 ) );
gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGB, 16, 16, 0, gl.RGB, gl.UNSIGNED_BYTE, null );
gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE );
gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE );
gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST );
gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST );
state.bindTexture( gl.TEXTURE_2D, occlusionTexture );
gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array( 16 * 16 * 4 ) );
gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null );
gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE );
gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE );
gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST );
......@@ -31335,6 +31335,8 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
var screenPosition = new THREE.Vector3( 1, 1, 0 ),
screenPositionPixels = new THREE.Vector2( 1, 1 );
var areaToCopy = new THREE.Vector2();
if ( program === undefined ) {
init();
......@@ -31384,13 +31386,15 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
screenPositionPixels.x = screenPosition.x * halfViewportWidth + halfViewportWidth;
screenPositionPixels.y = screenPosition.y * halfViewportHeight + halfViewportHeight;
areaToCopy.x = viewport.x + screenPositionPixels.x - 8; // horizontal coordinate of the lower left corner of the pixels to copy
areaToCopy.y = viewport.y + screenPositionPixels.y - 8; // vertical coordinate of the lower left corner of the pixels to copy
// screen cull
if ( hasVertexTexture || (
screenPositionPixels.x > 0 &&
screenPositionPixels.x < viewport.z &&
screenPositionPixels.y > 0 &&
screenPositionPixels.y < viewport.w ) ) {
if ( areaToCopy.x > 0 &&
areaToCopy.x < ( viewport.z - 16 ) &&
areaToCopy.y > 0 &&
areaToCopy.y < ( viewport.w - 16 ) ) {
// save current RGB to temp texture
......@@ -31398,7 +31402,7 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
state.bindTexture( gl.TEXTURE_2D, null );
state.activeTexture( gl.TEXTURE1 );
state.bindTexture( gl.TEXTURE_2D, tempTexture );
gl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGB, viewport.x + screenPositionPixels.x - 8, viewport.y + screenPositionPixels.y - 8, 16, 16, 0 );
gl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGB, areaToCopy.x, areaToCopy.y, 16, 16, 0 );
// render pink quad
......@@ -31417,7 +31421,7 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
state.activeTexture( gl.TEXTURE0 );
state.bindTexture( gl.TEXTURE_2D, occlusionTexture );
gl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGBA, viewport.x + screenPositionPixels.x - 8, viewport.y + screenPositionPixels.y - 8, 16, 16, 0 );
gl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGBA, areaToCopy.x, areaToCopy.y, 16, 16, 0 );
// restore graphics
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册