Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
41665054
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,发现更多精彩内容 >>
未验证
提交
41665054
编写于
10月 21, 2019
作者:
M
Mr.doob
提交者:
GitHub
10月 21, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17783 from mrdoob/webgstate
WebGLState: Removed getCompressedTextureFormats method.
上级
dfc27bfa
6d35d8b5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
46 addition
and
44 deletion
+46
-44
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+1
-1
src/renderers/webgl/WebGLState.d.ts
src/renderers/webgl/WebGLState.d.ts
+1
-2
src/renderers/webgl/WebGLState.js
src/renderers/webgl/WebGLState.js
+1
-34
src/renderers/webgl/WebGLTextures.js
src/renderers/webgl/WebGLTextures.js
+2
-2
src/renderers/webgl/WebGLUtils.js
src/renderers/webgl/WebGLUtils.js
+41
-5
未找到文件。
src/renderers/WebGLRenderer.js
浏览文件 @
41665054
...
...
@@ -274,7 +274,7 @@ function WebGLRenderer( parameters ) {
utils
=
new
WebGLUtils
(
_gl
,
extensions
,
capabilities
);
state
=
new
WebGLState
(
_gl
,
extensions
,
utils
,
capabilities
);
state
=
new
WebGLState
(
_gl
,
extensions
,
capabilities
);
state
.
scissor
(
_currentScissor
.
copy
(
_scissor
).
multiplyScalar
(
_pixelRatio
).
floor
()
);
state
.
viewport
(
_currentViewport
.
copy
(
_viewport
).
multiplyScalar
(
_pixelRatio
).
floor
()
);
...
...
src/renderers/webgl/WebGLState.d.ts
浏览文件 @
41665054
...
...
@@ -44,7 +44,7 @@ export class WebGLStencilBuffer {
export
class
WebGLState
{
constructor
(
gl
:
WebGLRenderingContext
,
extensions
:
WebGLExtensions
,
utils
:
any
,
capabilities
:
WebGLCapabilities
);
constructor
(
gl
:
WebGLRenderingContext
,
extensions
:
WebGLExtensions
,
capabilities
:
WebGLCapabilities
);
buffers
:
{
color
:
WebGLColorBuffer
;
...
...
@@ -58,7 +58,6 @@ export class WebGLState {
disableUnusedAttributes
():
void
;
enable
(
id
:
number
):
void
;
disable
(
id
:
number
):
void
;
getCompressedTextureFormats
():
number
[];
useProgram
(
program
:
any
):
boolean
;
setBlending
(
blending
:
Blending
,
...
...
src/renderers/webgl/WebGLState.js
浏览文件 @
41665054
...
...
@@ -5,7 +5,7 @@
import
{
NotEqualDepth
,
GreaterDepth
,
GreaterEqualDepth
,
EqualDepth
,
LessEqualDepth
,
LessDepth
,
AlwaysDepth
,
NeverDepth
,
CullFaceFront
,
CullFaceBack
,
CullFaceNone
,
DoubleSide
,
BackSide
,
CustomBlending
,
MultiplyBlending
,
SubtractiveBlending
,
AdditiveBlending
,
NoBlending
,
NormalBlending
,
AddEquation
,
SubtractEquation
,
ReverseSubtractEquation
,
MinEquation
,
MaxEquation
,
ZeroFactor
,
OneFactor
,
SrcColorFactor
,
SrcAlphaFactor
,
SrcAlphaSaturateFactor
,
DstColorFactor
,
DstAlphaFactor
,
OneMinusSrcColorFactor
,
OneMinusSrcAlphaFactor
,
OneMinusDstColorFactor
,
OneMinusDstAlphaFactor
}
from
'
../../constants.js
'
;
import
{
Vector4
}
from
'
../../math/Vector4.js
'
;
function
WebGLState
(
gl
,
extensions
,
utils
,
capabilities
)
{
function
WebGLState
(
gl
,
extensions
,
capabilities
)
{
var
isWebGL2
=
capabilities
.
isWebGL2
;
...
...
@@ -325,8 +325,6 @@ function WebGLState( gl, extensions, utils, capabilities ) {
var
enabledCapabilities
=
{};
var
compressedTextureFormats
=
null
;
var
currentProgram
=
null
;
var
currentBlendingEnabled
=
null
;
...
...
@@ -486,33 +484,6 @@ function WebGLState( gl, extensions, utils, capabilities ) {
}
function
getCompressedTextureFormats
()
{
if
(
compressedTextureFormats
===
null
)
{
compressedTextureFormats
=
[];
if
(
extensions
.
get
(
'
WEBGL_compressed_texture_pvrtc
'
)
||
extensions
.
get
(
'
WEBGL_compressed_texture_s3tc
'
)
||
extensions
.
get
(
'
WEBGL_compressed_texture_etc1
'
)
||
extensions
.
get
(
'
WEBGL_compressed_texture_astc
'
)
)
{
var
formats
=
gl
.
getParameter
(
gl
.
COMPRESSED_TEXTURE_FORMATS
);
for
(
var
i
=
0
;
i
<
formats
.
length
;
i
++
)
{
compressedTextureFormats
.
push
(
formats
[
i
]
);
}
}
}
return
compressedTextureFormats
;
}
function
useProgram
(
program
)
{
if
(
currentProgram
!==
program
)
{
...
...
@@ -965,8 +936,6 @@ function WebGLState( gl, extensions, utils, capabilities ) {
enabledCapabilities
=
{};
compressedTextureFormats
=
null
;
currentTextureSlot
=
null
;
currentBoundTextures
=
{};
...
...
@@ -997,7 +966,6 @@ function WebGLState( gl, extensions, utils, capabilities ) {
disableUnusedAttributes
:
disableUnusedAttributes
,
enable
:
enable
,
disable
:
disable
,
getCompressedTextureFormats
:
getCompressedTextureFormats
,
useProgram
:
useProgram
,
...
...
@@ -1028,5 +996,4 @@ function WebGLState( gl, extensions, utils, capabilities ) {
}
export
{
WebGLState
};
src/renderers/webgl/WebGLTextures.js
浏览文件 @
41665054
...
...
@@ -434,7 +434,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
if
(
texture
.
format
!==
RGBAFormat
&&
texture
.
format
!==
RGBFormat
)
{
if
(
state
.
getCompressedTextureFormats
().
indexOf
(
glFormat
)
>
-
1
)
{
if
(
glFormat
!==
null
)
{
state
.
compressedTexImage2D
(
_gl
.
TEXTURE_CUBE_MAP_POSITIVE_X
+
i
,
j
,
glInternalFormat
,
mipmap
.
width
,
mipmap
.
height
,
0
,
mipmap
.
data
);
...
...
@@ -733,7 +733,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
if
(
texture
.
format
!==
RGBAFormat
&&
texture
.
format
!==
RGBFormat
)
{
if
(
state
.
getCompressedTextureFormats
().
indexOf
(
glFormat
)
>
-
1
)
{
if
(
glFormat
!==
null
)
{
state
.
compressedTexImage2D
(
_gl
.
TEXTURE_2D
,
i
,
glInternalFormat
,
mipmap
.
width
,
mipmap
.
height
,
0
,
mipmap
.
data
);
...
...
src/renderers/webgl/WebGLUtils.js
浏览文件 @
41665054
...
...
@@ -30,7 +30,15 @@ function WebGLUtils( gl, extensions, capabilities ) {
extension
=
extensions
.
get
(
'
OES_texture_half_float
'
);
if
(
extension
!==
null
)
return
extension
.
HALF_FLOAT_OES
;
if
(
extension
!==
null
)
{
return
extension
.
HALF_FLOAT_OES
;
}
else
{
return
null
;
}
}
...
...
@@ -55,6 +63,10 @@ function WebGLUtils( gl, extensions, capabilities ) {
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
;
}
else
{
return
null
;
}
}
...
...
@@ -71,6 +83,10 @@ function WebGLUtils( gl, extensions, capabilities ) {
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
;
}
else
{
return
null
;
}
}
...
...
@@ -79,7 +95,15 @@ function WebGLUtils( gl, extensions, capabilities ) {
extension
=
extensions
.
get
(
'
WEBGL_compressed_texture_etc1
'
);
if
(
extension
!==
null
)
return
extension
.
COMPRESSED_RGB_ETC1_WEBGL
;
if
(
extension
!==
null
)
{
return
extension
.
COMPRESSED_RGB_ETC1_WEBGL
;
}
else
{
return
null
;
}
}
...
...
@@ -93,8 +117,14 @@ function WebGLUtils( gl, extensions, capabilities ) {
if
(
extension
!==
null
)
{
// TODO Complete?
return
p
;
}
else
{
return
null
;
}
}
...
...
@@ -105,11 +135,17 @@ function WebGLUtils( gl, extensions, capabilities ) {
extension
=
extensions
.
get
(
'
WEBGL_depth_texture
'
);
if
(
extension
!==
null
)
return
extension
.
UNSIGNED_INT_24_8_WEBGL
;
if
(
extension
!==
null
)
{
}
return
extension
.
UNSIGNED_INT_24_8_WEBGL
;
}
else
{
return
null
;
return
0
;
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录