Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
d0cb1baa
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,发现更多精彩内容 >>
提交
d0cb1baa
编写于
8月 18, 2016
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
WebGLRenderer: Removed unneeded checks.
上级
b7dbcb0e
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
39 addition
and
37 deletion
+39
-37
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+39
-37
未找到文件。
src/renderers/WebGLRenderer.js
浏览文件 @
d0cb1baa
...
@@ -632,7 +632,9 @@ function WebGLRenderer( parameters ) {
...
@@ -632,7 +632,9 @@ function WebGLRenderer( parameters ) {
_gl
.
bindBuffer
(
_gl
.
ARRAY_BUFFER
,
buffers
.
normal
);
_gl
.
bindBuffer
(
_gl
.
ARRAY_BUFFER
,
buffers
.
normal
);
if
(
material
.
type
!==
'
MeshPhongMaterial
'
&&
material
.
type
!==
'
MeshStandardMaterial
'
&&
material
.
type
!==
'
MeshPhysicalMaterial
'
&&
material
.
shading
===
FlatShading
)
{
if
(
!
material
.
isMeshPhongMaterial
&&
!
material
.
isMeshStandardMaterial
&&
material
.
shading
===
FlatShading
)
{
for
(
var
i
=
0
,
l
=
object
.
count
*
3
;
i
<
l
;
i
+=
9
)
{
for
(
var
i
=
0
,
l
=
object
.
count
*
3
;
i
<
l
;
i
+=
9
)
{
...
@@ -1442,7 +1444,7 @@ function WebGLRenderer( parameters ) {
...
@@ -1442,7 +1444,7 @@ function WebGLRenderer( parameters ) {
var
geometry
=
objects
.
update
(
object
);
var
geometry
=
objects
.
update
(
object
);
if
(
material
&&
material
.
isMultiMaterial
)
{
if
(
material
.
isMultiMaterial
)
{
var
groups
=
geometry
.
groups
;
var
groups
=
geometry
.
groups
;
var
materials
=
material
.
materials
;
var
materials
=
material
.
materials
;
...
@@ -1625,8 +1627,8 @@ function WebGLRenderer( parameters ) {
...
@@ -1625,8 +1627,8 @@ function WebGLRenderer( parameters ) {
var
uniforms
=
materialProperties
.
__webglShader
.
uniforms
;
var
uniforms
=
materialProperties
.
__webglShader
.
uniforms
;
if
(
!
(
material
&&
material
.
isShaderMaterial
)
&&
if
(
!
material
.
isShaderMaterial
&&
!
(
material
&&
material
.
isRawShaderMaterial
)
|
|
!
material
.
isRawShaderMaterial
|
material
.
clipping
===
true
)
{
material
.
clipping
===
true
)
{
materialProperties
.
numClippingPlanes
=
_clipping
.
numPlanes
;
materialProperties
.
numClippingPlanes
=
_clipping
.
numPlanes
;
...
@@ -1806,9 +1808,9 @@ function WebGLRenderer( parameters ) {
...
@@ -1806,9 +1808,9 @@ function WebGLRenderer( parameters ) {
// load material specific uniforms
// load material specific uniforms
// (shader material also gets them for the sake of genericity)
// (shader material also gets them for the sake of genericity)
if
(
(
material
&&
material
.
isShaderMaterial
)
||
if
(
material
.
isShaderMaterial
||
(
material
&&
material
.
isMeshPhongMaterial
)
||
material
.
isMeshPhongMaterial
||
(
material
&&
material
.
isMeshStandardMaterial
)
||
material
.
isMeshStandardMaterial
||
material
.
envMap
)
{
material
.
envMap
)
{
var
uCamPos
=
p_uniforms
.
map
.
cameraPosition
;
var
uCamPos
=
p_uniforms
.
map
.
cameraPosition
;
...
@@ -1822,11 +1824,11 @@ function WebGLRenderer( parameters ) {
...
@@ -1822,11 +1824,11 @@ function WebGLRenderer( parameters ) {
}
}
if
(
(
material
&&
material
.
isMeshPhongMaterial
)
||
if
(
material
.
isMeshPhongMaterial
||
(
material
&&
material
.
isMeshLambertMaterial
)
||
material
.
isMeshLambertMaterial
||
(
material
&&
material
.
isMeshBasicMaterial
)
||
material
.
isMeshBasicMaterial
||
(
material
&&
material
.
isMeshStandardMaterial
)
||
material
.
isMeshStandardMaterial
||
(
material
&&
material
.
isShaderMaterial
)
||
material
.
isShaderMaterial
||
material
.
skinning
)
{
material
.
skinning
)
{
p_uniforms
.
setValue
(
_gl
,
'
viewMatrix
'
,
camera
.
matrixWorldInverse
);
p_uniforms
.
setValue
(
_gl
,
'
viewMatrix
'
,
camera
.
matrixWorldInverse
);
...
@@ -1892,11 +1894,11 @@ function WebGLRenderer( parameters ) {
...
@@ -1892,11 +1894,11 @@ function WebGLRenderer( parameters ) {
}
}
if
(
(
material
&&
material
.
isMeshBasicMaterial
)
||
if
(
material
.
isMeshBasicMaterial
||
(
material
&&
material
.
isMeshLambertMaterial
)
||
material
.
isMeshLambertMaterial
||
(
material
&&
material
.
isMeshPhongMaterial
)
||
material
.
isMeshPhongMaterial
||
(
material
&&
material
.
isMeshStandardMaterial
)
||
material
.
isMeshStandardMaterial
||
(
material
&&
material
.
isMeshDepthMaterial
)
)
{
material
.
isMeshDepthMaterial
)
{
refreshUniformsCommon
(
m_uniforms
,
material
);
refreshUniformsCommon
(
m_uniforms
,
material
);
...
@@ -1904,36 +1906,36 @@ function WebGLRenderer( parameters ) {
...
@@ -1904,36 +1906,36 @@ function WebGLRenderer( parameters ) {
// refresh single material specific uniforms
// refresh single material specific uniforms
if
(
material
&&
material
.
isLineBasicMaterial
)
{
if
(
material
.
isLineBasicMaterial
)
{
refreshUniformsLine
(
m_uniforms
,
material
);
refreshUniformsLine
(
m_uniforms
,
material
);
}
else
if
(
material
&&
material
.
isLineDashedMaterial
)
{
}
else
if
(
material
.
isLineDashedMaterial
)
{
refreshUniformsLine
(
m_uniforms
,
material
);
refreshUniformsLine
(
m_uniforms
,
material
);
refreshUniformsDash
(
m_uniforms
,
material
);
refreshUniformsDash
(
m_uniforms
,
material
);
}
else
if
(
material
&&
material
.
isPointsMaterial
)
{
}
else
if
(
material
.
isPointsMaterial
)
{
refreshUniformsPoints
(
m_uniforms
,
material
);
refreshUniformsPoints
(
m_uniforms
,
material
);
}
else
if
(
material
&&
material
.
isMeshLambertMaterial
)
{
}
else
if
(
material
.
isMeshLambertMaterial
)
{
refreshUniformsLambert
(
m_uniforms
,
material
);
refreshUniformsLambert
(
m_uniforms
,
material
);
}
else
if
(
material
&&
material
.
isMeshPhongMaterial
)
{
}
else
if
(
material
.
isMeshPhongMaterial
)
{
refreshUniformsPhong
(
m_uniforms
,
material
);
refreshUniformsPhong
(
m_uniforms
,
material
);
}
else
if
(
material
&&
material
.
isMeshPhysicalMaterial
)
{
}
else
if
(
material
.
isMeshPhysicalMaterial
)
{
refreshUniformsPhysical
(
m_uniforms
,
material
);
refreshUniformsPhysical
(
m_uniforms
,
material
);
}
else
if
(
material
&&
material
.
isMeshStandardMaterial
)
{
}
else
if
(
material
.
isMeshStandardMaterial
)
{
refreshUniformsStandard
(
m_uniforms
,
material
);
refreshUniformsStandard
(
m_uniforms
,
material
);
}
else
if
(
material
&&
material
.
isMeshDepthMaterial
)
{
}
else
if
(
material
.
isMeshDepthMaterial
)
{
if
(
material
.
displacementMap
)
{
if
(
material
.
displacementMap
)
{
...
@@ -1943,7 +1945,7 @@ function WebGLRenderer( parameters ) {
...
@@ -1943,7 +1945,7 @@ function WebGLRenderer( parameters ) {
}
}
}
else
if
(
material
&&
material
.
isMeshNormalMaterial
)
{
}
else
if
(
material
.
isMeshNormalMaterial
)
{
m_uniforms
.
opacity
.
value
=
material
.
opacity
;
m_uniforms
.
opacity
.
value
=
material
.
opacity
;
...
@@ -2055,7 +2057,7 @@ function WebGLRenderer( parameters ) {
...
@@ -2055,7 +2057,7 @@ function WebGLRenderer( parameters ) {
if
(
uvScaleMap
!==
undefined
)
{
if
(
uvScaleMap
!==
undefined
)
{
// backwards compatibility
// backwards compatibility
if
(
(
uvScaleMap
&&
uvScaleMap
.
isWebGLRenderTarget
)
)
{
if
(
uvScaleMap
.
isWebGLRenderTarget
)
{
uvScaleMap
=
uvScaleMap
.
texture
;
uvScaleMap
=
uvScaleMap
.
texture
;
...
@@ -2120,12 +2122,12 @@ function WebGLRenderer( parameters ) {
...
@@ -2120,12 +2122,12 @@ function WebGLRenderer( parameters ) {
uniforms
.
fogColor
.
value
=
fog
.
color
;
uniforms
.
fogColor
.
value
=
fog
.
color
;
if
(
fog
&&
fog
.
isFog
)
{
if
(
fog
.
isFog
)
{
uniforms
.
fogNear
.
value
=
fog
.
near
;
uniforms
.
fogNear
.
value
=
fog
.
near
;
uniforms
.
fogFar
.
value
=
fog
.
far
;
uniforms
.
fogFar
.
value
=
fog
.
far
;
}
else
if
(
fog
&&
fog
.
isFogExp2
)
{
}
else
if
(
fog
.
isFogExp2
)
{
uniforms
.
fogDensity
.
value
=
fog
.
density
;
uniforms
.
fogDensity
.
value
=
fog
.
density
;
...
@@ -2323,13 +2325,13 @@ function WebGLRenderer( parameters ) {
...
@@ -2323,13 +2325,13 @@ function WebGLRenderer( parameters ) {
shadowMap
=
(
light
.
shadow
&&
light
.
shadow
.
map
)
?
light
.
shadow
.
map
.
texture
:
null
;
shadowMap
=
(
light
.
shadow
&&
light
.
shadow
.
map
)
?
light
.
shadow
.
map
.
texture
:
null
;
if
(
light
&&
light
.
isAmbientLight
)
{
if
(
light
.
isAmbientLight
)
{
r
+=
color
.
r
*
intensity
;
r
+=
color
.
r
*
intensity
;
g
+=
color
.
g
*
intensity
;
g
+=
color
.
g
*
intensity
;
b
+=
color
.
b
*
intensity
;
b
+=
color
.
b
*
intensity
;
}
else
if
(
light
&&
light
.
isDirectionalLight
)
{
}
else
if
(
light
.
isDirectionalLight
)
{
var
uniforms
=
lightCache
.
get
(
light
);
var
uniforms
=
lightCache
.
get
(
light
);
...
@@ -2353,7 +2355,7 @@ function WebGLRenderer( parameters ) {
...
@@ -2353,7 +2355,7 @@ function WebGLRenderer( parameters ) {
_lights
.
directionalShadowMatrix
[
directionalLength
]
=
light
.
shadow
.
matrix
;
_lights
.
directionalShadowMatrix
[
directionalLength
]
=
light
.
shadow
.
matrix
;
_lights
.
directional
[
directionalLength
++
]
=
uniforms
;
_lights
.
directional
[
directionalLength
++
]
=
uniforms
;
}
else
if
(
light
&&
light
.
isSpotLight
)
{
}
else
if
(
light
.
isSpotLight
)
{
var
uniforms
=
lightCache
.
get
(
light
);
var
uniforms
=
lightCache
.
get
(
light
);
...
@@ -2386,7 +2388,7 @@ function WebGLRenderer( parameters ) {
...
@@ -2386,7 +2388,7 @@ function WebGLRenderer( parameters ) {
_lights
.
spotShadowMatrix
[
spotLength
]
=
light
.
shadow
.
matrix
;
_lights
.
spotShadowMatrix
[
spotLength
]
=
light
.
shadow
.
matrix
;
_lights
.
spot
[
spotLength
++
]
=
uniforms
;
_lights
.
spot
[
spotLength
++
]
=
uniforms
;
}
else
if
(
light
&&
light
.
isPointLight
)
{
}
else
if
(
light
.
isPointLight
)
{
var
uniforms
=
lightCache
.
get
(
light
);
var
uniforms
=
lightCache
.
get
(
light
);
...
@@ -2422,7 +2424,7 @@ function WebGLRenderer( parameters ) {
...
@@ -2422,7 +2424,7 @@ function WebGLRenderer( parameters ) {
_lights
.
point
[
pointLength
++
]
=
uniforms
;
_lights
.
point
[
pointLength
++
]
=
uniforms
;
}
else
if
(
light
&&
light
.
isHemisphereLight
)
{
}
else
if
(
light
.
isHemisphereLight
)
{
var
uniforms
=
lightCache
.
get
(
light
);
var
uniforms
=
lightCache
.
get
(
light
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录