Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
0eb402d3
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,发现更多精彩内容 >>
提交
0eb402d3
编写于
2月 19, 2015
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
WebGLRenderer: Moved doubleSided/flipSided code to WebGLState.
上级
c5ec18bf
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
55 addition
and
50 deletion
+55
-50
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+2
-41
src/renderers/webgl/WebGLState.js
src/renderers/webgl/WebGLState.js
+53
-9
未找到文件。
src/renderers/WebGLRenderer.js
浏览文件 @
0eb402d3
...
@@ -118,11 +118,6 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -118,11 +118,6 @@ THREE.WebGLRenderer = function ( parameters ) {
_usedTextureUnits
=
0
,
_usedTextureUnits
=
0
,
// GL state cache
_currentDoubleSided
=
-
1
,
_currentFlipSided
=
-
1
,
_viewportX
=
0
,
_viewportX
=
0
,
_viewportY
=
0
,
_viewportY
=
0
,
_viewportWidth
=
_canvas
.
width
,
_viewportWidth
=
_canvas
.
width
,
...
@@ -280,8 +275,6 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -280,8 +275,6 @@ THREE.WebGLRenderer = function ( parameters ) {
_currentProgram
=
null
;
_currentProgram
=
null
;
_currentCamera
=
null
;
_currentCamera
=
null
;
_currentDoubleSided
=
-
1
;
_currentFlipSided
=
-
1
;
_currentGeometryProgram
=
''
;
_currentGeometryProgram
=
''
;
_currentMaterialId
=
-
1
;
_currentMaterialId
=
-
1
;
...
@@ -5442,40 +5435,8 @@ THREE.WebGLRenderer = function ( parameters ) {
...
@@ -5442,40 +5435,8 @@ THREE.WebGLRenderer = function ( parameters ) {
this
.
setMaterialFaces
=
function
(
material
)
{
this
.
setMaterialFaces
=
function
(
material
)
{
var
doubleSided
=
material
.
side
===
THREE
.
DoubleSide
;
state
.
setDoubleSided
(
material
.
side
===
THREE
.
DoubleSide
);
var
flipSided
=
material
.
side
===
THREE
.
BackSide
;
state
.
setFlipSided
(
material
.
side
===
THREE
.
BackSide
);
if
(
_currentDoubleSided
!==
doubleSided
)
{
if
(
doubleSided
)
{
_gl
.
disable
(
_gl
.
CULL_FACE
);
}
else
{
_gl
.
enable
(
_gl
.
CULL_FACE
);
}
_currentDoubleSided
=
doubleSided
;
}
if
(
_currentFlipSided
!==
flipSided
)
{
if
(
flipSided
)
{
_gl
.
frontFace
(
_gl
.
CW
);
}
else
{
_gl
.
frontFace
(
_gl
.
CCW
);
}
_currentFlipSided
=
flipSided
;
}
};
};
...
...
src/renderers/webgl/WebGLState.js
浏览文件 @
0eb402d3
...
@@ -12,6 +12,18 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
...
@@ -12,6 +12,18 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
var
currentBlendSrcAlpha
=
-
1
;
var
currentBlendSrcAlpha
=
-
1
;
var
currentBlendDstAlpha
=
-
1
;
var
currentBlendDstAlpha
=
-
1
;
var
currentDepthTest
=
-
1
;
var
currentDepthWrite
=
-
1
;
var
currentDoubleSided
=
-
1
;
var
currentFlipSided
=
-
1
;
var
currentLineWidth
=
null
;
var
currentPolygonOffset
=
null
;
var
currentPolygonOffsetFactor
=
null
;
var
currentPolygonOffsetUnits
=
null
;
this
.
setBlending
=
function
(
blending
,
blendEquation
,
blendSrc
,
blendDst
,
blendEquationAlpha
,
blendSrcAlpha
,
blendDstAlpha
)
{
this
.
setBlending
=
function
(
blending
,
blendEquation
,
blendSrc
,
blendDst
,
blendEquationAlpha
,
blendSrcAlpha
,
blendDstAlpha
)
{
if
(
blending
!==
currentBlending
)
{
if
(
blending
!==
currentBlending
)
{
...
@@ -95,8 +107,6 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
...
@@ -95,8 +107,6 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
};
};
var
currentDepthTest
=
-
1
;
this
.
setDepthTest
=
function
(
depthTest
)
{
this
.
setDepthTest
=
function
(
depthTest
)
{
if
(
currentDepthTest
!==
depthTest
)
{
if
(
currentDepthTest
!==
depthTest
)
{
...
@@ -117,8 +127,6 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
...
@@ -117,8 +127,6 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
};
};
var
currentDepthWrite
=
-
1
;
this
.
setDepthWrite
=
function
(
depthWrite
)
{
this
.
setDepthWrite
=
function
(
depthWrite
)
{
if
(
currentDepthWrite
!==
depthWrite
)
{
if
(
currentDepthWrite
!==
depthWrite
)
{
...
@@ -130,7 +138,45 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
...
@@ -130,7 +138,45 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
};
};
var
currentLineWidth
=
null
;
this
.
setDoubleSided
=
function
(
doubleSided
)
{
if
(
currentDoubleSided
!==
doubleSided
)
{
if
(
doubleSided
)
{
gl
.
disable
(
gl
.
CULL_FACE
);
}
else
{
gl
.
enable
(
gl
.
CULL_FACE
);
}
currentDoubleSided
=
doubleSided
;
}
};
this
.
setFlipSided
=
function
(
flipSided
)
{
if
(
currentFlipSided
!==
flipSided
)
{
if
(
flipSided
)
{
gl
.
frontFace
(
gl
.
CW
);
}
else
{
gl
.
frontFace
(
gl
.
CCW
);
}
currentFlipSided
=
flipSided
;
}
};
this
.
setLineWidth
=
function
(
width
)
{
this
.
setLineWidth
=
function
(
width
)
{
...
@@ -144,10 +190,6 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
...
@@ -144,10 +190,6 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
};
};
var
currentPolygonOffset
=
null
;
var
currentPolygonOffsetFactor
=
null
;
var
currentPolygonOffsetUnits
=
null
;
this
.
setPolygonOffset
=
function
(
polygonoffset
,
factor
,
units
)
{
this
.
setPolygonOffset
=
function
(
polygonoffset
,
factor
,
units
)
{
if
(
currentPolygonOffset
!==
polygonoffset
)
{
if
(
currentPolygonOffset
!==
polygonoffset
)
{
...
@@ -182,6 +224,8 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
...
@@ -182,6 +224,8 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
currentBlending
=
-
1
;
currentBlending
=
-
1
;
currentDepthTest
=
-
1
;
currentDepthTest
=
-
1
;
currentDepthWrite
=
-
1
;
currentDepthWrite
=
-
1
;
currentDoubleSided
=
-
1
;
currentFlipSided
=
-
1
;
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录