Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
8cd41354
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,发现更多精彩内容 >>
提交
8cd41354
编写于
10月 28, 2016
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
WebGLState: Removed clearColor, clearDepth and clearStencil.
上级
102497da
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
47 deletion
+17
-47
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+6
-18
src/renderers/webgl/WebGLShadowMap.js
src/renderers/webgl/WebGLShadowMap.js
+1
-1
src/renderers/webgl/WebGLState.js
src/renderers/webgl/WebGLState.js
+10
-28
未找到文件。
src/renderers/WebGLRenderer.js
浏览文件 @
8cd41354
...
...
@@ -322,18 +322,6 @@ function WebGLRenderer( parameters ) {
}
function
glClearColor
(
r
,
g
,
b
,
a
)
{
if
(
_premultipliedAlpha
===
true
)
{
r
*=
a
;
g
*=
a
;
b
*=
a
;
}
state
.
clearColor
(
r
,
g
,
b
,
a
);
}
function
setDefaultGLState
()
{
state
.
init
();
...
...
@@ -341,7 +329,7 @@ function WebGLRenderer( parameters ) {
state
.
scissor
(
_currentScissor
.
copy
(
_scissor
).
multiplyScalar
(
_pixelRatio
)
);
state
.
viewport
(
_currentViewport
.
copy
(
_viewport
).
multiplyScalar
(
_pixelRatio
)
);
glClearColor
(
_clearColor
.
r
,
_clearColor
.
g
,
_clearColor
.
b
,
_clear
Alpha
);
state
.
buffers
.
color
.
setClear
(
_clearColor
.
r
,
_clearColor
.
g
,
_clearColor
.
b
,
_clearAlpha
,
_premultiplied
Alpha
);
}
...
...
@@ -485,7 +473,7 @@ function WebGLRenderer( parameters ) {
_clearAlpha
=
alpha
!==
undefined
?
alpha
:
1
;
glClearColor
(
_clearColor
.
r
,
_clearColor
.
g
,
_clearColor
.
b
,
_clear
Alpha
);
state
.
buffers
.
color
.
setClear
(
_clearColor
.
r
,
_clearColor
.
g
,
_clearColor
.
b
,
_clearAlpha
,
_premultiplied
Alpha
);
};
...
...
@@ -499,7 +487,7 @@ function WebGLRenderer( parameters ) {
_clearAlpha
=
alpha
;
glClearColor
(
_clearColor
.
r
,
_clearColor
.
g
,
_clearColor
.
b
,
_clear
Alpha
);
state
.
buffers
.
color
.
setClear
(
_clearColor
.
r
,
_clearColor
.
g
,
_clearColor
.
b
,
_clearAlpha
,
_premultiplied
Alpha
);
};
...
...
@@ -1209,11 +1197,11 @@ function WebGLRenderer( parameters ) {
if
(
background
===
null
)
{
glClearColor
(
_clearColor
.
r
,
_clearColor
.
g
,
_clearColor
.
b
,
_clear
Alpha
);
state
.
buffers
.
color
.
setClear
(
_clearColor
.
r
,
_clearColor
.
g
,
_clearColor
.
b
,
_clearAlpha
,
_premultiplied
Alpha
);
}
else
if
(
background
&&
background
.
isColor
)
{
glClearColor
(
background
.
r
,
background
.
g
,
background
.
b
,
1
);
state
.
buffers
.
color
.
setClear
(
background
.
r
,
background
.
g
,
background
.
b
,
1
,
_premultipliedAlpha
);
forceClear
=
true
;
}
...
...
@@ -1742,7 +1730,7 @@ function WebGLRenderer( parameters ) {
material
.
needsUpdate
=
true
;
}
else
if
(
materialProperties
.
numClippingPlanes
!==
undefined
&&
(
materialProperties
.
numClippingPlanes
!==
_clipping
.
numPlanes
||
(
materialProperties
.
numClippingPlanes
!==
_clipping
.
numPlanes
||
materialProperties
.
numIntersection
!==
_clipping
.
numIntersection
)
)
{
material
.
needsUpdate
=
true
;
...
...
src/renderers/webgl/WebGLShadowMap.js
浏览文件 @
8cd41354
...
...
@@ -115,7 +115,7 @@ function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) {
if
(
_lightShadows
.
length
===
0
)
return
;
// Set GL state for depth map.
_state
.
clearColo
r
(
1
,
1
,
1
,
1
);
_state
.
buffers
.
color
.
setClea
r
(
1
,
1
,
1
,
1
);
_state
.
disable
(
_gl
.
BLEND
);
_state
.
setDepthTest
(
true
);
_state
.
setScissorTest
(
false
);
...
...
src/renderers/webgl/WebGLState.js
浏览文件 @
8cd41354
...
...
@@ -34,7 +34,13 @@ function WebGLState( gl, extensions, paramThreeToGL ) {
},
setClear
:
function
(
r
,
g
,
b
,
a
)
{
setClear
:
function
(
r
,
g
,
b
,
a
,
premultipliedAlpha
)
{
if
(
premultipliedAlpha
===
true
)
{
r
*=
a
;
g
*=
a
;
b
*=
a
;
}
color
.
set
(
r
,
g
,
b
,
a
);
...
...
@@ -369,9 +375,9 @@ function WebGLState( gl, extensions, paramThreeToGL ) {
function
init
()
{
c
learColo
r
(
0
,
0
,
0
,
1
);
clearDepth
(
1
);
clearStencil
(
0
);
c
olorBuffer
.
setClea
r
(
0
,
0
,
0
,
1
);
depthBuffer
.
setClear
(
1
);
stencilBuffer
.
setClear
(
0
);
enable
(
gl
.
DEPTH_TEST
);
setDepthFunc
(
LessEqualDepth
);
...
...
@@ -850,26 +856,6 @@ function WebGLState( gl, extensions, paramThreeToGL ) {
}
// TODO Deprecate
function
clearColor
(
r
,
g
,
b
,
a
)
{
colorBuffer
.
setClear
(
r
,
g
,
b
,
a
);
}
function
clearDepth
(
depth
)
{
depthBuffer
.
setClear
(
depth
);
}
function
clearStencil
(
stencil
)
{
stencilBuffer
.
setClear
(
stencil
);
}
//
function
scissor
(
scissor
)
{
...
...
@@ -969,10 +955,6 @@ function WebGLState( gl, extensions, paramThreeToGL ) {
compressedTexImage2D
:
compressedTexImage2D
,
texImage2D
:
texImage2D
,
clearColor
:
clearColor
,
clearDepth
:
clearDepth
,
clearStencil
:
clearStencil
,
scissor
:
scissor
,
viewport
:
viewport
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录