Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
c886b840
T
three.js
项目概览
车家大少爷
/
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,发现更多精彩内容 >>
提交
c886b840
编写于
3月 18, 2016
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
5d724d33
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
314 addition
and
413 deletion
+314
-413
build/three.js
build/three.js
+149
-245
build/three.min.js
build/three.min.js
+165
-168
未找到文件。
build/three.js
浏览文件 @
c886b840
...
...
@@ -24179,14 +24179,14 @@ THREE.ShaderLib = {
uniforms: THREE.UniformsUtils.merge( [
THREE.UniformsLib[
"common"
],
THREE.UniformsLib[
"aomap"
],
THREE.UniformsLib[
"fog"
]
THREE.UniformsLib[
'common'
],
THREE.UniformsLib[
'aomap'
],
THREE.UniformsLib[
'fog'
]
] ),
vertexShader: THREE.ShaderChunk[
'meshbasic_vert'
],
fragmentShader: THREE.ShaderChunk[
'meshbasic_frag'
]
vertexShader: THREE.ShaderChunk[
'meshbasic_vert'
],
fragmentShader: THREE.ShaderChunk[
'meshbasic_frag'
]
},
...
...
@@ -24194,12 +24194,12 @@ THREE.ShaderLib = {
uniforms: THREE.UniformsUtils.merge( [
THREE.UniformsLib[
"common"
],
THREE.UniformsLib[
"aomap"
],
THREE.UniformsLib[
"lightmap"
],
THREE.UniformsLib[
"emissivemap"
],
THREE.UniformsLib[
"fog"
],
THREE.UniformsLib[
"lights"
],
THREE.UniformsLib[
'common'
],
THREE.UniformsLib[
'aomap'
],
THREE.UniformsLib[
'lightmap'
],
THREE.UniformsLib[
'emissivemap'
],
THREE.UniformsLib[
'fog'
],
THREE.UniformsLib[
'lights'
],
{
"emissive" : { type: "c", value: new THREE.Color( 0x000000 ) }
...
...
@@ -24207,8 +24207,8 @@ THREE.ShaderLib = {
] ),
vertexShader: THREE.ShaderChunk[
'meshlambert_vert'
],
fragmentShader: THREE.ShaderChunk[
'meshlambert_frag'
]
vertexShader: THREE.ShaderChunk[
'meshlambert_vert'
],
fragmentShader: THREE.ShaderChunk[
'meshlambert_frag'
]
},
...
...
@@ -24216,15 +24216,15 @@ THREE.ShaderLib = {
uniforms: THREE.UniformsUtils.merge( [
THREE.UniformsLib[
"common"
],
THREE.UniformsLib[
"aomap"
],
THREE.UniformsLib[
"lightmap"
],
THREE.UniformsLib[
"emissivemap"
],
THREE.UniformsLib[
"bumpmap"
],
THREE.UniformsLib[
"normalmap"
],
THREE.UniformsLib[
"displacementmap"
],
THREE.UniformsLib[
"fog"
],
THREE.UniformsLib[
"lights"
],
THREE.UniformsLib[
'common'
],
THREE.UniformsLib[
'aomap'
],
THREE.UniformsLib[
'lightmap'
],
THREE.UniformsLib[
'emissivemap'
],
THREE.UniformsLib[
'bumpmap'
],
THREE.UniformsLib[
'normalmap'
],
THREE.UniformsLib[
'displacementmap'
],
THREE.UniformsLib[
'fog'
],
THREE.UniformsLib[
'lights'
],
{
"emissive" : { type: "c", value: new THREE.Color( 0x000000 ) },
...
...
@@ -24234,8 +24234,8 @@ THREE.ShaderLib = {
] ),
vertexShader: THREE.ShaderChunk[
'meshphong_vert'
],
fragmentShader: THREE.ShaderChunk[
'meshphong_frag'
]
vertexShader: THREE.ShaderChunk[
'meshphong_vert'
],
fragmentShader: THREE.ShaderChunk[
'meshphong_frag'
]
},
...
...
@@ -24243,17 +24243,17 @@ THREE.ShaderLib = {
uniforms: THREE.UniformsUtils.merge( [
THREE.UniformsLib[
"common"
],
THREE.UniformsLib[
"aomap"
],
THREE.UniformsLib[
"lightmap"
],
THREE.UniformsLib[
"emissivemap"
],
THREE.UniformsLib[
"bumpmap"
],
THREE.UniformsLib[
"normalmap"
],
THREE.UniformsLib[
"displacementmap"
],
THREE.UniformsLib[
"roughnessmap"
],
THREE.UniformsLib[
"metalnessmap"
],
THREE.UniformsLib[
"fog"
],
THREE.UniformsLib[
"lights"
],
THREE.UniformsLib[
'common'
],
THREE.UniformsLib[
'aomap'
],
THREE.UniformsLib[
'lightmap'
],
THREE.UniformsLib[
'emissivemap'
],
THREE.UniformsLib[
'bumpmap'
],
THREE.UniformsLib[
'normalmap'
],
THREE.UniformsLib[
'displacementmap'
],
THREE.UniformsLib[
'roughnessmap'
],
THREE.UniformsLib[
'metalnessmap'
],
THREE.UniformsLib[
'fog'
],
THREE.UniformsLib[
'lights'
],
{
"emissive" : { type: "c", value: new THREE.Color( 0x000000 ) },
...
...
@@ -24264,8 +24264,8 @@ THREE.ShaderLib = {
] ),
vertexShader: THREE.ShaderChunk[
'meshstandard_vert'
],
fragmentShader: THREE.ShaderChunk[
'meshstandard_frag'
]
vertexShader: THREE.ShaderChunk[
'meshstandard_vert'
],
fragmentShader: THREE.ShaderChunk[
'meshstandard_frag'
]
},
...
...
@@ -24273,13 +24273,13 @@ THREE.ShaderLib = {
uniforms: THREE.UniformsUtils.merge( [
THREE.UniformsLib[
"points"
],
THREE.UniformsLib[
"fog"
]
THREE.UniformsLib[
'points'
],
THREE.UniformsLib[
'fog'
]
] ),
vertexShader: THREE.ShaderChunk[
'points_vert'
],
fragmentShader: THREE.ShaderChunk[
'points_frag'
]
vertexShader: THREE.ShaderChunk[
'points_vert'
],
fragmentShader: THREE.ShaderChunk[
'points_frag'
]
},
...
...
@@ -24287,8 +24287,8 @@ THREE.ShaderLib = {
uniforms: THREE.UniformsUtils.merge( [
THREE.UniformsLib[
"common"
],
THREE.UniformsLib[
"fog"
],
THREE.UniformsLib[
'common'
],
THREE.UniformsLib[
'fog'
],
{
"scale" : { type: "1f", value: 1 },
...
...
@@ -24298,8 +24298,8 @@ THREE.ShaderLib = {
] ),
vertexShader: THREE.ShaderChunk[
'linedashed_vert'
],
fragmentShader: THREE.ShaderChunk[
'linedashed_frag'
]
vertexShader: THREE.ShaderChunk[
'linedashed_vert'
],
fragmentShader: THREE.ShaderChunk[
'linedashed_frag'
]
},
...
...
@@ -24313,8 +24313,8 @@ THREE.ShaderLib = {
},
vertexShader: THREE.ShaderChunk[
'depth_vert'
],
fragmentShader: THREE.ShaderChunk[
'depth_frag'
]
vertexShader: THREE.ShaderChunk[
'depth_vert'
],
fragmentShader: THREE.ShaderChunk[
'depth_frag'
]
},
...
...
@@ -24326,8 +24326,8 @@ THREE.ShaderLib = {
},
vertexShader: THREE.ShaderChunk[
'normal_vert'
],
fragmentShader: THREE.ShaderChunk[
'normal_frag'
]
vertexShader: THREE.ShaderChunk[
'normal_vert'
],
fragmentShader: THREE.ShaderChunk[
'normal_frag'
]
},
...
...
@@ -24342,8 +24342,8 @@ THREE.ShaderLib = {
"tFlip": { type: "1f", value: - 1 }
},
vertexShader: THREE.ShaderChunk[
'cube_vert'
],
fragmentShader: THREE.ShaderChunk[
'cube_frag'
]
vertexShader: THREE.ShaderChunk[
'cube_vert'
],
fragmentShader: THREE.ShaderChunk[
'cube_frag'
]
},
...
...
@@ -24358,8 +24358,8 @@ THREE.ShaderLib = {
"tFlip": { type: "1f", value: - 1 }
},
vertexShader: THREE.ShaderChunk[
'equirect_vert'
],
fragmentShader: THREE.ShaderChunk[
'equirect_frag'
]
vertexShader: THREE.ShaderChunk[
'equirect_vert'
],
fragmentShader: THREE.ShaderChunk[
'equirect_frag'
]
},
...
...
@@ -24379,8 +24379,8 @@ THREE.ShaderLib = {
uniforms: {},
vertexShader: THREE.ShaderChunk[
'depthRGBA_vert'
],
fragmentShader: THREE.ShaderChunk[
'depthRGBA_frag'
]
vertexShader: THREE.ShaderChunk[
'depthRGBA_vert'
],
fragmentShader: THREE.ShaderChunk[
'depthRGBA_frag'
]
},
...
...
@@ -24389,12 +24389,12 @@ THREE.ShaderLib = {
uniforms: {
"lightPos": { type: "v3", value: new THREE.Vector3(
0, 0, 0
) }
"lightPos": { type: "v3", value: new THREE.Vector3() }
},
vertexShader: THREE.ShaderChunk[
'distanceRGBA_vert'
],
fragmentShader: THREE.ShaderChunk[
'distanceRGBA_frag'
]
vertexShader: THREE.ShaderChunk[
'distanceRGBA_vert'
],
fragmentShader: THREE.ShaderChunk[
'distanceRGBA_frag'
]
}
...
...
@@ -26692,14 +26692,34 @@ THREE.WebGLRenderer = function ( parameters ) {
} else if ( type === 'i' ) {
console.warn( 'THREE.WebGLRenderer: Uniform "i" is now "1i".' );
//
console.warn( 'THREE.WebGLRenderer: Uniform "i" is now "1i".' );
_gl.uniform1i( location, value );
} else if ( type === 'f' ) {
console.warn( 'THREE.WebGLRenderer: Uniform "f" is now "1f".' );
//
console.warn( 'THREE.WebGLRenderer: Uniform "f" is now "1f".' );
_gl.uniform1f( location, value );
} else if ( type === 'iv1' ) {
// console.warn( 'THREE.WebGLRenderer: Uniform "iv1" is now "1iv".' );
_gl.uniform1iv( location, value );
} else if ( type === 'iv' ) {
// console.warn( 'THREE.WebGLRenderer: Uniform "iv" is now "3iv".' );
_gl.uniform3iv( location, value );
} else if ( type === 'fv1' ) {
// console.warn( 'THREE.WebGLRenderer: Uniform "fv1" is now "1fv".' );
_gl.uniform1fv( location, value );
} else if ( type === 'fv' ) {
// console.warn( 'THREE.WebGLRenderer: Uniform "fv" is now "3fv".' );
_gl.uniform3fv( location, value );
} else if ( type === 'v2' ) {
// single THREE.Vector2
...
...
@@ -26756,26 +26776,6 @@ THREE.WebGLRenderer = function ( parameters ) {
}
} else if ( type === 'iv1' ) {
console.warn( 'THREE.WebGLRenderer: Uniform "iv1" is now "1iv".' );
_gl.uniform1iv( location, value );
} else if ( type === 'iv' ) {
console.warn( 'THREE.WebGLRenderer: Uniform "iv" is now "3iv".' );
_gl.uniform3iv( location, value );
} else if ( type === 'fv1' ) {
console.warn( 'THREE.WebGLRenderer: Uniform "fv1" is now "1fv".' );
_gl.uniform1fv( location, value );
} else if ( type === 'fv' ) {
console.warn( 'THREE.WebGLRenderer: Uniform "fv" is now "3fv".' );
_gl.uniform3fv( location, value );
} else if ( type === 'v2v' ) {
// array of THREE.Vector2
...
...
@@ -31056,8 +31056,7 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
var state = renderer.state;
var vertexBuffer, elementBuffer;
var program, attributes, uniforms;
var hasVertexTexture;
var shader, program, attributes, uniforms;
var tempTexture, occlusionTexture;
...
...
@@ -31105,12 +31104,6 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST );
gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST );
hasVertexTexture = gl.getParameter( gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS ) > 0;
var shader;
if ( hasVertexTexture ) {
shader = {
vertexShader: [
...
...
@@ -31205,94 +31198,6 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
};
} else {
shader = {
vertexShader: [
"uniform lowp int renderType;",
"uniform vec3 screenPosition;",
"uniform vec2 scale;",
"uniform float rotation;",
"attribute vec2 position;",
"attribute vec2 uv;",
"varying vec2 vUV;",
"void main() {",
"vUV = uv;",
"vec2 pos = position;",
"if ( renderType == 2 ) {",
"pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;",
"pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;",
"}",
"gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );",
"}"
].join( "\n" ),
fragmentShader: [
"precision mediump float;",
"uniform lowp int renderType;",
"uniform sampler2D map;",
"uniform sampler2D occlusionMap;",
"uniform float opacity;",
"uniform vec3 color;",
"varying vec2 vUV;",
"void main() {",
// pink square
"if ( renderType == 0 ) {",
"gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );",
// restore
"} else if ( renderType == 1 ) {",
"gl_FragColor = texture2D( map, vUV );",
// flare
"} else {",
"float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;",
"visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;",
"visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;",
"visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;",
"visibility = ( 1.0 - visibility / 4.0 );",
"vec4 texture = texture2D( map, vUV );",
"texture.a *= opacity * visibility;",
"gl_FragColor = texture;",
"gl_FragColor.rgb *= color;",
"}",
"}"
].join( "\n" )
};
}
program = createProgram( shader );
attributes = {
...
...
@@ -31335,7 +31240,10 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
var screenPosition = new THREE.Vector3( 1, 1, 0 ),
screenPositionPixels = new THREE.Vector2( 1, 1 );
var areaToCopy = new THREE.Vector2();
var validArea = new THREE.Box2();
validArea.min.set( 0, 0 );
validArea.max.set( viewport.z - 16, viewport.w - 16 );
if ( program === undefined ) {
...
...
@@ -31383,18 +31291,14 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
screenPosition.copy( tempPosition );
screenPositionPixels.x = screenPosition.x * halfViewportWidth + halfViewportWidth;
screenPositionPixels.y = screenPosition.y * halfViewportHeight + halfViewportHeight;
// horizontal and vertical coordinate of the lower left corner of the pixels to copy
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
screenPositionPixels.x = viewport.x + ( screenPosition.x * halfViewportWidth ) + halfViewportWidth - 8;
screenPositionPixels.y = viewport.y + ( screenPosition.y * halfViewportHeight ) + halfViewportHeight - 8;
// screen cull
if ( areaToCopy.x > 0 &&
areaToCopy.x < ( viewport.z - 16 ) &&
areaToCopy.y > 0 &&
areaToCopy.y < ( viewport.w - 16 ) ) {
if ( validArea.containsPoint( screenPositionPixels ) === true ) {
// save current RGB to temp texture
...
...
@@ -31402,7 +31306,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,
areaToCopy.x, areaToCopy
.y, 16, 16, 0 );
gl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGB,
screenPositionPixels.x, screenPositionPixels
.y, 16, 16, 0 );
// render pink quad
...
...
@@ -31421,7 +31325,7 @@ THREE.LensFlarePlugin = function ( renderer, flares ) {
state.activeTexture( gl.TEXTURE0 );
state.bindTexture( gl.TEXTURE_2D, occlusionTexture );
gl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGBA,
areaToCopy.x, areaToCopy
.y, 16, 16, 0 );
gl.copyTexImage2D( gl.TEXTURE_2D, 0, gl.RGBA,
screenPositionPixels.x, screenPositionPixels
.y, 16, 16, 0 );
// restore graphics
...
...
build/three.min.js
浏览文件 @
c886b840
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录