Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
5d1b8810
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(gitcode.net)2024年7月9日维护升级公告
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
5d1b8810
编写于
7月 28, 2017
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
f0e111b2
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
1006 addition
and
973 deletion
+1006
-973
build/three.js
build/three.js
+167
-150
build/three.min.js
build/three.min.js
+672
-672
build/three.module.js
build/three.module.js
+167
-151
未找到文件。
build/three.js
浏览文件 @
5d1b8810
...
...
@@ -18420,7 +18420,7 @@
* @author mrdoob / http://mrdoob.com/
*/
function WebGLTextures( _gl, extensions, state, properties, capabilities,
paramThreeToGL
, infoMemory ) {
function WebGLTextures( _gl, extensions, state, properties, capabilities,
utils
, infoMemory ) {
var _isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && _gl instanceof WebGL2RenderingContext );
...
...
@@ -18679,8 +18679,8 @@
var image = cubeImage[ 0 ],
isPowerOfTwoImage = isPowerOfTwo( image ),
glFormat =
paramThreeToGL
( texture.format ),
glType =
paramThreeToGL
( texture.type );
glFormat =
utils.convert
( texture.format ),
glType =
utils.convert
( texture.type );
setTextureParameters( _gl.TEXTURE_CUBE_MAP, texture, isPowerOfTwoImage );
...
...
@@ -18764,11 +18764,11 @@
if ( isPowerOfTwoImage ) {
_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S,
paramThreeToGL
( texture.wrapS ) );
_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T,
paramThreeToGL
( texture.wrapT ) );
_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S,
utils.convert
( texture.wrapS ) );
_gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T,
utils.convert
( texture.wrapT ) );
_gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER,
paramThreeToGL
( texture.magFilter ) );
_gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER,
paramThreeToGL
( texture.minFilter ) );
_gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER,
utils.convert
( texture.magFilter ) );
_gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER,
utils.convert
( texture.minFilter ) );
} else {
...
...
@@ -18840,8 +18840,8 @@
}
var isPowerOfTwoImage = isPowerOfTwo( image ),
glFormat =
paramThreeToGL
( texture.format ),
glType =
paramThreeToGL
( texture.type );
glFormat =
utils.convert
( texture.format ),
glType =
utils.convert
( texture.type );
setTextureParameters( _gl.TEXTURE_2D, texture, isPowerOfTwoImage );
...
...
@@ -18875,7 +18875,7 @@
console.warn( 'THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.' );
texture.type = UnsignedShortType;
glType =
paramThreeToGL
( texture.type );
glType =
utils.convert
( texture.type );
}
...
...
@@ -18895,7 +18895,7 @@
console.warn( 'THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.' );
texture.type = UnsignedInt248Type;
glType =
paramThreeToGL
( texture.type );
glType =
utils.convert
( texture.type );
}
...
...
@@ -18992,8 +18992,8 @@
// Setup storage for target texture and bind it to correct framebuffer
function setupFrameBufferTexture( framebuffer, renderTarget, attachment, textureTarget ) {
var glFormat =
paramThreeToGL
( renderTarget.texture.format );
var glType =
paramThreeToGL
( renderTarget.texture.type );
var glFormat =
utils.convert
( renderTarget.texture.format );
var glType =
utils.convert
( renderTarget.texture.type );
state.texImage2D( textureTarget, 0, glFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null );
_gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );
_gl.framebufferTexture2D( _gl.FRAMEBUFFER, attachment, textureTarget, properties.get( renderTarget.texture ).__webglTexture, 0 );
...
...
@@ -19255,7 +19255,7 @@
* @author mrdoob / http://mrdoob.com/
*/
function WebGLState( gl, extensions,
paramThreeToGL
) {
function WebGLState( gl, extensions,
utils
) {
function ColorBuffer() {
...
...
@@ -19873,7 +19873,7 @@
if ( blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha ) {
gl.blendEquationSeparate(
paramThreeToGL( blendEquation ), paramThreeToGL
( blendEquationAlpha ) );
gl.blendEquationSeparate(
utils.convert( blendEquation ), utils.convert
( blendEquationAlpha ) );
currentBlendEquation = blendEquation;
currentBlendEquationAlpha = blendEquationAlpha;
...
...
@@ -19882,7 +19882,7 @@
if ( blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha ) {
gl.blendFuncSeparate(
paramThreeToGL( blendSrc ), paramThreeToGL( blendDst ), paramThreeToGL( blendSrcAlpha ), paramThreeToGL
( blendDstAlpha ) );
gl.blendFuncSeparate(
utils.convert( blendSrc ), utils.convert( blendDst ), utils.convert( blendSrcAlpha ), utils.convert
( blendDstAlpha ) );
currentBlendSrc = blendSrc;
currentBlendDst = blendDst;
...
...
@@ -20773,6 +20773,142 @@
}
/**
* @author thespite / http://www.twitter.com/thespite
*/
function WebGLUtils ( gl, extensions ) {
function convert ( p ) {
var extension;
if ( p === RepeatWrapping ) return gl.REPEAT;
if ( p === ClampToEdgeWrapping ) return gl.CLAMP_TO_EDGE;
if ( p === MirroredRepeatWrapping ) return gl.MIRRORED_REPEAT;
if ( p === NearestFilter ) return gl.NEAREST;
if ( p === NearestMipMapNearestFilter ) return gl.NEAREST_MIPMAP_NEAREST;
if ( p === NearestMipMapLinearFilter ) return gl.NEAREST_MIPMAP_LINEAR;
if ( p === LinearFilter ) return gl.LINEAR;
if ( p === LinearMipMapNearestFilter ) return gl.LINEAR_MIPMAP_NEAREST;
if ( p === LinearMipMapLinearFilter ) return gl.LINEAR_MIPMAP_LINEAR;
if ( p === UnsignedByteType ) return gl.UNSIGNED_BYTE;
if ( p === UnsignedShort4444Type ) return gl.UNSIGNED_SHORT_4_4_4_4;
if ( p === UnsignedShort5551Type ) return gl.UNSIGNED_SHORT_5_5_5_1;
if ( p === UnsignedShort565Type ) return gl.UNSIGNED_SHORT_5_6_5;
if ( p === ByteType ) return gl.BYTE;
if ( p === ShortType ) return gl.SHORT;
if ( p === UnsignedShortType ) return gl.UNSIGNED_SHORT;
if ( p === IntType ) return gl.INT;
if ( p === UnsignedIntType ) return gl.UNSIGNED_INT;
if ( p === FloatType ) return gl.FLOAT;
if ( p === HalfFloatType ) {
extension = extensions.get( 'OES_texture_half_float' );
if ( extension !== null ) return extension.HALF_FLOAT_OES;
}
if ( p === AlphaFormat ) return gl.ALPHA;
if ( p === RGBFormat ) return gl.RGB;
if ( p === RGBAFormat ) return gl.RGBA;
if ( p === LuminanceFormat ) return gl.LUMINANCE;
if ( p === LuminanceAlphaFormat ) return gl.LUMINANCE_ALPHA;
if ( p === DepthFormat ) return gl.DEPTH_COMPONENT;
if ( p === DepthStencilFormat ) return gl.DEPTH_STENCIL;
if ( p === AddEquation ) return gl.FUNC_ADD;
if ( p === SubtractEquation ) return gl.FUNC_SUBTRACT;
if ( p === ReverseSubtractEquation ) return gl.FUNC_REVERSE_SUBTRACT;
if ( p === ZeroFactor ) return gl.ZERO;
if ( p === OneFactor ) return gl.ONE;
if ( p === SrcColorFactor ) return gl.SRC_COLOR;
if ( p === OneMinusSrcColorFactor ) return gl.ONE_MINUS_SRC_COLOR;
if ( p === SrcAlphaFactor ) return gl.SRC_ALPHA;
if ( p === OneMinusSrcAlphaFactor ) return gl.ONE_MINUS_SRC_ALPHA;
if ( p === DstAlphaFactor ) return gl.DST_ALPHA;
if ( p === OneMinusDstAlphaFactor ) return gl.ONE_MINUS_DST_ALPHA;
if ( p === DstColorFactor ) return gl.DST_COLOR;
if ( p === OneMinusDstColorFactor ) return gl.ONE_MINUS_DST_COLOR;
if ( p === SrcAlphaSaturateFactor ) return gl.SRC_ALPHA_SATURATE;
if ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||
p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {
extension = extensions.get( 'WEBGL_compressed_texture_s3tc' );
if ( extension !== null ) {
if ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;
if ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;
if ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;
if ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;
}
}
if ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||
p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {
extension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );
if ( extension !== null ) {
if ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
if ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
if ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
if ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
}
}
if ( p === RGB_ETC1_Format ) {
extension = extensions.get( 'WEBGL_compressed_texture_etc1' );
if ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;
}
if ( p === MinEquation || p === MaxEquation ) {
extension = extensions.get( 'EXT_blend_minmax' );
if ( extension !== null ) {
if ( p === MinEquation ) return extension.MIN_EXT;
if ( p === MaxEquation ) return extension.MAX_EXT;
}
}
if ( p === UnsignedInt248Type ) {
extension = extensions.get( 'WEBGL_depth_texture' );
if ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;
}
return 0;
}
return { convert: convert }
}
// import { Sphere } from '../math/Sphere';
/**
* @author supereggbert / http://www.paulbrunt.co.uk/
...
...
@@ -20989,6 +21125,8 @@
var background, morphtargets, bufferRenderer, indexedBufferRenderer;
var flareRenderer, spriteRenderer;
var utils;
function initGLContext() {
extensions = new WebGLExtensions( _gl );
...
...
@@ -21006,14 +21144,16 @@
}
utils = new WebGLUtils( _gl, extensions );
capabilities = new WebGLCapabilities( _gl, extensions, parameters );
state = new WebGLState( _gl, extensions,
paramThreeToGL
);
state = new WebGLState( _gl, extensions,
utils
);
state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ) );
state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ) );
properties = new WebGLProperties();
textures = new WebGLTextures( _gl, extensions, state, properties, capabilities,
paramThreeToGL
, _infoMemory );
textures = new WebGLTextures( _gl, extensions, state, properties, capabilities,
utils
, _infoMemory );
attributes = new WebGLAttributes( _gl );
geometries = new WebGLGeometries( _gl, attributes, _infoMemory );
objects = new WebGLObjects( geometries, _infoRender );
...
...
@@ -23180,14 +23320,14 @@
var textureFormat = texture.format;
var textureType = texture.type;
if ( textureFormat !== RGBAFormat &&
paramThreeToGL
( textureFormat ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) {
if ( textureFormat !== RGBAFormat &&
utils.convert
( textureFormat ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_FORMAT ) ) {
console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' );
return;
}
if ( textureType !== UnsignedByteType &&
paramThreeToGL
( textureType ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE ) && // IE11, Edge and Chrome Mac < 52 (#9513)
if ( textureType !== UnsignedByteType &&
utils.convert
( textureType ) !== _gl.getParameter( _gl.IMPLEMENTATION_COLOR_READ_TYPE ) && // IE11, Edge and Chrome Mac < 52 (#9513)
! ( textureType === FloatType && ( extensions.get( 'OES_texture_float' ) || extensions.get( 'WEBGL_color_buffer_float' ) ) ) && // Chrome Mac >= 52 and Firefox
! ( textureType === HalfFloatType && extensions.get( 'EXT_color_buffer_half_float' ) ) ) {
...
...
@@ -23202,7 +23342,7 @@
if ( ( x >= 0 && x <= ( renderTarget.width - width ) ) && ( y >= 0 && y <= ( renderTarget.height - height ) ) ) {
_gl.readPixels( x, y, width, height,
paramThreeToGL( textureFormat ), paramThreeToGL
( textureType ), buffer );
_gl.readPixels( x, y, width, height,
utils.convert( textureFormat ), utils.convert
( textureType ), buffer );
}
...
...
@@ -23226,134 +23366,6 @@
};
// Map three.js constants to WebGL constants
function paramThreeToGL( p ) {
var extension;
if ( p === RepeatWrapping ) return _gl.REPEAT;
if ( p === ClampToEdgeWrapping ) return _gl.CLAMP_TO_EDGE;
if ( p === MirroredRepeatWrapping ) return _gl.MIRRORED_REPEAT;
if ( p === NearestFilter ) return _gl.NEAREST;
if ( p === NearestMipMapNearestFilter ) return _gl.NEAREST_MIPMAP_NEAREST;
if ( p === NearestMipMapLinearFilter ) return _gl.NEAREST_MIPMAP_LINEAR;
if ( p === LinearFilter ) return _gl.LINEAR;
if ( p === LinearMipMapNearestFilter ) return _gl.LINEAR_MIPMAP_NEAREST;
if ( p === LinearMipMapLinearFilter ) return _gl.LINEAR_MIPMAP_LINEAR;
if ( p === UnsignedByteType ) return _gl.UNSIGNED_BYTE;
if ( p === UnsignedShort4444Type ) return _gl.UNSIGNED_SHORT_4_4_4_4;
if ( p === UnsignedShort5551Type ) return _gl.UNSIGNED_SHORT_5_5_5_1;
if ( p === UnsignedShort565Type ) return _gl.UNSIGNED_SHORT_5_6_5;
if ( p === ByteType ) return _gl.BYTE;
if ( p === ShortType ) return _gl.SHORT;
if ( p === UnsignedShortType ) return _gl.UNSIGNED_SHORT;
if ( p === IntType ) return _gl.INT;
if ( p === UnsignedIntType ) return _gl.UNSIGNED_INT;
if ( p === FloatType ) return _gl.FLOAT;
if ( p === HalfFloatType ) {
extension = extensions.get( 'OES_texture_half_float' );
if ( extension !== null ) return extension.HALF_FLOAT_OES;
}
if ( p === AlphaFormat ) return _gl.ALPHA;
if ( p === RGBFormat ) return _gl.RGB;
if ( p === RGBAFormat ) return _gl.RGBA;
if ( p === LuminanceFormat ) return _gl.LUMINANCE;
if ( p === LuminanceAlphaFormat ) return _gl.LUMINANCE_ALPHA;
if ( p === DepthFormat ) return _gl.DEPTH_COMPONENT;
if ( p === DepthStencilFormat ) return _gl.DEPTH_STENCIL;
if ( p === AddEquation ) return _gl.FUNC_ADD;
if ( p === SubtractEquation ) return _gl.FUNC_SUBTRACT;
if ( p === ReverseSubtractEquation ) return _gl.FUNC_REVERSE_SUBTRACT;
if ( p === ZeroFactor ) return _gl.ZERO;
if ( p === OneFactor ) return _gl.ONE;
if ( p === SrcColorFactor ) return _gl.SRC_COLOR;
if ( p === OneMinusSrcColorFactor ) return _gl.ONE_MINUS_SRC_COLOR;
if ( p === SrcAlphaFactor ) return _gl.SRC_ALPHA;
if ( p === OneMinusSrcAlphaFactor ) return _gl.ONE_MINUS_SRC_ALPHA;
if ( p === DstAlphaFactor ) return _gl.DST_ALPHA;
if ( p === OneMinusDstAlphaFactor ) return _gl.ONE_MINUS_DST_ALPHA;
if ( p === DstColorFactor ) return _gl.DST_COLOR;
if ( p === OneMinusDstColorFactor ) return _gl.ONE_MINUS_DST_COLOR;
if ( p === SrcAlphaSaturateFactor ) return _gl.SRC_ALPHA_SATURATE;
if ( p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format ||
p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format ) {
extension = extensions.get( 'WEBGL_compressed_texture_s3tc' );
if ( extension !== null ) {
if ( p === RGB_S3TC_DXT1_Format ) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;
if ( p === RGBA_S3TC_DXT1_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;
if ( p === RGBA_S3TC_DXT3_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;
if ( p === RGBA_S3TC_DXT5_Format ) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;
}
}
if ( p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format ||
p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format ) {
extension = extensions.get( 'WEBGL_compressed_texture_pvrtc' );
if ( extension !== null ) {
if ( p === RGB_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
if ( p === RGB_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
if ( p === RGBA_PVRTC_4BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
if ( p === RGBA_PVRTC_2BPPV1_Format ) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
}
}
if ( p === RGB_ETC1_Format ) {
extension = extensions.get( 'WEBGL_compressed_texture_etc1' );
if ( extension !== null ) return extension.COMPRESSED_RGB_ETC1_WEBGL;
}
if ( p === MinEquation || p === MaxEquation ) {
extension = extensions.get( 'EXT_blend_minmax' );
if ( extension !== null ) {
if ( p === MinEquation ) return extension.MIN_EXT;
if ( p === MaxEquation ) return extension.MAX_EXT;
}
}
if ( p === UnsignedInt248Type ) {
extension = extensions.get( 'WEBGL_depth_texture' );
if ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL;
}
return 0;
}
}
/**
...
...
@@ -32863,7 +32875,7 @@
if ( json.fragmentShader !== undefined ) material.fragmentShader = json.fragmentShader;
if ( json.vertexColors !== undefined ) material.vertexColors = json.vertexColors;
if ( json.fog !== undefined ) material.fog = json.fog;
if ( json.
shading !== undefined ) material.shading = json.s
hading;
if ( json.
flatShading !== undefined ) material.flatShading = json.flatS
hading;
if ( json.blending !== undefined ) material.blending = json.blending;
if ( json.side !== undefined ) material.side = json.side;
if ( json.opacity !== undefined ) material.opacity = json.opacity;
...
...
@@ -32879,6 +32891,10 @@
if ( json.skinning !== undefined ) material.skinning = json.skinning;
if ( json.morphTargets !== undefined ) material.morphTargets = json.morphTargets;
// Deprecated
if ( json.shading !== undefined ) material.shading = json.shading;
// for PointsMaterial
if ( json.size !== undefined ) material.size = json.size;
...
...
@@ -43978,6 +43994,7 @@
exports.Curve = Curve;
exports.ShapeUtils = ShapeUtils;
exports.SceneUtils = SceneUtils;
exports.WebGLUtils = WebGLUtils;
exports.WireframeGeometry = WireframeGeometry;
exports.ParametricGeometry = ParametricGeometry;
exports.ParametricBufferGeometry = ParametricBufferGeometry;
...
...
build/three.min.js
浏览文件 @
5d1b8810
此差异已折叠。
点击以展开。
build/three.module.js
浏览文件 @
5d1b8810
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录