Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
b91aebff
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,发现更多精彩内容 >>
提交
b91aebff
编写于
10月 10, 2019
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds
上级
d73a18af
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
226 addition
and
155 deletion
+226
-155
build/three.js
build/three.js
+41
-6
build/three.min.js
build/three.min.js
+144
-143
build/three.module.js
build/three.module.js
+41
-6
未找到文件。
build/three.js
浏览文件 @
b91aebff
...
...
@@ -14276,7 +14276,7 @@
var shadow_vert = "#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
var sprite_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <
fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <
map_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}";
var sprite_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <
alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alpha
map_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}";
var sprite_vert = "uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";
...
...
@@ -14598,6 +14598,7 @@
center: { value: new Vector2( 0.5, 0.5 ) },
rotation: { value: 0.0 },
map: { value: null },
alphaMap: { value: null },
uvTransform: { value: new Matrix3() }
}
...
...
@@ -25595,17 +25596,44 @@
uniforms.diffuse.value.copy( material.color );
uniforms.opacity.value = material.opacity;
uniforms.rotation.value = material.rotation;
uniforms.map.value = material.map;
if ( material.map
!== null
) {
if ( material.map ) {
if ( material.map.matrixAutoUpdate === true ) {
uniforms.map.value = material.map;
material.map.updateMatrix();
}
if ( material.alphaMap ) {
uniforms.alphaMap.value = material.alphaMap;
}
// uv repeat and offset setting priorities
// 1. color map
// 2. alpha map
var uvScaleMap;
if ( material.map ) {
uvScaleMap = material.map;
} else if ( material.alphaMap ) {
uvScaleMap = material.alphaMap;
}
if ( uvScaleMap !== undefined ) {
if ( uvScaleMap.matrixAutoUpdate === true ) {
uvScaleMap.updateMatrix();
}
uniforms.uvTransform.value.copy(
material.m
ap.matrix );
uniforms.uvTransform.value.copy(
uvScaleM
ap.matrix );
}
...
...
@@ -26408,6 +26436,7 @@
* parameters = {
* color: <hex>,
* map: new THREE.Texture( <Image> ),
* alphaMap: new THREE.Texture( <Image> ),
* rotation: <float>,
* sizeAttenuation: <bool>
* }
...
...
@@ -26420,8 +26449,11 @@
this.type = 'SpriteMaterial';
this.color = new Color( 0xffffff );
this.map = null;
this.alphaMap = null;
this.rotation = 0;
this.sizeAttenuation = true;
...
...
@@ -26441,8 +26473,11 @@
Material.prototype.copy.call( this, source );
this.color.copy( source.color );
this.map = source.map;
this.alphaMap = source.alphaMap;
this.rotation = source.rotation;
this.sizeAttenuation = source.sizeAttenuation;
build/three.min.js
浏览文件 @
b91aebff
此差异已折叠。
点击以展开。
build/three.module.js
浏览文件 @
b91aebff
...
...
@@ -14262,7 +14262,7 @@ var shadow_frag = "uniform vec3 color;\nuniform float opacity;\n#include <common
var shadow_vert = "#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
var sprite_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <
fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <
map_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}";
var sprite_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <
alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alpha
map_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}";
var sprite_vert = "uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";
...
...
@@ -14584,6 +14584,7 @@ var UniformsLib = {
center: { value: new Vector2( 0.5, 0.5 ) },
rotation: { value: 0.0 },
map: { value: null },
alphaMap: { value: null },
uvTransform: { value: new Matrix3() }
}
...
...
@@ -25582,17 +25583,44 @@ function WebGLRenderer( parameters ) {
uniforms.diffuse.value.copy( material.color );
uniforms.opacity.value = material.opacity;
uniforms.rotation.value = material.rotation;
uniforms.map.value = material.map;
if ( material.map
!== null
) {
if ( material.map ) {
if ( material.map.matrixAutoUpdate === true ) {
uniforms.map.value = material.map;
material.map.updateMatrix();
}
if ( material.alphaMap ) {
uniforms.alphaMap.value = material.alphaMap;
}
// uv repeat and offset setting priorities
// 1. color map
// 2. alpha map
var uvScaleMap;
if ( material.map ) {
uvScaleMap = material.map;
} else if ( material.alphaMap ) {
uvScaleMap = material.alphaMap;
}
if ( uvScaleMap !== undefined ) {
if ( uvScaleMap.matrixAutoUpdate === true ) {
uvScaleMap.updateMatrix();
}
uniforms.uvTransform.value.copy(
material.m
ap.matrix );
uniforms.uvTransform.value.copy(
uvScaleM
ap.matrix );
}
...
...
@@ -26395,6 +26423,7 @@ Object.assign( InterleavedBufferAttribute.prototype, {
* parameters = {
* color: <hex>,
* map: new THREE.Texture( <Image> ),
* alphaMap: new THREE.Texture( <Image> ),
* rotation: <float>,
* sizeAttenuation: <bool>
* }
...
...
@@ -26407,8 +26436,11 @@ function SpriteMaterial( parameters ) {
this.type = 'SpriteMaterial';
this.color = new Color( 0xffffff );
this.map = null;
this.alphaMap = null;
this.rotation = 0;
this.sizeAttenuation = true;
...
...
@@ -26428,8 +26460,11 @@ SpriteMaterial.prototype.copy = function ( source ) {
Material.prototype.copy.call( this, source );
this.color.copy( source.color );
this.map = source.map;
this.alphaMap = source.alphaMap;
this.rotation = source.rotation;
this.sizeAttenuation = source.sizeAttenuation;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录