Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
755a2284
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
755a2284
编写于
3月 04, 2016
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
23dadbe3
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
332 addition
and
382 deletion
+332
-382
build/three.js
build/three.js
+187
-237
build/three.min.js
build/three.min.js
+145
-145
未找到文件。
build/three.js
浏览文件 @
755a2284
...
...
@@ -26510,417 +26510,367 @@ THREE.WebGLRenderer = function ( parameters ) {
}
function loadUniform
sGeneric ( uniforms
) {
function loadUniform
( uniform, type, location, value
) {
var texture, textureUnit;
for ( var j = 0, jl = uniforms.length; j < jl; j ++ ) {
var uniform = uniforms[ j ][ 0 ];
// needsUpdate property is not added to all uniforms.
if ( uniform.needsUpdate === false ) continue;
var type = uniform.type;
var value = uniform.value;
var location = uniforms[ j ][ 1 ];
if ( type === '1i' ) {
_gl.uniform1i( location, value );
if ( type === '1i' ) {
} else if ( type === '1f' ) {
_gl.uniform1i( location, value );
_gl.uniform1f( location, value );
} else if ( type === '1f' ) {
} else if ( type === '2f' ) {
_gl.uniform1f( location, value );
_gl.uniform2f( location, value[ 0 ], value[ 1 ] );
} else if ( type === '2f' ) {
} else if ( type === '3f' ) {
_gl.uniform2f( location, value[ 0 ], value[ 1 ] );
_gl.uniform3f( location, value[ 0 ], value[ 1 ], value[ 2 ] );
} else if ( type === '3f' ) {
} else if ( type === '4f' ) {
_gl.uniform3f( location, value[ 0 ], value[ 1 ], value[ 2 ] );
_gl.uniform4f( location, value[ 0 ], value[ 1 ], value[ 2 ], value[ 3 ] );
} else if ( type === '4f' ) {
} else if ( type === '1iv' ) {
_gl.uniform4f( location, value[ 0 ], value[ 1 ], value[ 2 ], value[ 3 ] );
_gl.uniform1iv( location, value );
} else if ( type === '1iv' ) {
} else if ( type === '3iv' ) {
_gl.uniform1iv( location, value );
_gl.uniform3iv( location, value );
} else if ( type === '3iv' ) {
} else if ( type === '1fv' ) {
_gl.uniform3iv( location, value );
_gl.uniform1fv( location, value );
} else if ( type === '1fv' ) {
} else if ( type === '2fv' ) {
_gl.uniform1fv( location, value );
_gl.uniform2fv( location, value );
} else if ( type === '2fv' ) {
} else if ( type === '3fv' ) {
_gl.uniform2fv( location, value );
_gl.uniform3fv( location, value );
} else if ( type === '3fv' ) {
} else if ( type === '4fv' ) {
_gl.uniform3fv( location, value );
_gl.uniform4fv( location, value );
} else if ( type === '4fv' ) {
} else if ( type === 'Matrix2fv' ) {
_gl.uniform4fv( location, value );
_gl.uniformMatrix2fv( location, false, value );
} else if ( type === 'Matrix2fv' ) {
} else if ( type === 'Matrix3fv' ) {
_gl.uniformMatrix2fv( location, false, value );
_gl.uniformMatrix3fv( location, false, value );
} else if ( type === 'Matrix3fv' ) {
} else if ( type === 'Matrix4fv' ) {
_gl.uniformMatrix3fv( location, false, value );
_gl.uniformMatrix4fv( location, false, value );
} else if ( type === 'Matrix4fv' ) {
//
} else if ( type === 'i' ) {
// single integer
_gl.uniform1i( location, value );
_gl.uniformMatrix4fv( location, false, value );
} else if ( type === 'f' ) {
//
// single float
_gl.uniform1f( location, value );
} else if ( type === 'i' ) {
} else if ( type === 'v2' ) {
// single integer
_gl.uniform1i( location, value );
// single THREE.Vector2
_gl.uniform2f( location, value.x, value.y );
} else if ( type === 'f' ) {
} else if ( type === 'v3' ) {
// single float
_gl.uniform1f( location, value );
// single THREE.Vector3
_gl.uniform3f( location, value.x, value.y, value.z );
} else if ( type === 'v2' ) {
} else if ( type === 'v4' ) {
// single THREE.Vector2
_gl.uniform2f( location, value.x, value.y );
// single THREE.Vector4
_gl.uniform4f( location, value.x, value.y, value.z, value.w );
} else if ( type === 'v3' ) {
} else if ( type === 'c' ) {
// single THREE.Vector3
_gl.uniform3f( location, value.x, value.y, value.z );
// single THREE.Color
_gl.uniform3f( location, value.r, value.g, value.b );
} else if ( type === 'v4' ) {
/
*
} else if ( type === 's' ) {
/
/ single THREE.Vector4
_gl.uniform4f( location, value.x, value.y, value.z, value.w );
// TODO: Optimize this
} else if ( type === 'c' ) {
for ( var propertyName in uniform.properties ) {
// single THREE.Color
_gl.uniform3f( location, value.r, value.g, value.b );
var property = uniform.properties[ propertyName ];
var locationProperty = location[ propertyName ];
var valueProperty = value[ propertyName ];
} else if ( type === 's' ) {
type = property.type;
// TODO: Optimize this
if ( type === 'i' ) {
var properties = uniform.properties;
_gl.uniform1i( locationProperty, valueProperty );
for ( var name in properties ) {
} else if ( type === 'f' ) {
var property = properties[ name ];
var locationProperty = location[ name ];
var valueProperty = value[ name ];
_gl.uniform1f(
locationProperty, valueProperty );
loadUniform( property, property.type,
locationProperty, valueProperty );
} else if ( type === 'v2' ) {
}
_gl.uniform2f( locationProperty, valueProperty.x, valueProperty.y );
} else if ( type === 'sa' ) {
} else if ( type === 'v3' ) {
// TODO: Optimize this
_gl.uniform3f( locationProperty, valueProperty.x, valueProperty.y, valueProperty.z )
;
var properties = uniform.properties
;
} else if ( type === 'v4'
) {
for ( var i = 0, l = value.length; i < l; i ++
) {
_gl.uniform4f( locationProperty, valueProperty.x, valueProperty.y, valueProperty.z, valueProperty.w );
for ( var name in properties ) {
} else if ( type === 'c' ) {
var property = properties[ name ];
var locationProperty = location[ i ][ name ];
var valueProperty = value[ i ][ name ];
_gl.uniform3f( locationProperty, valueProperty.r, valueProperty.g, valueProperty.b );
}
loadUniform( property, property.type, locationProperty, valueProperty );
}
}
*/
} else if ( type === 'sa' ) {
// TODO: Optimize this
} else if ( type === 'iv1' ) {
for ( var i = 0; i < value.length; i ++ ) {
// flat array of integers (JS or typed array)
_gl.uniform1iv( location, value );
for ( var propertyName in uniform.properties
) {
} else if ( type === 'iv'
) {
var property = uniform.properties[ propertyName ];
var locationProperty = location[ i ][ propertyName ];
var valueProperty = value[ i ][ propertyName ];
// flat array of integers with 3 x N size (JS or typed array)
_gl.uniform3iv( location, value );
type = property.type;
} else if ( type === 'fv1' ) {
if ( type === 'i' ) {
// flat array of floats (JS or typed array)
_gl.uniform1fv( location, value );
_gl.uniform1i( locationProperty, valueProperty );
} else if ( type === 'fv' ) {
} else if ( type === 'f' ) {
// flat array of floats with 3 x N size (JS or typed array)
_gl.uniform3fv( location, value );
_gl.uniform1f( locationProperty, valueProperty );
} else if ( type === 'v2v' ) {
} else if ( type === 'v2' ) {
// array of THREE.Vector2
_gl.uniform2f( locationProperty, valueProperty.x, valueProperty.y );
if ( uniform._array === undefined ) {
} else if ( type === 'v3' ) {
uniform._array = new Float32Array( 2 * value.length );
_gl.uniform3f( locationProperty, valueProperty.x, valueProperty.y, valueProperty.z );
}
} else if ( type === 'v4'
) {
for ( var i = 0, i2 = 0, il = value.length; i < il; i ++, i2 += 2
) {
_gl.uniform4f( locationProperty, valueProperty.x, valueProperty.y, valueProperty.z, valueProperty.w );
uniform._array[ i2 + 0 ] = value[ i ].x;
uniform._array[ i2 + 1 ] = value[ i ].y;
} else if ( type === 'c' ) {
}
_gl.uniform3f( locationProperty, valueProperty.r, valueProperty.g, valueProperty.b
);
_gl.uniform2fv( location, uniform._array
);
} else if ( type === 'm4
' ) {
} else if ( type === 'v3v
' ) {
_gl.uniformMatrix4fv( locationProperty, false, valueProperty.elements );
// array of THREE.Vector3
}
if ( uniform._array === undefined ) {
}
uniform._array = new Float32Array( 3 * value.length );
}
}
} else if ( type === 'iv1'
) {
for ( var i = 0, i3 = 0, il = value.length; i < il; i ++, i3 += 3
) {
// flat array of integers (JS or typed array)
_gl.uniform1iv( location, value );
uniform._array[ i3 + 0 ] = value[ i ].x;
uniform._array[ i3 + 1 ] = value[ i ].y;
uniform._array[ i3 + 2 ] = value[ i ].z;
}
else if ( type === 'iv' ) {
}
// flat array of integers with 3 x N size (JS or typed array)
_gl.uniform3iv( location, value );
_gl.uniform3fv( location, uniform._array );
} else if ( type === 'fv1
' ) {
} else if ( type === 'v4v
' ) {
// flat array of floats (JS or typed array)
_gl.uniform1fv( location, value );
// array of THREE.Vector4
} else if ( type === 'fv'
) {
if ( uniform._array === undefined
) {
// flat array of floats with 3 x N size (JS or typed array)
_gl.uniform3fv( location, value );
uniform._array = new Float32Array( 4 * value.length );
}
else if ( type === 'v2v' ) {
}
// array of THREE.Vector2
for ( var i = 0, i4 = 0, il = value.length; i < il; i ++, i4 += 4 ) {
if ( uniform._array === undefined ) {
uniform._array[ i4 + 0 ] = value[ i ].x;
uniform._array[ i4 + 1 ] = value[ i ].y;
uniform._array[ i4 + 2 ] = value[ i ].z;
uniform._array[ i4 + 3 ] = value[ i ].w;
uniform._array = new Float32Array( 2 * value.length );
}
}
_gl.uniform4fv( location, uniform._array );
for ( var i = 0, i2 = 0, il = value.length; i < il; i ++, i2 += 2
) {
} else if ( type === 'm2'
) {
uniform._array[ i2 + 0 ] = value[ i ].x;
uniform._array[ i2 + 1 ] = value[ i ].y
;
// single THREE.Matrix2
_gl.uniformMatrix2fv( location, false, value.elements )
;
}
} else if ( type === 'm3' ) {
_gl.uniform2fv( location, uniform._array );
// single THREE.Matrix3
_gl.uniformMatrix3fv( location, false, value.elements );
} else if ( type === 'v
3v' ) {
} else if ( type === 'm
3v' ) {
// array of THREE.Vector
3
// array of THREE.Matrix
3
if ( uniform._array === undefined ) {
if ( uniform._array === undefined ) {
uniform._array = new Float32Array( 3
* value.length );
uniform._array = new Float32Array( 9
* value.length );
}
}
for ( var i = 0, i3 = 0, il = value.length; i < il; i ++, i3 += 3
) {
for ( var i = 0, il = value.length; i < il; i ++
) {
uniform._array[ i3 + 0 ] = value[ i ].x;
uniform._array[ i3 + 1 ] = value[ i ].y;
uniform._array[ i3 + 2 ] = value[ i ].z;
value[ i ].flattenToArrayOffset( uniform._array, i * 9 );
}
}
_gl.uniform3fv( location
, uniform._array );
_gl.uniformMatrix3fv( location, false
, uniform._array );
} else if ( type === 'v4v
' ) {
} else if ( type === 'm4
' ) {
// array of THREE.Vector4
// single THREE.Matrix4
_gl.uniformMatrix4fv( location, false, value.elements );
if ( uniform._array === undefined
) {
} else if ( type === 'm4v'
) {
uniform._array = new Float32Array( 4 * value.length );
// array of THREE.Matrix4
}
if ( uniform._array === undefined ) {
for ( var i = 0, i4 = 0, il = value.length; i < il; i ++, i4 += 4 ) {
uniform._array = new Float32Array( 16 * value.length );
uniform._array[ i4 + 0 ] = value[ i ].x;
uniform._array[ i4 + 1 ] = value[ i ].y;
uniform._array[ i4 + 2 ] = value[ i ].z;
uniform._array[ i4 + 3 ] = value[ i ].w;
}
}
for ( var i = 0, il = value.length; i < il; i ++ ) {
_gl.uniform4fv( location, uniform._array
);
value[ i ].flattenToArrayOffset( uniform._array, i * 16
);
}
else if ( type === 'm2' ) {
}
// single THREE.Matrix2
_gl.uniformMatrix2fv( location, false, value.elements );
_gl.uniformMatrix4fv( location, false, uniform._array );
} else if ( type === 'm3
' ) {
} else if ( type === 't
' ) {
// single THREE.Matrix3
_gl.uniformMatrix3fv( location, false, value.elements );
// single THREE.Texture (2d or cube)
} else if ( type === 'm3v' ) {
texture = value;
textureUnit = getTextureUnit();
// array of THREE.Matrix3
_gl.uniform1i( location, textureUnit );
if ( uniform._array === undefined ) {
if ( ! texture ) return;
uniform._array = new Float32Array( 9 * value.length );
if ( texture instanceof THREE.CubeTexture ||
( Array.isArray( texture.image ) && texture.image.length === 6 ) ) {
}
// CompressedTexture can have Array in image :/
for ( var i = 0, il = value.length; i < il; i ++ ) {
setCubeTexture( texture, textureUnit );
value[ i ].flattenToArrayOffset( uniform._array, i * 9 );
} else if ( texture instanceof THREE.WebGLRenderTargetCube ) {
}
setCubeTextureDynamic( texture.texture, textureUnit );
_gl.uniformMatrix3fv( location, false, uniform._array );
} else if ( texture instanceof THREE.WebGLRenderTarget ) {
} else if ( type === 'm4' ) {
_this.setTexture( texture.texture, textureUnit );
// single THREE.Matrix4
_gl.uniformMatrix4fv( location, false, value.elements );
} else {
} else if ( type === 'm4v' ) {
_this.setTexture( texture, textureUnit );
// array of THREE.Matrix4
}
if ( uniform._array === undefined
) {
} else if ( type === 'tv'
) {
uniform._array = new Float32Array( 16 * value.length );
// array of THREE.Texture (2d or cube)
}
if ( uniform._array === undefined ) {
for ( var i = 0, il = value.length; i < il; i ++ ) {
uniform._array = [];
value[ i ].flattenToArrayOffset( uniform._array, i * 16 );
}
}
for ( var i = 0, il = uniform.value.length; i < il; i ++ ) {
_gl.uniformMatrix4fv( location, false, uniform._array
);
uniform._array[ i ] = getTextureUnit(
);
}
else if ( type === 't' ) {
}
// single THREE.Texture (2d or cube)
_gl.uniform1iv( location, uniform._array );
texture = value;
textureUnit = getTextureUnit();
for ( var i = 0, il = uniform.value.length; i < il; i ++ ) {
_gl.uniform1i( location, textureUnit );
texture = uniform.value[ i ];
textureUnit = uniform._array[ i ];
if ( ! texture ) continue;
if ( texture instanceof THREE.CubeTexture ||
(
Array.isArray( texture.image )
&& texture.image.length === 6 ) ) {
(
texture.image instanceof Array
&& texture.image.length === 6 ) ) {
// CompressedTexture can have Array in image :/
setCubeTexture( texture, textureUnit );
} else if ( texture instanceof THREE.WebGLRenderTargetCube ) {
setCubeTextureDynamic( texture.texture, textureUnit );
} else if ( texture instanceof THREE.WebGLRenderTarget ) {
_this.setTexture( texture.texture, textureUnit );
} else {
_this.setTexture( texture, textureUnit );
}
} else if ( type === 'tv' ) {
// array of THREE.Texture (2d or cube)
if ( uniform._array === undefined ) {
uniform._array = [];
} else if ( texture instanceof THREE.WebGLRenderTargetCube ) {
}
setCubeTextureDynamic( texture.texture, textureUnit );
for ( var i = 0, il = uniform.value.length; i < il; i ++ )
{
} else
{
uniform._array[ i ] = getTextureUnit(
);
_this.setTexture( texture, textureUnit
);
}
_gl.uniform1iv( location, uniform._array );
for ( var i = 0, il = uniform.value.length; i < il; i ++ ) {
texture = uniform.value[ i ];
textureUnit = uniform._array[ i ];
if ( ! texture ) continue;
if ( texture instanceof THREE.CubeTexture ||
( texture.image instanceof Array && texture.image.length === 6 ) ) {
// CompressedTexture can have Array in image :/
setCubeTexture( texture, textureUnit );
} else if ( texture instanceof THREE.WebGLRenderTarget ) {
}
_this.setTexture( texture.texture, textureUnit );
} else {
} else if ( texture instanceof THREE.WebGLRenderTargetCube ) {
console.warn( 'THREE.WebGLRenderer: Unknown uniform type: ' + type );
setCubeTextureDynamic( texture.texture, textureUnit );
}
} else {
}
_this.setTexture( texture, textureUnit );
function loadUniformsGeneric( uniforms ) {
}
for ( var i = 0, l = uniforms.length; i < l; i ++ ) {
}
var uniform = uniforms[ i ][ 0 ];
} else {
// needsUpdate property is not added to all uniforms.
if ( uniform.needsUpdate === false ) continue;
console.warn( 'THREE.WebGLRenderer: Unknown uniform type: ' + type );
var type = uniform.type;
var location = uniforms[ i ][ 1 ];
var value = uniform.value;
}
loadUniform( uniform, type, location, value );
}
...
...
build/three.min.js
浏览文件 @
755a2284
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录