Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
9986eac6
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,发现更多精彩内容 >>
提交
9986eac6
编写于
8月 06, 2012
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'alteredq/unflip' into dev
上级
b50eb50e
fb6bf107
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
32 addition
and
29 deletion
+32
-29
build/Three.js
build/Three.js
+1
-1
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+1
-1
examples/webgl_animation_cloth.html
examples/webgl_animation_cloth.html
+1
-1
examples/webgl_geometries.html
examples/webgl_geometries.html
+1
-1
examples/webgl_geometries2.html
examples/webgl_geometries2.html
+1
-1
examples/webgl_geometry_tessellation.html
examples/webgl_geometry_tessellation.html
+1
-1
examples/webgl_loader_ctm_materials.html
examples/webgl_loader_ctm_materials.html
+2
-2
examples/webgl_loader_vtk.html
examples/webgl_loader_vtk.html
+1
-1
examples/webgl_materials_cars.html
examples/webgl_materials_cars.html
+1
-1
examples/webgl_materials_cars_anaglyph.html
examples/webgl_materials_cars_anaglyph.html
+1
-1
examples/webgl_materials_cars_parallaxbarrier.html
examples/webgl_materials_cars_parallaxbarrier.html
+1
-1
examples/webgl_materials_cubemap.html
examples/webgl_materials_cubemap.html
+1
-1
examples/webgl_materials_cubemap_balls_reflection.html
examples/webgl_materials_cubemap_balls_reflection.html
+1
-1
examples/webgl_materials_cubemap_balls_reflection_anaglyph.html
...es/webgl_materials_cubemap_balls_reflection_anaglyph.html
+1
-1
examples/webgl_materials_cubemap_balls_refraction.html
examples/webgl_materials_cubemap_balls_refraction.html
+1
-1
examples/webgl_materials_cubemap_balls_refraction_crosseyed.html
...s/webgl_materials_cubemap_balls_refraction_crosseyed.html
+1
-1
examples/webgl_materials_cubemap_escher.html
examples/webgl_materials_cubemap_escher.html
+1
-1
examples/webgl_materials_cubemap_refraction.html
examples/webgl_materials_cubemap_refraction.html
+1
-1
examples/webgl_materials_shaders_fresnel.html
examples/webgl_materials_shaders_fresnel.html
+1
-1
examples/webgl_performance_doublesided.html
examples/webgl_performance_doublesided.html
+1
-1
examples/webgl_ribbons.html
examples/webgl_ribbons.html
+1
-1
examples/webgl_shading_physical.html
examples/webgl_shading_physical.html
+1
-1
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+9
-6
未找到文件。
build/Three.js
浏览文件 @
9986eac6
...
...
@@ -445,7 +445,7 @@ e=t("fragment",e+p);d=t("vertex",d+o);k.attachShader(q,d);k.attachShader(q,e);k.
d
.
push
(
"
boneGlobalMatrices
"
);
for
(
s
in
n
)
d
.
push
(
s
);
s
=
d
;
d
=
0
;
for
(
n
=
s
.
length
;
d
<
n
;
d
++
){
e
=
s
[
d
];
q
.
uniforms
[
e
]
=
k
.
getUniformLocation
(
q
,
e
)}
d
=
[
"
position
"
,
"
normal
"
,
"
uv
"
,
"
uv2
"
,
"
tangent
"
,
"
color
"
,
"
skinVertexA
"
,
"
skinVertexB
"
,
"
skinIndex
"
,
"
skinWeight
"
];
for
(
s
=
0
;
s
<
c
.
maxMorphTargets
;
s
++
)
d
.
push
(
"
morphTarget
"
+
s
);
for
(
s
=
0
;
s
<
c
.
maxMorphNormals
;
s
++
)
d
.
push
(
"
morphNormal
"
+
s
);
for
(
r
in
b
)
d
.
push
(
r
);
r
=
d
;
s
=
0
;
for
(
c
=
r
.
length
;
s
<
c
;
s
++
){
d
=
r
[
s
];
q
.
attributes
[
d
]
=
k
.
getAttribLocation
(
q
,
d
)}
q
.
id
=
X
++
;
ba
.
push
({
program
:
q
,
code
:
l
,
usedTimes
:
1
});
F
.
info
.
memory
.
programs
=
ba
.
length
;
r
=
q
}
a
.
program
=
r
;
r
=
a
.
program
.
attributes
;
r
.
position
>=
0
&&
k
.
enableVertexAttribArray
(
r
.
position
);
r
.
color
>=
0
&&
k
.
enableVertexAttribArray
(
r
.
color
);
r
.
normal
>=
0
&&
k
.
enableVertexAttribArray
(
r
.
normal
);
r
.
tangent
>=
0
&&
k
.
enableVertexAttribArray
(
r
.
tangent
);
if
(
a
.
skinning
&&
r
.
skinVertexA
>=
0
&&
r
.
skinVertexB
>=
0
&&
r
.
skinIndex
>=
0
&&
r
.
skinWeight
>=
0
){
k
.
enableVertexAttribArray
(
r
.
skinVertexA
);
k
.
enableVertexAttribArray
(
r
.
skinVertexB
);
k
.
enableVertexAttribArray
(
r
.
skinIndex
);
k
.
enableVertexAttribArray
(
r
.
skinWeight
)}
if
(
a
.
attributes
)
for
(
i
in
a
.
attributes
)
r
[
i
]
!==
void
0
&&
r
[
i
]
>=
0
&&
k
.
enableVertexAttribArray
(
r
[
i
]);
if
(
a
.
morphTargets
){
a
.
numSupportedMorphTargets
=
0
;
q
=
"
morphTarget
"
;
for
(
i
=
0
;
i
<
this
.
maxMorphTargets
;
i
++
){
s
=
q
+
i
;
if
(
r
[
s
]
>=
0
){
k
.
enableVertexAttribArray
(
r
[
s
]);
a
.
numSupportedMorphTargets
++
}}}
if
(
a
.
morphNormals
){
a
.
numSupportedMorphNormals
=
0
;
q
=
"
morphNormal
"
;
for
(
i
=
0
;
i
<
this
.
maxMorphNormals
;
i
++
){
s
=
q
+
i
;
if
(
r
[
s
]
>=
0
){
k
.
enableVertexAttribArray
(
r
[
s
]);
a
.
numSupportedMorphNormals
++
}}}
a
.
uniformsList
=
[];
for
(
h
in
a
.
uniforms
)
a
.
uniformsList
.
push
([
a
.
uniforms
[
h
],
h
])};
this
.
setFaceCulling
=
function
(
a
,
b
){
if
(
a
){
!
b
||
b
===
"
ccw
"
?
k
.
frontFace
(
k
.
CCW
):
k
.
frontFace
(
k
.
CW
);
a
===
"
back
"
?
k
.
cullFace
(
k
.
BACK
):
a
===
"
front
"
?
k
.
cullFace
(
k
.
FRONT
):
k
.
cullFace
(
k
.
FRONT_AND_BACK
);
k
.
enable
(
k
.
CULL_FACE
)}
else
k
.
disable
(
k
.
CULL_FACE
)};
this
.
setMaterialFaces
=
function
(
a
){
if
(
V
!==
a
.
doubleSided
){
a
.
doubleSided
?
k
.
disable
(
k
.
CULL_FACE
):
k
.
enable
(
k
.
CULL_FACE
);
V
=
a
.
doubleSided
}
if
(
W
!==
a
.
flipSided
){
a
.
flipSided
?
k
.
frontFace
(
k
.
CW
):
k
.
frontFace
(
k
.
CCW
);
W
=
a
.
flipSided
}};
this
.
setDepthTest
=
function
(
a
){
if
(
ja
!==
a
){
a
?
k
.
enable
(
k
.
DEPTH_TEST
):
k
.
disable
(
k
.
DEPTH_TEST
);
function
(
a
,
b
){
if
(
a
){
!
b
||
b
===
"
ccw
"
?
k
.
frontFace
(
k
.
CCW
):
k
.
frontFace
(
k
.
CW
);
a
===
"
back
"
?
k
.
cullFace
(
k
.
BACK
):
a
===
"
front
"
?
k
.
cullFace
(
k
.
FRONT
):
k
.
cullFace
(
k
.
FRONT_AND_BACK
);
k
.
enable
(
k
.
CULL_FACE
)}
else
k
.
disable
(
k
.
CULL_FACE
)};
this
.
setMaterialFaces
=
function
(
a
){
var
b
=
a
.
side
===
THREE
.
DoubleSide
,
a
=
a
.
side
===
THREE
.
BackSide
;
if
(
V
!==
b
){
b
?
k
.
disable
(
k
.
CULL_FACE
):
k
.
enable
(
k
.
CULL_FACE
);
V
=
b
}
if
(
W
!==
a
){
a
?
k
.
frontFace
(
k
.
CW
):
k
.
frontFace
(
k
.
CCW
);
W
=
a
}};
this
.
setDepthTest
=
function
(
a
){
if
(
ja
!==
a
){
a
?
k
.
enable
(
k
.
DEPTH_TEST
):
k
.
disable
(
k
.
DEPTH_TEST
);
ja
=
a
}};
this
.
setDepthWrite
=
function
(
a
){
if
(
ma
!==
a
){
k
.
depthMask
(
a
);
ma
=
a
}};
this
.
setBlending
=
function
(
a
,
b
,
c
,
d
){
if
(
a
!==
P
){
if
(
a
===
THREE
.
NoBlending
)
k
.
disable
(
k
.
BLEND
);
else
if
(
a
===
THREE
.
AdditiveBlending
){
k
.
enable
(
k
.
BLEND
);
k
.
blendEquation
(
k
.
FUNC_ADD
);
k
.
blendFunc
(
k
.
SRC_ALPHA
,
k
.
ONE
)}
else
if
(
a
===
THREE
.
SubtractiveBlending
){
k
.
enable
(
k
.
BLEND
);
k
.
blendEquation
(
k
.
FUNC_ADD
);
k
.
blendFunc
(
k
.
ZERO
,
k
.
ONE_MINUS_SRC_COLOR
)}
else
if
(
a
===
THREE
.
MultiplyBlending
){
k
.
enable
(
k
.
BLEND
);
k
.
blendEquation
(
k
.
FUNC_ADD
);
k
.
blendFunc
(
k
.
ZERO
,
k
.
SRC_COLOR
)}
else
if
(
a
===
THREE
.
CustomBlending
)
k
.
enable
(
k
.
BLEND
);
else
{
k
.
enable
(
k
.
BLEND
);
k
.
blendEquationSeparate
(
k
.
FUNC_ADD
,
k
.
FUNC_ADD
);
k
.
blendFuncSeparate
(
k
.
SRC_ALPHA
,
k
.
ONE_MINUS_SRC_ALPHA
,
k
.
ONE
,
k
.
ONE_MINUS_SRC_ALPHA
)}
P
=
a
}
if
(
a
===
THREE
.
CustomBlending
){
if
(
b
!==
Y
){
k
.
blendEquation
(
E
(
b
));
Y
=
b
}
if
(
c
!==
ga
||
d
!==
Fa
){
k
.
blendFunc
(
E
(
c
),
E
(
d
));
ga
=
c
;
Fa
=
d
}}
else
Fa
=
ga
=
Y
=
null
};
this
.
setTexture
=
function
(
a
,
b
){
if
(
a
.
needsUpdate
){
if
(
!
a
.
__webglInit
){
a
.
__webglInit
=
true
;
a
.
__webglTexture
=
k
.
createTexture
();
F
.
info
.
memory
.
textures
++
}
k
.
activeTexture
(
k
.
TEXTURE0
+
b
);
k
.
bindTexture
(
k
.
TEXTURE_2D
,
a
.
__webglTexture
);
k
.
pixelStorei
(
k
.
UNPACK_FLIP_Y_WEBGL
,
a
.
flipY
);
k
.
pixelStorei
(
k
.
UNPACK_PREMULTIPLY_ALPHA_WEBGL
,
a
.
premultiplyAlpha
);
var
c
=
a
.
image
,
d
=
(
c
.
width
&
c
.
width
-
1
)
===
0
&&
(
c
.
height
&
c
.
height
-
1
)
===
0
,
e
=
E
(
a
.
format
),
f
=
E
(
a
.
type
);
w
(
k
.
TEXTURE_2D
,
a
,
d
);
a
instanceof
THREE
.
DataTexture
?
k
.
texImage2D
(
k
.
TEXTURE_2D
,
0
,
e
,
c
.
width
,
c
.
height
,
0
,
e
,
f
,
c
.
data
):
k
.
texImage2D
(
k
.
TEXTURE_2D
,
0
,
e
,
e
,
f
,
a
.
image
);
a
.
generateMipmaps
&&
d
&&
k
.
generateMipmap
(
k
.
TEXTURE_2D
);
a
.
needsUpdate
=
false
;
if
(
a
.
onUpdate
)
a
.
onUpdate
()}
else
{
k
.
activeTexture
(
k
.
TEXTURE0
+
...
...
build/custom/ThreeWebGL.js
浏览文件 @
9986eac6
...
...
@@ -406,7 +406,7 @@ e=w("fragment",e+q);d=w("vertex",d+o);g.attachShader(r,d);g.attachShader(r,e);g.
d
.
push
(
"
boneGlobalMatrices
"
);
for
(
u
in
n
)
d
.
push
(
u
);
u
=
d
;
d
=
0
;
for
(
n
=
u
.
length
;
d
<
n
;
d
++
){
e
=
u
[
d
];
r
.
uniforms
[
e
]
=
g
.
getUniformLocation
(
r
,
e
)}
d
=
[
"
position
"
,
"
normal
"
,
"
uv
"
,
"
uv2
"
,
"
tangent
"
,
"
color
"
,
"
skinVertexA
"
,
"
skinVertexB
"
,
"
skinIndex
"
,
"
skinWeight
"
];
for
(
u
=
0
;
u
<
c
.
maxMorphTargets
;
u
++
)
d
.
push
(
"
morphTarget
"
+
u
);
for
(
u
=
0
;
u
<
c
.
maxMorphNormals
;
u
++
)
d
.
push
(
"
morphNormal
"
+
u
);
for
(
p
in
b
)
d
.
push
(
p
);
p
=
d
;
u
=
0
;
for
(
c
=
p
.
length
;
u
<
c
;
u
++
){
d
=
p
[
u
];
r
.
attributes
[
d
]
=
g
.
getAttribLocation
(
r
,
d
)}
r
.
id
=
sa
++
;
ea
.
push
({
program
:
r
,
code
:
m
,
usedTimes
:
1
});
F
.
info
.
memory
.
programs
=
ea
.
length
;
p
=
r
}
a
.
program
=
p
;
p
=
a
.
program
.
attributes
;
p
.
position
>=
0
&&
g
.
enableVertexAttribArray
(
p
.
position
);
p
.
color
>=
0
&&
g
.
enableVertexAttribArray
(
p
.
color
);
p
.
normal
>=
0
&&
g
.
enableVertexAttribArray
(
p
.
normal
);
p
.
tangent
>=
0
&&
g
.
enableVertexAttribArray
(
p
.
tangent
);
if
(
a
.
skinning
&&
p
.
skinVertexA
>=
0
&&
p
.
skinVertexB
>=
0
&&
p
.
skinIndex
>=
0
&&
p
.
skinWeight
>=
0
){
g
.
enableVertexAttribArray
(
p
.
skinVertexA
);
g
.
enableVertexAttribArray
(
p
.
skinVertexB
);
g
.
enableVertexAttribArray
(
p
.
skinIndex
);
g
.
enableVertexAttribArray
(
p
.
skinWeight
)}
if
(
a
.
attributes
)
for
(
j
in
a
.
attributes
)
p
[
j
]
!==
void
0
&&
p
[
j
]
>=
0
&&
g
.
enableVertexAttribArray
(
p
[
j
]);
if
(
a
.
morphTargets
){
a
.
numSupportedMorphTargets
=
0
;
r
=
"
morphTarget
"
;
for
(
j
=
0
;
j
<
this
.
maxMorphTargets
;
j
++
){
u
=
r
+
j
;
if
(
p
[
u
]
>=
0
){
g
.
enableVertexAttribArray
(
p
[
u
]);
a
.
numSupportedMorphTargets
++
}}}
if
(
a
.
morphNormals
){
a
.
numSupportedMorphNormals
=
0
;
r
=
"
morphNormal
"
;
for
(
j
=
0
;
j
<
this
.
maxMorphNormals
;
j
++
){
u
=
r
+
j
;
if
(
p
[
u
]
>=
0
){
g
.
enableVertexAttribArray
(
p
[
u
]);
a
.
numSupportedMorphNormals
++
}}}
a
.
uniformsList
=
[];
for
(
i
in
a
.
uniforms
)
a
.
uniformsList
.
push
([
a
.
uniforms
[
i
],
i
])};
this
.
setFaceCulling
=
function
(
a
,
b
){
if
(
a
){
!
b
||
b
===
"
ccw
"
?
g
.
frontFace
(
g
.
CCW
):
g
.
frontFace
(
g
.
CW
);
a
===
"
back
"
?
g
.
cullFace
(
g
.
BACK
):
a
===
"
front
"
?
g
.
cullFace
(
g
.
FRONT
):
g
.
cullFace
(
g
.
FRONT_AND_BACK
);
g
.
enable
(
g
.
CULL_FACE
)}
else
g
.
disable
(
g
.
CULL_FACE
)};
this
.
setMaterialFaces
=
function
(
a
){
if
(
ha
!==
a
.
doubleSided
){
a
.
doubleSided
?
g
.
disable
(
g
.
CULL_FACE
):
g
.
enable
(
g
.
CULL_FACE
);
ha
=
a
.
doubleSided
}
if
(
W
!==
a
.
flipSided
){
a
.
flipSided
?
g
.
frontFace
(
g
.
CW
):
g
.
frontFace
(
g
.
CCW
);
W
=
a
.
flipSided
}};
this
.
setDepthTest
=
function
(
a
){
if
(
ka
!==
a
){
a
?
g
.
enable
(
g
.
DEPTH_TEST
):
g
.
disable
(
g
.
DEPTH_TEST
);
function
(
a
,
b
){
if
(
a
){
!
b
||
b
===
"
ccw
"
?
g
.
frontFace
(
g
.
CCW
):
g
.
frontFace
(
g
.
CW
);
a
===
"
back
"
?
g
.
cullFace
(
g
.
BACK
):
a
===
"
front
"
?
g
.
cullFace
(
g
.
FRONT
):
g
.
cullFace
(
g
.
FRONT_AND_BACK
);
g
.
enable
(
g
.
CULL_FACE
)}
else
g
.
disable
(
g
.
CULL_FACE
)};
this
.
setMaterialFaces
=
function
(
a
){
var
b
=
a
.
side
===
THREE
.
DoubleSide
,
a
=
a
.
side
===
THREE
.
BackSide
;
if
(
ha
!==
b
){
b
?
g
.
disable
(
g
.
CULL_FACE
):
g
.
enable
(
g
.
CULL_FACE
);
ha
=
b
}
if
(
W
!==
a
){
a
?
g
.
frontFace
(
g
.
CW
):
g
.
frontFace
(
g
.
CCW
);
W
=
a
}};
this
.
setDepthTest
=
function
(
a
){
if
(
ka
!==
a
){
a
?
g
.
enable
(
g
.
DEPTH_TEST
):
g
.
disable
(
g
.
DEPTH_TEST
);
ka
=
a
}};
this
.
setDepthWrite
=
function
(
a
){
if
(
Pa
!==
a
){
g
.
depthMask
(
a
);
Pa
=
a
}};
this
.
setBlending
=
function
(
a
,
b
,
c
,
d
){
if
(
a
!==
ta
){
if
(
a
===
THREE
.
NoBlending
)
g
.
disable
(
g
.
BLEND
);
else
if
(
a
===
THREE
.
AdditiveBlending
){
g
.
enable
(
g
.
BLEND
);
g
.
blendEquation
(
g
.
FUNC_ADD
);
g
.
blendFunc
(
g
.
SRC_ALPHA
,
g
.
ONE
)}
else
if
(
a
===
THREE
.
SubtractiveBlending
){
g
.
enable
(
g
.
BLEND
);
g
.
blendEquation
(
g
.
FUNC_ADD
);
g
.
blendFunc
(
g
.
ZERO
,
g
.
ONE_MINUS_SRC_COLOR
)}
else
if
(
a
===
THREE
.
MultiplyBlending
){
g
.
enable
(
g
.
BLEND
);
g
.
blendEquation
(
g
.
FUNC_ADD
);
g
.
blendFunc
(
g
.
ZERO
,
g
.
SRC_COLOR
)}
else
if
(
a
===
THREE
.
CustomBlending
)
g
.
enable
(
g
.
BLEND
);
else
{
g
.
enable
(
g
.
BLEND
);
g
.
blendEquationSeparate
(
g
.
FUNC_ADD
,
g
.
FUNC_ADD
);
g
.
blendFuncSeparate
(
g
.
SRC_ALPHA
,
g
.
ONE_MINUS_SRC_ALPHA
,
g
.
ONE
,
g
.
ONE_MINUS_SRC_ALPHA
)}
ta
=
a
}
if
(
a
===
THREE
.
CustomBlending
){
if
(
b
!==
Ba
){
g
.
blendEquation
(
A
(
b
));
Ba
=
b
}
if
(
c
!==
Ja
||
d
!==
Ga
){
g
.
blendFunc
(
A
(
c
),
A
(
d
));
Ja
=
c
;
Ga
=
d
}}
else
Ga
=
Ja
=
Ba
=
null
};
this
.
setTexture
=
function
(
a
,
b
){
if
(
a
.
needsUpdate
){
if
(
!
a
.
__webglInit
){
a
.
__webglInit
=
true
;
a
.
__webglTexture
=
g
.
createTexture
();
F
.
info
.
memory
.
textures
++
}
g
.
activeTexture
(
g
.
TEXTURE0
+
b
);
g
.
bindTexture
(
g
.
TEXTURE_2D
,
a
.
__webglTexture
);
g
.
pixelStorei
(
g
.
UNPACK_FLIP_Y_WEBGL
,
a
.
flipY
);
g
.
pixelStorei
(
g
.
UNPACK_PREMULTIPLY_ALPHA_WEBGL
,
a
.
premultiplyAlpha
);
var
c
=
a
.
image
,
d
=
(
c
.
width
&
c
.
width
-
1
)
===
0
&&
(
c
.
height
&
c
.
height
-
1
)
===
0
,
e
=
A
(
a
.
format
),
f
=
A
(
a
.
type
);
H
(
g
.
TEXTURE_2D
,
a
,
d
);
a
instanceof
THREE
.
DataTexture
?
g
.
texImage2D
(
g
.
TEXTURE_2D
,
0
,
e
,
c
.
width
,
c
.
height
,
0
,
e
,
f
,
c
.
data
):
g
.
texImage2D
(
g
.
TEXTURE_2D
,
0
,
e
,
e
,
f
,
a
.
image
);
a
.
generateMipmaps
&&
d
&&
g
.
generateMipmap
(
g
.
TEXTURE_2D
);
a
.
needsUpdate
=
false
;
if
(
a
.
onUpdate
)
a
.
onUpdate
()}
else
{
g
.
activeTexture
(
g
.
TEXTURE0
+
...
...
examples/webgl_animation_cloth.html
浏览文件 @
9986eac6
...
...
@@ -194,7 +194,7 @@
clothTexture
.
anisotropy
=
16
;
materials
=
[
new
THREE
.
MeshPhongMaterial
(
{
alphaTest
:
0.5
,
ambient
:
0xffffff
,
color
:
0xffffff
,
specular
:
0x030303
,
emissive
:
0x111111
,
shiness
:
10
,
perPixel
:
true
,
metal
:
false
,
map
:
clothTexture
,
doubleSided
:
tru
e
}
),
new
THREE
.
MeshPhongMaterial
(
{
alphaTest
:
0.5
,
ambient
:
0xffffff
,
color
:
0xffffff
,
specular
:
0x030303
,
emissive
:
0x111111
,
shiness
:
10
,
perPixel
:
true
,
metal
:
false
,
map
:
clothTexture
,
side
:
THREE
.
DoubleSid
e
}
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xff0000
,
wireframe
:
true
,
transparent
:
true
,
opacity
:
0.9
}
)
];
...
...
examples/webgl_geometries.html
浏览文件 @
9986eac6
...
...
@@ -50,7 +50,7 @@
scene
.
add
(
light
);
materials
=
[
new
THREE
.
MeshLambertMaterial
(
{
ambient
:
0xbbbbbb
,
map
:
THREE
.
ImageUtils
.
loadTexture
(
'
textures/ash_uvgrid01.jpg
'
),
doubleSided
:
tru
e
}
),
new
THREE
.
MeshLambertMaterial
(
{
ambient
:
0xbbbbbb
,
map
:
THREE
.
ImageUtils
.
loadTexture
(
'
textures/ash_uvgrid01.jpg
'
),
side
:
THREE
.
DoubleSid
e
}
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffffff
,
wireframe
:
true
,
transparent
:
true
,
opacity
:
0.1
,
doubleSided
:
true
}
)
];
...
...
examples/webgl_geometries2.html
浏览文件 @
9986eac6
...
...
@@ -61,7 +61,7 @@
scene
.
add
(
light
);
materials
=
[
new
THREE
.
MeshLambertMaterial
(
{
ambient
:
0xbbbbbb
,
map
:
THREE
.
ImageUtils
.
loadTexture
(
'
textures/ash_uvgrid01.jpg
'
),
doubleSided
:
tru
e
}
),
new
THREE
.
MeshLambertMaterial
(
{
ambient
:
0xbbbbbb
,
map
:
THREE
.
ImageUtils
.
loadTexture
(
'
textures/ash_uvgrid01.jpg
'
),
side
:
THREE
.
DoubleSid
e
}
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffffff
,
wireframe
:
true
,
transparent
:
true
,
opacity
:
0.1
,
doubleSided
:
true
}
)
];
...
...
examples/webgl_geometry_tessellation.html
浏览文件 @
9986eac6
...
...
@@ -129,7 +129,7 @@
vertexShader
:
document
.
getElementById
(
'
vertexshader
'
).
textContent
,
fragmentShader
:
document
.
getElementById
(
'
fragmentshader
'
).
textContent
,
shading
:
THREE
.
FlatShading
,
doubleSided
:
tru
e
side
:
THREE
.
DoubleSid
e
});
...
...
examples/webgl_loader_ctm_materials.html
浏览文件 @
9986eac6
...
...
@@ -114,7 +114,7 @@
vertexShader
:
shader
.
vertexShader
,
uniforms
:
shader
.
uniforms
,
depthWrite
:
false
,
flipSided
:
tru
e
side
:
THREE
.
BackSid
e
}
),
...
...
@@ -281,7 +281,7 @@
}
materials
[
i
].
doubleSided
=
tru
e
;
materials
[
i
].
side
=
THREE
.
DoubleSid
e
;
}
...
...
examples/webgl_loader_vtk.html
浏览文件 @
9986eac6
...
...
@@ -80,7 +80,7 @@
camera
.
add
(
dirLight
);
camera
.
add
(
dirLight
.
target
);
var
material
=
new
THREE
.
MeshLambertMaterial
(
{
color
:
0xffffff
,
doubleSided
:
tru
e
}
);
var
material
=
new
THREE
.
MeshLambertMaterial
(
{
color
:
0xffffff
,
side
:
THREE
.
DoubleSid
e
}
);
var
loader
=
new
THREE
.
VTKLoader
();
loader
.
addEventListener
(
'
load
'
,
function
(
event
)
{
...
...
examples/webgl_materials_cars.html
浏览文件 @
9986eac6
...
...
@@ -198,7 +198,7 @@
vertexShader
:
shader
.
vertexShader
,
uniforms
:
shader
.
uniforms
,
depthWrite
:
false
,
flipSided
:
tru
e
side
:
THREE
.
BackSid
e
}
),
...
...
examples/webgl_materials_cars_anaglyph.html
浏览文件 @
9986eac6
...
...
@@ -192,7 +192,7 @@
fragmentShader
:
shader
.
fragmentShader
,
vertexShader
:
shader
.
vertexShader
,
uniforms
:
shader
.
uniforms
,
flipSided
:
tru
e
side
:
THREE
.
BackSid
e
}
),
...
...
examples/webgl_materials_cars_parallaxbarrier.html
浏览文件 @
9986eac6
...
...
@@ -192,7 +192,7 @@
fragmentShader
:
shader
.
fragmentShader
,
vertexShader
:
shader
.
vertexShader
,
uniforms
:
shader
.
uniforms
,
flipSided
:
tru
e
side
:
THREE
.
BackSid
e
}
),
...
...
examples/webgl_materials_cubemap.html
浏览文件 @
9986eac6
...
...
@@ -125,7 +125,7 @@
vertexShader
:
shader
.
vertexShader
,
uniforms
:
shader
.
uniforms
,
depthWrite
:
false
,
flipSided
:
tru
e
side
:
THREE
.
BackSid
e
}
),
...
...
examples/webgl_materials_cubemap_balls_reflection.html
浏览文件 @
9986eac6
...
...
@@ -117,7 +117,7 @@
vertexShader
:
shader
.
vertexShader
,
uniforms
:
shader
.
uniforms
,
depthWrite
:
false
,
flipSided
:
tru
e
side
:
THREE
.
BackSid
e
}
),
...
...
examples/webgl_materials_cubemap_balls_reflection_anaglyph.html
浏览文件 @
9986eac6
...
...
@@ -114,7 +114,7 @@
fragmentShader
:
shader
.
fragmentShader
,
vertexShader
:
shader
.
vertexShader
,
uniforms
:
shader
.
uniforms
,
flipSided
:
tru
e
side
:
THREE
.
BackSid
e
}
),
...
...
examples/webgl_materials_cubemap_balls_refraction.html
浏览文件 @
9986eac6
...
...
@@ -116,7 +116,7 @@
vertexShader
:
shader
.
vertexShader
,
uniforms
:
shader
.
uniforms
,
depthWrite
:
false
,
flipSided
:
tru
e
side
:
THREE
.
BackSid
e
}
),
...
...
examples/webgl_materials_cubemap_balls_refraction_crosseyed.html
浏览文件 @
9986eac6
...
...
@@ -115,7 +115,7 @@
fragmentShader
:
shader
.
fragmentShader
,
vertexShader
:
shader
.
vertexShader
,
uniforms
:
shader
.
uniforms
,
flipSided
:
tru
e
side
:
THREE
.
BackSid
e
}
),
...
...
examples/webgl_materials_cubemap_escher.html
浏览文件 @
9986eac6
...
...
@@ -94,7 +94,7 @@
fragmentShader
:
shader
.
fragmentShader
,
vertexShader
:
shader
.
vertexShader
,
uniforms
:
shader
.
uniforms
,
flipSided
:
tru
e
side
:
THREE
.
BackSid
e
}
),
...
...
examples/webgl_materials_cubemap_refraction.html
浏览文件 @
9986eac6
...
...
@@ -117,7 +117,7 @@
fragmentShader
:
shader
.
fragmentShader
,
vertexShader
:
shader
.
vertexShader
,
uniforms
:
shader
.
uniforms
,
flipSided
:
tru
e
side
:
THREE
.
BackSid
e
}
),
...
...
examples/webgl_materials_shaders_fresnel.html
浏览文件 @
9986eac6
...
...
@@ -126,7 +126,7 @@
fragmentShader
:
shader
.
fragmentShader
,
vertexShader
:
shader
.
vertexShader
,
uniforms
:
shader
.
uniforms
,
flipSided
:
tru
e
side
:
THREE
.
BackSid
e
}
),
...
...
examples/webgl_performance_doublesided.html
浏览文件 @
9986eac6
...
...
@@ -80,7 +80,7 @@
var
reflectionCube
=
THREE
.
ImageUtils
.
loadTextureCube
(
urls
);
reflectionCube
.
format
=
THREE
.
RGBFormat
;
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
specular
:
0xffffff
,
shininess
:
100
,
envMap
:
reflectionCube
,
combine
:
THREE
.
MixOperation
,
reflectivity
:
0.1
,
perPixel
:
true
,
doubleSided
:
tru
e
}
);
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
specular
:
0xffffff
,
shininess
:
100
,
envMap
:
reflectionCube
,
combine
:
THREE
.
MixOperation
,
reflectivity
:
0.1
,
perPixel
:
true
,
side
:
THREE
.
DoubleSid
e
}
);
material
.
wrapAround
=
true
;
material
.
wrapRGB
.
set
(
0.5
,
0.5
,
0.5
);
...
...
examples/webgl_ribbons.html
浏览文件 @
9986eac6
...
...
@@ -124,7 +124,7 @@
for
(
i
=
0
;
i
<
xgrid
;
i
++
)
for
(
j
=
0
;
j
<
ygrid
;
j
++
)
{
materials
[
c
]
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffffff
,
vertexColors
:
true
,
doubleSided
:
tru
e
}
);
materials
[
c
]
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffffff
,
vertexColors
:
true
,
side
:
THREE
.
DoubleSid
e
}
);
ribbon
=
new
THREE
.
Ribbon
(
i
%
2
?
geometry
:
geometry2
,
materials
[
c
]
);
ribbon
.
rotation
.
x
=
0
;
...
...
examples/webgl_shading_physical.html
浏览文件 @
9986eac6
...
...
@@ -290,7 +290,7 @@
loader
.
load
(
"
models/animated/sittingBox.js
"
,
function
(
geometry
)
{
var
morphMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
ambient
:
0x000000
,
color
:
0x000000
,
specular
:
0xff9900
,
shininess
:
50
,
morphTargets
:
true
,
morphNormals
:
true
,
doubleSided
:
tru
e
}
);
var
morphMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
ambient
:
0x000000
,
color
:
0x000000
,
specular
:
0xff9900
,
shininess
:
50
,
morphTargets
:
true
,
morphNormals
:
true
,
side
:
THREE
.
DoubleSid
e
}
);
morphMaterial
.
shading
=
THREE
.
FlatShading
;
geometry
.
computeMorphNormals
();
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
9986eac6
...
...
@@ -5574,9 +5574,12 @@ THREE.WebGLRenderer = function ( parameters ) {
this
.
setMaterialFaces
=
function
(
material
)
{
if
(
_oldDoubleSided
!==
material
.
doubleSided
)
{
var
doubleSided
=
material
.
side
===
THREE
.
DoubleSide
;
var
flipSided
=
material
.
side
===
THREE
.
BackSide
;
if
(
material
.
doubleSided
)
{
if
(
_oldDoubleSided
!==
doubleSided
)
{
if
(
doubleSided
)
{
_gl
.
disable
(
_gl
.
CULL_FACE
);
...
...
@@ -5586,13 +5589,13 @@ THREE.WebGLRenderer = function ( parameters ) {
}
_oldDoubleSided
=
material
.
doubleSided
;
_oldDoubleSided
=
doubleSided
;
}
if
(
_oldFlipSided
!==
material
.
flipSided
)
{
if
(
_oldFlipSided
!==
flipSided
)
{
if
(
material
.
flipSided
)
{
if
(
flipSided
)
{
_gl
.
frontFace
(
_gl
.
CW
);
...
...
@@ -5602,7 +5605,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
_oldFlipSided
=
material
.
flipSided
;
_oldFlipSided
=
flipSided
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录