Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
17ccde90
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,体验更适合开发者的 AI 搜索 >>
提交
17ccde90
编写于
10月 18, 2019
作者:
M
Mugen87
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update builds.
上级
d769e95b
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
882 addition
and
695 deletion
+882
-695
build/three.js
build/three.js
+107
-14
build/three.min.js
build/three.min.js
+668
-667
build/three.module.js
build/three.module.js
+107
-14
未找到文件。
build/three.js
浏览文件 @
17ccde90
...
...
@@ -14142,9 +14142,9 @@
var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif";
var map_particle_fragment = "#if
def USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel )
;\n#endif";
var map_particle_fragment = "#if
defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g
;\n#endif";
var map_particle_pars_fragment = "#if
def USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D m
ap;\n#endif";
var map_particle_pars_fragment = "#if
defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaM
ap;\n#endif";
var metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif";
...
...
@@ -14587,6 +14587,7 @@
size: { value: 1.0 },
scale: { value: 1.0 },
map: { value: null },
alphaMap: { value: null },
uvTransform: { value: new Matrix3() }
},
...
...
@@ -20747,6 +20748,21 @@
}
function unbindTexture() {
var boundTexture = currentBoundTextures[ currentTextureSlot ];
if ( boundTexture !== undefined && boundTexture.type !== undefined ) {
gl.bindTexture( boundTexture.type, null );
boundTexture.type = undefined;
boundTexture.texture = undefined;
}
}
function compressedTexImage2D() {
try {
...
...
@@ -20879,6 +20895,7 @@
activeTexture: activeTexture,
bindTexture: bindTexture,
unbindTexture: unbindTexture,
compressedTexImage2D: compressedTexImage2D,
texImage2D: texImage2D,
texImage3D: texImage3D,
...
...
@@ -25575,17 +25592,43 @@
uniforms.size.value = material.size * _pixelRatio;
uniforms.scale.value = _height * 0.5;
uniforms.map.value = material.map;
if ( material.map ) {
uniforms.map.value = material.map;
}
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 ( material.map !== null ) {
}
if ( material.map.matrixAutoUpdate === true
) {
if ( uvScaleMap !== undefined
) {
material.map.updateMatrix();
if ( uvScaleMap.matrixAutoUpdate === true ) {
uvScaleMap.updateMatrix();
}
uniforms.uvTransform.value.copy(
material.m
ap.matrix );
uniforms.uvTransform.value.copy(
uvScaleM
ap.matrix );
}
...
...
@@ -26087,13 +26130,18 @@
this.copyFramebufferToTexture = function ( position, texture, level ) {
var width = texture.image.width;
var height = texture.image.height;
if ( level === undefined ) { level = 0; }
var levelScale = Math.pow( 2, - level );
var width = Math.floor( texture.image.width * levelScale );
var height = Math.floor( texture.image.height * levelScale );
var glFormat = utils.convert( texture.format );
textures.setTexture2D( texture, 0 );
_gl.copyTexImage2D( 3553, level || 0, glFormat, position.x, position.y, width, height, 0 );
_gl.copyTexImage2D( 3553, level, glFormat, position.x, position.y, width, height, 0 );
state.unbindTexture();
};
...
...
@@ -26116,6 +26164,16 @@
}
state.unbindTexture();
};
this.initTexture = function ( texture ) {
textures.setTexture2D( texture, 0 );
state.unbindTexture();
};
if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
...
...
@@ -27562,6 +27620,7 @@
* color: <hex>,
* opacity: <float>,
* map: new THREE.Texture( <Image> ),
* alphaMap: new THREE.Texture( <Image> ),
*
* size: <float>,
* sizeAttenuation: <bool>
...
...
@@ -27580,6 +27639,8 @@
this.map = null;
this.alphaMap = null;
this.size = 1;
this.sizeAttenuation = true;
...
...
@@ -27602,6 +27663,8 @@
this.map = source.map;
this.alphaMap = source.alphaMap;
this.size = source.size;
this.sizeAttenuation = source.sizeAttenuation;
...
...
@@ -28111,6 +28174,16 @@
ParametricGeometry.prototype = Object.create( Geometry.prototype );
ParametricGeometry.prototype.constructor = ParametricGeometry;
ParametricGeometry.prototype.toJSON = function () {
var data = Geometry.prototype.toJSON.call( this );
data.func = this.parameters.func.toString();
return data;
};
// ParametricBufferGeometry
function ParametricBufferGeometry( func, slices, stacks ) {
...
...
@@ -28237,6 +28310,16 @@
ParametricBufferGeometry.prototype = Object.create( BufferGeometry.prototype );
ParametricBufferGeometry.prototype.constructor = ParametricBufferGeometry;
ParametricBufferGeometry.prototype.toJSON = function () {
var data = BufferGeometry.prototype.toJSON.call( this );
data.func = this.parameters.func.toString();
return data;
};
/**
* @author clockworkgeek / https://github.com/clockworkgeek
* @author timothypratley / https://github.com/timothypratley
...
...
@@ -32394,7 +32477,6 @@
var Geometries = /*#__PURE__*/Object.freeze({
__proto__: null,
WireframeGeometry: WireframeGeometry,
ParametricGeometry: ParametricGeometry,
ParametricBufferGeometry: ParametricBufferGeometry,
...
...
@@ -33308,7 +33390,6 @@
var Materials = /*#__PURE__*/Object.freeze({
__proto__: null,
ShadowMaterial: ShadowMaterial,
SpriteMaterial: SpriteMaterial,
RawShaderMaterial: RawShaderMaterial,
...
...
@@ -37543,7 +37624,6 @@
var Curves = /*#__PURE__*/Object.freeze({
__proto__: null,
ArcCurve: ArcCurve,
CatmullRomCurve3: CatmullRomCurve3,
CubicBezierCurve: CubicBezierCurve,
...
...
@@ -39724,6 +39804,19 @@
break;
case 'ParametricGeometry':
case 'ParametricBufferGeometry':
var func = new Function( 'return ' + data.func )();
geometry = new Geometries[ data.type ](
func,
data.slices,
data.stacks
);
break;
case 'BufferGeometry':
case 'InstancedBufferGeometry':
...
...
@@ -45124,7 +45217,7 @@
* Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system
*
* The polar angle (phi) is measured from the positive y-axis. The positive y-axis is up.
* The azimuthal angle (theta) is measured from the positive z-axi
z
.
* The azimuthal angle (theta) is measured from the positive z-axi
s
.
*/
function Spherical( radius, phi, theta ) {
build/three.min.js
浏览文件 @
17ccde90
此差异已折叠。
点击以展开。
build/three.module.js
浏览文件 @
17ccde90
...
...
@@ -14128,9 +14128,9 @@ var map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n
var map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif";
var map_particle_fragment = "#if
def USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel )
;\n#endif";
var map_particle_fragment = "#if
defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g
;\n#endif";
var map_particle_pars_fragment = "#if
def USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D m
ap;\n#endif";
var map_particle_pars_fragment = "#if
defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaM
ap;\n#endif";
var metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif";
...
...
@@ -14573,6 +14573,7 @@ var UniformsLib = {
size: { value: 1.0 },
scale: { value: 1.0 },
map: { value: null },
alphaMap: { value: null },
uvTransform: { value: new Matrix3() }
},
...
...
@@ -20734,6 +20735,21 @@ function WebGLState( gl, extensions, utils, capabilities ) {
}
function unbindTexture() {
var boundTexture = currentBoundTextures[ currentTextureSlot ];
if ( boundTexture !== undefined && boundTexture.type !== undefined ) {
gl.bindTexture( boundTexture.type, null );
boundTexture.type = undefined;
boundTexture.texture = undefined;
}
}
function compressedTexImage2D() {
try {
...
...
@@ -20866,6 +20882,7 @@ function WebGLState( gl, extensions, utils, capabilities ) {
activeTexture: activeTexture,
bindTexture: bindTexture,
unbindTexture: unbindTexture,
compressedTexImage2D: compressedTexImage2D,
texImage2D: texImage2D,
texImage3D: texImage3D,
...
...
@@ -25562,17 +25579,43 @@ function WebGLRenderer( parameters ) {
uniforms.size.value = material.size * _pixelRatio;
uniforms.scale.value = _height * 0.5;
uniforms.map.value = material.map;
if ( material.map ) {
uniforms.map.value = material.map;
}
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 ( material.map !== null ) {
}
if ( material.map.matrixAutoUpdate === true
) {
if ( uvScaleMap !== undefined
) {
material.map.updateMatrix();
if ( uvScaleMap.matrixAutoUpdate === true ) {
uvScaleMap.updateMatrix();
}
uniforms.uvTransform.value.copy(
material.m
ap.matrix );
uniforms.uvTransform.value.copy(
uvScaleM
ap.matrix );
}
...
...
@@ -26074,13 +26117,18 @@ function WebGLRenderer( parameters ) {
this.copyFramebufferToTexture = function ( position, texture, level ) {
var width = texture.image.width;
var height = texture.image.height;
if ( level === undefined ) level = 0;
var levelScale = Math.pow( 2, - level );
var width = Math.floor( texture.image.width * levelScale );
var height = Math.floor( texture.image.height * levelScale );
var glFormat = utils.convert( texture.format );
textures.setTexture2D( texture, 0 );
_gl.copyTexImage2D( 3553, level || 0, glFormat, position.x, position.y, width, height, 0 );
_gl.copyTexImage2D( 3553, level, glFormat, position.x, position.y, width, height, 0 );
state.unbindTexture();
};
...
...
@@ -26103,6 +26151,16 @@ function WebGLRenderer( parameters ) {
}
state.unbindTexture();
};
this.initTexture = function ( texture ) {
textures.setTexture2D( texture, 0 );
state.unbindTexture();
};
if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
...
...
@@ -27549,6 +27607,7 @@ LineLoop.prototype = Object.assign( Object.create( Line.prototype ), {
* color: <hex>,
* opacity: <float>,
* map: new THREE.Texture( <Image> ),
* alphaMap: new THREE.Texture( <Image> ),
*
* size: <float>,
* sizeAttenuation: <bool>
...
...
@@ -27567,6 +27626,8 @@ function PointsMaterial( parameters ) {
this.map = null;
this.alphaMap = null;
this.size = 1;
this.sizeAttenuation = true;
...
...
@@ -27589,6 +27650,8 @@ PointsMaterial.prototype.copy = function ( source ) {
this.map = source.map;
this.alphaMap = source.alphaMap;
this.size = source.size;
this.sizeAttenuation = source.sizeAttenuation;
...
...
@@ -28098,6 +28161,16 @@ function ParametricGeometry( func, slices, stacks ) {
ParametricGeometry.prototype = Object.create( Geometry.prototype );
ParametricGeometry.prototype.constructor = ParametricGeometry;
ParametricGeometry.prototype.toJSON = function () {
var data = Geometry.prototype.toJSON.call( this );
data.func = this.parameters.func.toString();
return data;
};
// ParametricBufferGeometry
function ParametricBufferGeometry( func, slices, stacks ) {
...
...
@@ -28224,6 +28297,16 @@ function ParametricBufferGeometry( func, slices, stacks ) {
ParametricBufferGeometry.prototype = Object.create( BufferGeometry.prototype );
ParametricBufferGeometry.prototype.constructor = ParametricBufferGeometry;
ParametricBufferGeometry.prototype.toJSON = function () {
var data = BufferGeometry.prototype.toJSON.call( this );
data.func = this.parameters.func.toString();
return data;
};
/**
* @author clockworkgeek / https://github.com/clockworkgeek
* @author timothypratley / https://github.com/timothypratley
...
...
@@ -32381,7 +32464,6 @@ CircleBufferGeometry.prototype.constructor = CircleBufferGeometry;
var Geometries = /*#__PURE__*/Object.freeze({
__proto__: null,
WireframeGeometry: WireframeGeometry,
ParametricGeometry: ParametricGeometry,
ParametricBufferGeometry: ParametricBufferGeometry,
...
...
@@ -33295,7 +33377,6 @@ LineDashedMaterial.prototype.copy = function ( source ) {
var Materials = /*#__PURE__*/Object.freeze({
__proto__: null,
ShadowMaterial: ShadowMaterial,
SpriteMaterial: SpriteMaterial,
RawShaderMaterial: RawShaderMaterial,
...
...
@@ -37530,7 +37611,6 @@ SplineCurve.prototype.fromJSON = function ( json ) {
var Curves = /*#__PURE__*/Object.freeze({
__proto__: null,
ArcCurve: ArcCurve,
CatmullRomCurve3: CatmullRomCurve3,
CubicBezierCurve: CubicBezierCurve,
...
...
@@ -39711,6 +39791,19 @@ ObjectLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
break;
case 'ParametricGeometry':
case 'ParametricBufferGeometry':
var func = new Function( 'return ' + data.func )();
geometry = new Geometries[ data.type ](
func,
data.slices,
data.stacks
);
break;
case 'BufferGeometry':
case 'InstancedBufferGeometry':
...
...
@@ -45111,7 +45204,7 @@ Object.assign( Raycaster.prototype, {
* Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system
*
* The polar angle (phi) is measured from the positive y-axis. The positive y-axis is up.
* The azimuthal angle (theta) is measured from the positive z-axi
z
.
* The azimuthal angle (theta) is measured from the positive z-axi
s
.
*/
function Spherical( radius, phi, theta ) {
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录