Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
fktz008
three.js
提交
aaaf14a0
T
three.js
项目概览
fktz008
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
aaaf14a0
编写于
3月 06, 2012
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed bug in emissive for Lambert. Added emissive balls to webgl_materials example.
上级
1f87cf0b
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
257 addition
and
246 deletion
+257
-246
build/Three.js
build/Three.js
+104
-104
build/custom/ThreeCanvas.js
build/custom/ThreeCanvas.js
+8
-8
build/custom/ThreeSVG.js
build/custom/ThreeSVG.js
+8
-8
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+115
-115
examples/webgl_materials.html
examples/webgl_materials.html
+12
-4
src/materials/MeshBasicMaterial.js
src/materials/MeshBasicMaterial.js
+1
-0
src/materials/MeshLambertMaterial.js
src/materials/MeshLambertMaterial.js
+1
-0
src/materials/MeshPhongMaterial.js
src/materials/MeshPhongMaterial.js
+1
-0
src/renderers/WebGLShaders.js
src/renderers/WebGLShaders.js
+7
-7
未找到文件。
build/Three.js
浏览文件 @
aaaf14a0
此差异已折叠。
点击以展开。
build/custom/ThreeCanvas.js
浏览文件 @
aaaf14a0
...
...
@@ -114,14 +114,14 @@ THREE.LineBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.col
THREE
.
MeshBasicMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
color
=
void
0
!==
a
.
color
?
new
THREE
.
Color
(
a
.
color
):
new
THREE
.
Color
(
16777215
);
this
.
map
=
void
0
!==
a
.
map
?
a
.
map
:
null
;
this
.
lightMap
=
void
0
!==
a
.
lightMap
?
a
.
lightMap
:
null
;
this
.
envMap
=
void
0
!==
a
.
envMap
?
a
.
envMap
:
null
;
this
.
combine
=
void
0
!==
a
.
combine
?
a
.
combine
:
THREE
.
MultiplyOperation
;
this
.
reflectivity
=
void
0
!==
a
.
reflectivity
?
a
.
reflectivity
:
1
;
this
.
refractionRatio
=
void
0
!==
a
.
refractionRatio
?
a
.
refractionRatio
:
0.98
;
this
.
fog
=
void
0
!==
a
.
fog
?
a
.
fog
:
!
0
;
this
.
shading
=
void
0
!==
a
.
shading
?
a
.
shading
:
THREE
.
SmoothShading
;
this
.
wireframe
=
void
0
!==
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
void
0
!==
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
;
this
.
wireframeLinecap
=
void
0
!==
a
.
wireframeLinecap
?
a
.
wireframeLinecap
:
"
round
"
;
this
.
wireframeLinejoin
=
void
0
!==
a
.
wireframeLinejoin
?
a
.
wireframeLinejoin
:
"
round
"
;
this
.
vertexColors
=
void
0
!==
a
.
vertexColors
?
a
.
vertexColors
:
!
1
;
this
.
skinning
=
void
0
!==
a
.
skinning
?
a
.
skinning
:
!
1
;
this
.
morphTargets
=
void
0
!==
a
.
morphTargets
?
a
.
morphTargets
:
!
1
};
THREE
.
MeshBasicMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
MeshBasicMaterial
.
prototype
.
constructor
=
THREE
.
MeshBasicMaterial
;
THREE
.
MeshLambertMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
color
=
void
0
!==
a
.
color
?
new
THREE
.
Color
(
a
.
color
):
new
THREE
.
Color
(
16777215
);
this
.
ambient
=
void
0
!==
a
.
ambient
?
new
THREE
.
Color
(
a
.
ambient
):
new
THREE
.
Color
(
16777215
);
this
.
wrapAround
=
void
0
!==
a
.
wrapAround
?
a
.
wrapAround
:
!
1
;
this
.
wrapRGB
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
map
=
void
0
!==
a
.
map
?
a
.
map
:
null
;
this
.
lightMap
=
void
0
!==
a
.
lightMap
?
a
.
lightMap
:
null
;
this
.
envMap
=
void
0
!==
a
.
envMap
?
a
.
envMap
:
null
;
this
.
combine
=
void
0
!==
a
.
combine
?
a
.
combine
:
THREE
.
MultiplyOperation
;
this
.
reflectivity
=
void
0
!==
a
.
reflectivity
?
a
.
reflectivity
:
1
;
this
.
refractionRatio
=
void
0
!==
a
.
refractionRatio
?
a
.
refractionRatio
:
0.98
;
this
.
fog
=
void
0
!==
a
.
fog
?
a
.
fog
:
!
0
;
this
.
shading
=
void
0
!==
a
.
shading
?
a
.
shading
:
THREE
.
SmoothShading
;
this
.
wireframe
=
void
0
!==
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
void
0
!==
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
;
this
.
wireframeLinecap
=
void
0
!==
a
.
wireframeLinecap
?
a
.
wireframeLinecap
:
"
round
"
;
this
.
wireframeLinejoin
=
void
0
!==
a
.
wireframeLinejoin
?
a
.
wireframeLinejoin
:
"
round
"
;
this
.
vertexColors
=
void
0
!==
a
.
vertexColors
?
a
.
vertexColors
:
!
1
;
this
.
skinning
=
void
0
!==
a
.
skinning
?
a
.
skinning
:
!
1
;
this
.
morphTargets
=
void
0
!==
a
.
morphTargets
?
a
.
morphTargets
:
!
1
;
this
.
morphNormals
=
void
0
!==
a
.
morphNormals
?
a
.
morphNormals
:
!
1
};
THREE
.
MeshLambertMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
MeshLambertMaterial
.
prototype
.
constructor
=
THREE
.
MeshLambertMaterial
;
THREE
.
MeshPhongMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
color
=
void
0
!==
a
.
color
?
new
THREE
.
Color
(
a
.
color
):
new
THREE
.
Color
(
16777215
);
this
.
ambient
=
void
0
!==
a
.
ambient
?
new
THREE
.
Color
(
a
.
ambient
):
new
THREE
.
Color
(
16777215
);
this
.
specular
=
void
0
!==
a
.
specular
?
new
THREE
.
Color
(
a
.
specular
):
new
THREE
.
Color
(
1118481
);
this
.
shininess
=
void
0
!==
a
.
shininess
?
a
.
shininess
:
30
;
this
.
metal
=
void
0
!==
a
.
metal
?
a
.
metal
:
!
1
;
this
.
perPixel
=
void
0
!==
a
.
perPixel
?
a
.
perPixel
:
!
1
;
this
.
wrapAround
=
void
0
!==
a
.
wrapAround
?
a
.
wrapAround
:
!
1
;
this
.
wrapRGB
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
map
=
void
0
!==
a
.
map
?
a
.
map
:
null
;
this
.
lightMap
=
void
0
!==
a
.
lightMap
?
a
.
lightMap
:
null
;
this
.
envMap
=
void
0
!==
a
.
envMap
?
a
.
envMap
:
null
;
this
.
combine
=
void
0
!==
a
.
combine
?
a
.
combine
:
THREE
.
MultiplyOperation
;
this
.
reflectivity
=
void
0
!==
a
.
reflectivity
?
a
.
reflectivity
:
1
;
this
.
refractionRatio
=
void
0
!==
a
.
refractionRatio
?
a
.
refractionRatio
:
0.98
;
this
.
fog
=
void
0
!==
a
.
fog
?
a
.
fog
:
!
0
;
this
.
shading
=
void
0
!==
a
.
shading
?
a
.
shading
:
THREE
.
SmoothShading
;
this
.
wireframe
=
void
0
!==
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
void
0
!==
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
;
this
.
wireframeLinecap
=
void
0
!==
a
.
wireframeLinecap
?
a
.
wireframeLinecap
:
"
round
"
;
this
.
wireframeLinejoin
=
void
0
!==
a
.
wireframeLinejoin
?
a
.
wireframeLinejoin
:
"
round
"
;
this
.
vertexColors
=
void
0
!==
a
.
vertexColors
?
a
.
vertexColors
:
!
1
;
this
.
skinning
=
void
0
!==
a
.
skinning
?
a
.
skinning
:
!
1
;
this
.
morphTargets
=
void
0
!==
a
.
morphTargets
?
a
.
morphTargets
:
!
1
;
this
.
morphNormals
=
void
0
!==
a
.
morphNormals
?
a
.
morphNormals
:
!
1
};
THREE
.
MeshPhongMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
MeshPhongMaterial
.
prototype
.
constructor
=
THREE
.
MeshPhongMaterial
;
THREE
.
MeshDepthMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
shading
=
void
0
!==
a
.
shading
?
a
.
shading
:
THREE
.
SmoothShading
;
this
.
wireframe
=
void
0
!==
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
void
0
!==
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
};
THREE
.
MeshDepthMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
MeshDepthMaterial
.
prototype
.
constructor
=
THREE
.
MeshDepth
Material
;
THREE
.
MeshNormalMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
shading
=
a
.
shading
?
a
.
shading
:
THREE
.
FlatShading
;
this
.
wireframe
=
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
};
THREE
.
MeshNormalMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
MeshNormalMaterial
.
prototype
.
constructor
=
THREE
.
MeshNormalMaterial
;
THREE
.
MeshFaceMaterial
=
function
(){};
THREE
.
MeshLambertMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
color
=
void
0
!==
a
.
color
?
new
THREE
.
Color
(
a
.
color
):
new
THREE
.
Color
(
16777215
);
this
.
ambient
=
void
0
!==
a
.
ambient
?
new
THREE
.
Color
(
a
.
ambient
):
new
THREE
.
Color
(
16777215
);
this
.
emissive
=
void
0
!==
a
.
emissive
?
new
THREE
.
Color
(
a
.
emissive
):
new
THREE
.
Color
(
0
);
this
.
wrapAround
=
void
0
!==
a
.
wrapAround
?
a
.
wrapAround
:
!
1
;
this
.
wrapRGB
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
map
=
void
0
!==
a
.
map
?
a
.
map
:
null
;
this
.
lightMap
=
void
0
!==
a
.
lightMap
?
a
.
lightMap
:
null
;
this
.
envMap
=
void
0
!==
a
.
envMap
?
a
.
envMap
:
null
;
this
.
combine
=
void
0
!==
a
.
combine
?
a
.
combine
:
THREE
.
MultiplyOperation
;
this
.
reflectivity
=
void
0
!==
a
.
reflectivity
?
a
.
reflectivity
:
1
;
this
.
refractionRatio
=
void
0
!==
a
.
refractionRatio
?
a
.
refractionRatio
:
0.98
;
this
.
fog
=
void
0
!==
a
.
fog
?
a
.
fog
:
!
0
;
this
.
shading
=
void
0
!==
a
.
shading
?
a
.
shading
:
THREE
.
SmoothShading
;
this
.
wireframe
=
void
0
!==
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
void
0
!==
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
;
this
.
wireframeLinecap
=
void
0
!==
a
.
wireframeLinecap
?
a
.
wireframeLine
cap
:
"
round
"
;
this
.
wireframeLinejoin
=
void
0
!==
a
.
wireframeLinejoin
?
a
.
wireframeLine
join
:
"
round
"
;
this
.
vertexColors
=
void
0
!==
a
.
vertexColors
?
a
.
vertexColors
:
!
1
;
this
.
skinning
=
void
0
!==
a
.
skinning
?
a
.
skinning
:
!
1
;
this
.
morphTargets
=
void
0
!==
a
.
morphTargets
?
a
.
morphTargets
:
!
1
;
this
.
morphNormals
=
void
0
!==
a
.
morphNormals
?
a
.
morphNormals
:
!
1
};
THREE
.
MeshLambertMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
MeshLambertMaterial
.
prototype
.
constructor
=
THREE
.
MeshLambertMaterial
;
THREE
.
MeshPhongMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
color
=
void
0
!==
a
.
color
?
new
THREE
.
Color
(
a
.
color
):
new
THREE
.
Color
(
16777215
);
this
.
ambient
=
void
0
!==
a
.
ambient
?
new
THREE
.
Color
(
a
.
ambient
):
new
THREE
.
Color
(
16777215
);
this
.
emissive
=
void
0
!==
a
.
emissive
?
new
THREE
.
Color
(
a
.
emissive
):
new
THREE
.
Color
(
0
);
this
.
specular
=
void
0
!==
a
.
specular
?
new
THREE
.
Color
(
a
.
specular
):
new
THREE
.
Color
(
1118481
);
this
.
shininess
=
void
0
!==
a
.
shininess
?
a
.
shininess
:
30
;
this
.
metal
=
void
0
!==
a
.
metal
?
a
.
metal
:
!
1
;
this
.
perPixel
=
void
0
!==
a
.
perPixel
?
a
.
perPixel
:
!
1
;
this
.
wrapAround
=
void
0
!==
a
.
wrapAround
?
a
.
wrapAround
:
!
1
;
this
.
wrapRGB
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
map
=
void
0
!==
a
.
map
?
a
.
map
:
null
;
this
.
lightMap
=
void
0
!==
a
.
lightMap
?
a
.
lightMap
:
null
;
this
.
envMap
=
void
0
!==
a
.
envMap
?
a
.
envMap
:
null
;
this
.
combine
=
void
0
!==
a
.
combine
?
a
.
combine
:
THREE
.
MultiplyOperation
;
this
.
reflectivity
=
void
0
!==
a
.
reflectivity
?
a
.
reflectivity
:
1
;
this
.
refractionRatio
=
void
0
!==
a
.
refractionRatio
?
a
.
refractionRatio
:
0.98
;
this
.
fog
=
void
0
!==
a
.
fog
?
a
.
fog
:
!
0
;
this
.
shading
=
void
0
!==
a
.
shading
?
a
.
shading
:
THREE
.
SmoothShading
;
this
.
wireframe
=
void
0
!==
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
void
0
!==
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
;
this
.
wireframeLinecap
=
void
0
!==
a
.
wireframeLinecap
?
a
.
wireframeLinecap
:
"
round
"
;
this
.
wireframeLinejoin
=
void
0
!==
a
.
wireframeLinejoin
?
a
.
wireframeLinejoin
:
"
round
"
;
this
.
vertexColors
=
void
0
!==
a
.
vertexColors
?
a
.
vertexColors
:
!
1
;
this
.
skinning
=
void
0
!==
a
.
skinning
?
a
.
skinning
:
!
1
;
this
.
morphTargets
=
void
0
!==
a
.
morphTargets
?
a
.
morphTargets
:
!
1
;
this
.
morphNormals
=
void
0
!==
a
.
morphNormals
?
a
.
morphNormals
:
!
1
};
THREE
.
MeshPhongMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
MeshPhongMaterial
.
prototype
.
constructor
=
THREE
.
MeshPhongMaterial
;
THREE
.
MeshDepthMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
shading
=
void
0
!==
a
.
shading
?
a
.
shading
:
THREE
.
SmoothShading
;
this
.
wireframe
=
void
0
!==
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
void
0
!==
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
};
THREE
.
MeshDepthMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
Mesh
DepthMaterial
.
prototype
.
constructor
=
THREE
.
MeshDepthMaterial
;
THREE
.
Mesh
NormalMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
shading
=
a
.
shading
?
a
.
shading
:
THREE
.
FlatShading
;
this
.
wireframe
=
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
};
THREE
.
MeshNormalMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
MeshNormalMaterial
.
prototype
.
constructor
=
THREE
.
MeshNormalMaterial
;
THREE
.
MeshFaceMaterial
=
function
(){};
THREE
.
ParticleBasicMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
color
=
void
0
!==
a
.
color
?
new
THREE
.
Color
(
a
.
color
):
new
THREE
.
Color
(
16777215
);
this
.
map
=
void
0
!==
a
.
map
?
a
.
map
:
null
;
this
.
size
=
void
0
!==
a
.
size
?
a
.
size
:
1
;
this
.
sizeAttenuation
=
void
0
!==
a
.
sizeAttenuation
?
a
.
sizeAttenuation
:
!
0
;
this
.
vertexColors
=
void
0
!==
a
.
vertexColors
?
a
.
vertexColors
:
!
1
;
this
.
fog
=
void
0
!==
a
.
fog
?
a
.
fog
:
!
0
};
THREE
.
ParticleBasicMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
ParticleBasicMaterial
.
prototype
.
constructor
=
THREE
.
ParticleBasicMaterial
;
THREE
.
ParticleCanvasMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
color
=
void
0
!==
a
.
color
?
new
THREE
.
Color
(
a
.
color
):
new
THREE
.
Color
(
16777215
);
this
.
program
=
void
0
!==
a
.
program
?
a
.
program
:
function
(){}};
THREE
.
ParticleCanvasMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
ParticleCanvasMaterial
.
prototype
.
constructor
=
THREE
.
ParticleCanvasMaterial
;
THREE
.
Texture
=
function
(
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
){
this
.
id
=
THREE
.
TextureCount
++
;
this
.
image
=
a
;
this
.
mapping
=
void
0
!==
b
?
b
:
new
THREE
.
UVMapping
;
this
.
wrapS
=
void
0
!==
c
?
c
:
THREE
.
ClampToEdgeWrapping
;
this
.
wrapT
=
void
0
!==
d
?
d
:
THREE
.
ClampToEdgeWrapping
;
this
.
magFilter
=
void
0
!==
e
?
e
:
THREE
.
LinearFilter
;
this
.
minFilter
=
void
0
!==
f
?
f
:
THREE
.
LinearMipMapLinearFilter
;
this
.
format
=
void
0
!==
g
?
g
:
THREE
.
RGBAFormat
;
this
.
type
=
void
0
!==
h
?
h
:
THREE
.
UnsignedByteType
;
this
.
offset
=
new
THREE
.
Vector2
(
0
,
0
);
this
.
repeat
=
new
THREE
.
Vector2
(
1
,
1
);
this
.
generateMipmaps
=
...
...
build/custom/ThreeSVG.js
浏览文件 @
aaaf14a0
...
...
@@ -113,14 +113,14 @@ THREE.LineBasicMaterial=function(a){THREE.Material.call(this,a);a=a||{};this.col
THREE
.
MeshBasicMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
color
=
void
0
!==
a
.
color
?
new
THREE
.
Color
(
a
.
color
):
new
THREE
.
Color
(
16777215
);
this
.
map
=
void
0
!==
a
.
map
?
a
.
map
:
null
;
this
.
lightMap
=
void
0
!==
a
.
lightMap
?
a
.
lightMap
:
null
;
this
.
envMap
=
void
0
!==
a
.
envMap
?
a
.
envMap
:
null
;
this
.
combine
=
void
0
!==
a
.
combine
?
a
.
combine
:
THREE
.
MultiplyOperation
;
this
.
reflectivity
=
void
0
!==
a
.
reflectivity
?
a
.
reflectivity
:
1
;
this
.
refractionRatio
=
void
0
!==
a
.
refractionRatio
?
a
.
refractionRatio
:
0.98
;
this
.
fog
=
void
0
!==
a
.
fog
?
a
.
fog
:
!
0
;
this
.
shading
=
void
0
!==
a
.
shading
?
a
.
shading
:
THREE
.
SmoothShading
;
this
.
wireframe
=
void
0
!==
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
void
0
!==
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
;
this
.
wireframeLinecap
=
void
0
!==
a
.
wireframeLinecap
?
a
.
wireframeLinecap
:
"
round
"
;
this
.
wireframeLinejoin
=
void
0
!==
a
.
wireframeLinejoin
?
a
.
wireframeLinejoin
:
"
round
"
;
this
.
vertexColors
=
void
0
!==
a
.
vertexColors
?
a
.
vertexColors
:
!
1
;
this
.
skinning
=
void
0
!==
a
.
skinning
?
a
.
skinning
:
!
1
;
this
.
morphTargets
=
void
0
!==
a
.
morphTargets
?
a
.
morphTargets
:
!
1
};
THREE
.
MeshBasicMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
MeshBasicMaterial
.
prototype
.
constructor
=
THREE
.
MeshBasicMaterial
;
THREE
.
MeshLambertMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
color
=
void
0
!==
a
.
color
?
new
THREE
.
Color
(
a
.
color
):
new
THREE
.
Color
(
16777215
);
this
.
ambient
=
void
0
!==
a
.
ambient
?
new
THREE
.
Color
(
a
.
ambient
):
new
THREE
.
Color
(
16777215
);
this
.
wrapAround
=
void
0
!==
a
.
wrapAround
?
a
.
wrapAround
:
!
1
;
this
.
wrapRGB
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
map
=
void
0
!==
a
.
map
?
a
.
map
:
null
;
this
.
lightMap
=
void
0
!==
a
.
lightMap
?
a
.
lightMap
:
null
;
this
.
envMap
=
void
0
!==
a
.
envMap
?
a
.
envMap
:
null
;
this
.
combine
=
void
0
!==
a
.
combine
?
a
.
combine
:
THREE
.
MultiplyOperation
;
this
.
reflectivity
=
void
0
!==
a
.
reflectivity
?
a
.
reflectivity
:
1
;
this
.
refractionRatio
=
void
0
!==
a
.
refractionRatio
?
a
.
refractionRatio
:
0.98
;
this
.
fog
=
void
0
!==
a
.
fog
?
a
.
fog
:
!
0
;
this
.
shading
=
void
0
!==
a
.
shading
?
a
.
shading
:
THREE
.
SmoothShading
;
this
.
wireframe
=
void
0
!==
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
void
0
!==
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
;
this
.
wireframeLinecap
=
void
0
!==
a
.
wireframeLinecap
?
a
.
wireframeLinecap
:
"
round
"
;
this
.
wireframeLinejoin
=
void
0
!==
a
.
wireframeLinejoin
?
a
.
wireframeLinejoin
:
"
round
"
;
this
.
vertexColors
=
void
0
!==
a
.
vertexColors
?
a
.
vertexColors
:
!
1
;
this
.
skinning
=
void
0
!==
a
.
skinning
?
a
.
skinning
:
!
1
;
this
.
morphTargets
=
void
0
!==
a
.
morphTargets
?
a
.
morphTargets
:
!
1
;
this
.
morphNormals
=
void
0
!==
a
.
morphNormals
?
a
.
morphNormals
:
!
1
};
THREE
.
MeshLambertMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
MeshLambertMaterial
.
prototype
.
constructor
=
THREE
.
MeshLambertMaterial
;
THREE
.
MeshPhongMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
color
=
void
0
!==
a
.
color
?
new
THREE
.
Color
(
a
.
color
):
new
THREE
.
Color
(
16777215
);
this
.
ambient
=
void
0
!==
a
.
ambient
?
new
THREE
.
Color
(
a
.
ambient
):
new
THREE
.
Color
(
16777215
);
this
.
specular
=
void
0
!==
a
.
specular
?
new
THREE
.
Color
(
a
.
specular
):
new
THREE
.
Color
(
1118481
);
this
.
shininess
=
void
0
!==
a
.
shininess
?
a
.
shininess
:
30
;
this
.
metal
=
void
0
!==
a
.
metal
?
a
.
metal
:
!
1
;
this
.
perPixel
=
void
0
!==
a
.
perPixel
?
a
.
perPixel
:
!
1
;
this
.
wrapAround
=
void
0
!==
a
.
wrapAround
?
a
.
wrapAround
:
!
1
;
this
.
wrapRGB
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
map
=
void
0
!==
a
.
map
?
a
.
map
:
null
;
this
.
lightMap
=
void
0
!==
a
.
lightMap
?
a
.
lightMap
:
null
;
this
.
envMap
=
void
0
!==
a
.
envMap
?
a
.
envMap
:
null
;
this
.
combine
=
void
0
!==
a
.
combine
?
a
.
combine
:
THREE
.
MultiplyOperation
;
this
.
reflectivity
=
void
0
!==
a
.
reflectivity
?
a
.
reflectivity
:
1
;
this
.
refractionRatio
=
void
0
!==
a
.
refractionRatio
?
a
.
refractionRatio
:
0.98
;
this
.
fog
=
void
0
!==
a
.
fog
?
a
.
fog
:
!
0
;
this
.
shading
=
void
0
!==
a
.
shading
?
a
.
shading
:
THREE
.
SmoothShading
;
this
.
wireframe
=
void
0
!==
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
void
0
!==
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
;
this
.
wireframeLinecap
=
void
0
!==
a
.
wireframeLinecap
?
a
.
wireframeLinecap
:
"
round
"
;
this
.
wireframeLinejoin
=
void
0
!==
a
.
wireframeLinejoin
?
a
.
wireframeLinejoin
:
"
round
"
;
this
.
vertexColors
=
void
0
!==
a
.
vertexColors
?
a
.
vertexColors
:
!
1
;
this
.
skinning
=
void
0
!==
a
.
skinning
?
a
.
skinning
:
!
1
;
this
.
morphTargets
=
void
0
!==
a
.
morphTargets
?
a
.
morphTargets
:
!
1
;
this
.
morphNormals
=
void
0
!==
a
.
morphNormals
?
a
.
morphNormals
:
!
1
};
THREE
.
MeshPhongMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
MeshPhongMaterial
.
prototype
.
constructor
=
THREE
.
MeshPhongMaterial
;
THREE
.
MeshDepthMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
shading
=
void
0
!==
a
.
shading
?
a
.
shading
:
THREE
.
SmoothShading
;
this
.
wireframe
=
void
0
!==
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
void
0
!==
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
};
THREE
.
MeshDepthMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
MeshDepthMaterial
.
prototype
.
constructor
=
THREE
.
MeshDepth
Material
;
THREE
.
MeshNormalMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
shading
=
a
.
shading
?
a
.
shading
:
THREE
.
FlatShading
;
this
.
wireframe
=
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
};
THREE
.
MeshNormalMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
MeshNormalMaterial
.
prototype
.
constructor
=
THREE
.
MeshNormalMaterial
;
THREE
.
MeshFaceMaterial
=
function
(){};
THREE
.
MeshLambertMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
color
=
void
0
!==
a
.
color
?
new
THREE
.
Color
(
a
.
color
):
new
THREE
.
Color
(
16777215
);
this
.
ambient
=
void
0
!==
a
.
ambient
?
new
THREE
.
Color
(
a
.
ambient
):
new
THREE
.
Color
(
16777215
);
this
.
emissive
=
void
0
!==
a
.
emissive
?
new
THREE
.
Color
(
a
.
emissive
):
new
THREE
.
Color
(
0
);
this
.
wrapAround
=
void
0
!==
a
.
wrapAround
?
a
.
wrapAround
:
!
1
;
this
.
wrapRGB
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
map
=
void
0
!==
a
.
map
?
a
.
map
:
null
;
this
.
lightMap
=
void
0
!==
a
.
lightMap
?
a
.
lightMap
:
null
;
this
.
envMap
=
void
0
!==
a
.
envMap
?
a
.
envMap
:
null
;
this
.
combine
=
void
0
!==
a
.
combine
?
a
.
combine
:
THREE
.
MultiplyOperation
;
this
.
reflectivity
=
void
0
!==
a
.
reflectivity
?
a
.
reflectivity
:
1
;
this
.
refractionRatio
=
void
0
!==
a
.
refractionRatio
?
a
.
refractionRatio
:
0.98
;
this
.
fog
=
void
0
!==
a
.
fog
?
a
.
fog
:
!
0
;
this
.
shading
=
void
0
!==
a
.
shading
?
a
.
shading
:
THREE
.
SmoothShading
;
this
.
wireframe
=
void
0
!==
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
void
0
!==
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
;
this
.
wireframeLinecap
=
void
0
!==
a
.
wireframeLinecap
?
a
.
wireframeLine
cap
:
"
round
"
;
this
.
wireframeLinejoin
=
void
0
!==
a
.
wireframeLinejoin
?
a
.
wireframeLine
join
:
"
round
"
;
this
.
vertexColors
=
void
0
!==
a
.
vertexColors
?
a
.
vertexColors
:
!
1
;
this
.
skinning
=
void
0
!==
a
.
skinning
?
a
.
skinning
:
!
1
;
this
.
morphTargets
=
void
0
!==
a
.
morphTargets
?
a
.
morphTargets
:
!
1
;
this
.
morphNormals
=
void
0
!==
a
.
morphNormals
?
a
.
morphNormals
:
!
1
};
THREE
.
MeshLambertMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
MeshLambertMaterial
.
prototype
.
constructor
=
THREE
.
MeshLambertMaterial
;
THREE
.
MeshPhongMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
color
=
void
0
!==
a
.
color
?
new
THREE
.
Color
(
a
.
color
):
new
THREE
.
Color
(
16777215
);
this
.
ambient
=
void
0
!==
a
.
ambient
?
new
THREE
.
Color
(
a
.
ambient
):
new
THREE
.
Color
(
16777215
);
this
.
emissive
=
void
0
!==
a
.
emissive
?
new
THREE
.
Color
(
a
.
emissive
):
new
THREE
.
Color
(
0
);
this
.
specular
=
void
0
!==
a
.
specular
?
new
THREE
.
Color
(
a
.
specular
):
new
THREE
.
Color
(
1118481
);
this
.
shininess
=
void
0
!==
a
.
shininess
?
a
.
shininess
:
30
;
this
.
metal
=
void
0
!==
a
.
metal
?
a
.
metal
:
!
1
;
this
.
perPixel
=
void
0
!==
a
.
perPixel
?
a
.
perPixel
:
!
1
;
this
.
wrapAround
=
void
0
!==
a
.
wrapAround
?
a
.
wrapAround
:
!
1
;
this
.
wrapRGB
=
new
THREE
.
Vector3
(
1
,
1
,
1
);
this
.
map
=
void
0
!==
a
.
map
?
a
.
map
:
null
;
this
.
lightMap
=
void
0
!==
a
.
lightMap
?
a
.
lightMap
:
null
;
this
.
envMap
=
void
0
!==
a
.
envMap
?
a
.
envMap
:
null
;
this
.
combine
=
void
0
!==
a
.
combine
?
a
.
combine
:
THREE
.
MultiplyOperation
;
this
.
reflectivity
=
void
0
!==
a
.
reflectivity
?
a
.
reflectivity
:
1
;
this
.
refractionRatio
=
void
0
!==
a
.
refractionRatio
?
a
.
refractionRatio
:
0.98
;
this
.
fog
=
void
0
!==
a
.
fog
?
a
.
fog
:
!
0
;
this
.
shading
=
void
0
!==
a
.
shading
?
a
.
shading
:
THREE
.
SmoothShading
;
this
.
wireframe
=
void
0
!==
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
void
0
!==
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
;
this
.
wireframeLinecap
=
void
0
!==
a
.
wireframeLinecap
?
a
.
wireframeLinecap
:
"
round
"
;
this
.
wireframeLinejoin
=
void
0
!==
a
.
wireframeLinejoin
?
a
.
wireframeLinejoin
:
"
round
"
;
this
.
vertexColors
=
void
0
!==
a
.
vertexColors
?
a
.
vertexColors
:
!
1
;
this
.
skinning
=
void
0
!==
a
.
skinning
?
a
.
skinning
:
!
1
;
this
.
morphTargets
=
void
0
!==
a
.
morphTargets
?
a
.
morphTargets
:
!
1
;
this
.
morphNormals
=
void
0
!==
a
.
morphNormals
?
a
.
morphNormals
:
!
1
};
THREE
.
MeshPhongMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
MeshPhongMaterial
.
prototype
.
constructor
=
THREE
.
MeshPhongMaterial
;
THREE
.
MeshDepthMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
shading
=
void
0
!==
a
.
shading
?
a
.
shading
:
THREE
.
SmoothShading
;
this
.
wireframe
=
void
0
!==
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
void
0
!==
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
};
THREE
.
MeshDepthMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
Mesh
DepthMaterial
.
prototype
.
constructor
=
THREE
.
MeshDepthMaterial
;
THREE
.
Mesh
NormalMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
shading
=
a
.
shading
?
a
.
shading
:
THREE
.
FlatShading
;
this
.
wireframe
=
a
.
wireframe
?
a
.
wireframe
:
!
1
;
this
.
wireframeLinewidth
=
a
.
wireframeLinewidth
?
a
.
wireframeLinewidth
:
1
};
THREE
.
MeshNormalMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
MeshNormalMaterial
.
prototype
.
constructor
=
THREE
.
MeshNormalMaterial
;
THREE
.
MeshFaceMaterial
=
function
(){};
THREE
.
ParticleBasicMaterial
=
function
(
a
){
THREE
.
Material
.
call
(
this
,
a
);
a
=
a
||
{};
this
.
color
=
void
0
!==
a
.
color
?
new
THREE
.
Color
(
a
.
color
):
new
THREE
.
Color
(
16777215
);
this
.
map
=
void
0
!==
a
.
map
?
a
.
map
:
null
;
this
.
size
=
void
0
!==
a
.
size
?
a
.
size
:
1
;
this
.
sizeAttenuation
=
void
0
!==
a
.
sizeAttenuation
?
a
.
sizeAttenuation
:
!
0
;
this
.
vertexColors
=
void
0
!==
a
.
vertexColors
?
a
.
vertexColors
:
!
1
;
this
.
fog
=
void
0
!==
a
.
fog
?
a
.
fog
:
!
0
};
THREE
.
ParticleBasicMaterial
.
prototype
=
new
THREE
.
Material
;
THREE
.
ParticleBasicMaterial
.
prototype
.
constructor
=
THREE
.
ParticleBasicMaterial
;
THREE
.
Texture
=
function
(
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
){
this
.
id
=
THREE
.
TextureCount
++
;
this
.
image
=
a
;
this
.
mapping
=
void
0
!==
b
?
b
:
new
THREE
.
UVMapping
;
this
.
wrapS
=
void
0
!==
c
?
c
:
THREE
.
ClampToEdgeWrapping
;
this
.
wrapT
=
void
0
!==
d
?
d
:
THREE
.
ClampToEdgeWrapping
;
this
.
magFilter
=
void
0
!==
e
?
e
:
THREE
.
LinearFilter
;
this
.
minFilter
=
void
0
!==
f
?
f
:
THREE
.
LinearMipMapLinearFilter
;
this
.
format
=
void
0
!==
g
?
g
:
THREE
.
RGBAFormat
;
this
.
type
=
void
0
!==
h
?
h
:
THREE
.
UnsignedByteType
;
this
.
offset
=
new
THREE
.
Vector2
(
0
,
0
);
this
.
repeat
=
new
THREE
.
Vector2
(
1
,
1
);
this
.
generateMipmaps
=
!
0
;
this
.
needsUpdate
=!
1
;
this
.
onUpdate
=
null
};
THREE
.
Texture
.
prototype
=
{
constructor
:
THREE
.
Texture
,
clone
:
function
(){
var
a
=
new
THREE
.
Texture
(
this
.
image
,
this
.
mapping
,
this
.
wrapS
,
this
.
wrapT
,
this
.
magFilter
,
this
.
minFilter
,
this
.
format
,
this
.
type
);
a
.
offset
.
copy
(
this
.
offset
);
a
.
repeat
.
copy
(
this
.
repeat
);
return
a
}};
THREE
.
TextureCount
=
0
;
THREE
.
MultiplyOperation
=
0
;
THREE
.
MixOperation
=
1
;
THREE
.
CubeReflectionMapping
=
function
(){};
THREE
.
CubeRefractionMapping
=
function
(){};
THREE
.
LatitudeReflectionMapping
=
function
(){};
...
...
build/custom/ThreeWebGL.js
浏览文件 @
aaaf14a0
此差异已折叠。
点击以展开。
examples/webgl_materials.html
浏览文件 @
aaaf14a0
...
...
@@ -29,6 +29,8 @@
var
camera
,
scene
,
renderer
,
objects
;
var
particleLight
,
pointLight
;
var
materials
=
[];
init
();
animate
();
...
...
@@ -68,7 +70,6 @@
var
texture
=
new
THREE
.
Texture
(
generateTexture
()
);
texture
.
needsUpdate
=
true
;
var
materials
=
[];
materials
.
push
(
new
THREE
.
MeshLambertMaterial
(
{
map
:
texture
,
transparent
:
true
}
)
);
materials
.
push
(
new
THREE
.
MeshLambertMaterial
(
{
color
:
0xdddddd
,
shading
:
THREE
.
FlatShading
}
)
);
materials
.
push
(
new
THREE
.
MeshPhongMaterial
(
{
ambient
:
0x030303
,
color
:
0xdddddd
,
specular
:
0x009900
,
shininess
:
30
,
shading
:
THREE
.
FlatShading
}
)
);
...
...
@@ -82,6 +83,10 @@
materials
.
push
(
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffaa00
,
wireframe
:
true
}
)
);
materials
.
push
(
new
THREE
.
MeshDepthMaterial
()
);
materials
.
push
(
new
THREE
.
MeshLambertMaterial
(
{
color
:
0x666666
,
emissive
:
0xff0000
,
ambient
:
0x000000
,
shading
:
THREE
.
SmoothShading
}
)
);
materials
.
push
(
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x000000
,
specular
:
0x666666
,
emissive
:
0xff0000
,
ambient
:
0x000000
,
shininess
:
10
,
shading
:
THREE
.
SmoothShading
,
opacity
:
0.9
,
transparent
:
true
}
)
);
materials
.
push
(
new
THREE
.
MeshBasicMaterial
(
{
map
:
texture
,
transparent
:
true
}
)
);
// Spheres geometry
...
...
@@ -141,9 +146,9 @@
// Lights
scene
.
add
(
new
THREE
.
AmbientLight
(
0x
202020
)
);
scene
.
add
(
new
THREE
.
AmbientLight
(
0x
111111
)
);
var
directionalLight
=
new
THREE
.
DirectionalLight
(
Math
.
random
()
*
0xffffff
);
var
directionalLight
=
new
THREE
.
DirectionalLight
(
/*Math.random() * */
0xffffff
,
0.125
);
directionalLight
.
position
.
x
=
Math
.
random
()
-
0.5
;
directionalLight
.
position
.
y
=
Math
.
random
()
-
0.5
;
...
...
@@ -158,7 +163,7 @@
//
renderer
=
new
THREE
.
WebGLRenderer
();
renderer
=
new
THREE
.
WebGLRenderer
(
{
antialias
:
true
}
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
container
.
appendChild
(
renderer
.
domElement
);
...
...
@@ -231,6 +236,9 @@
}
materials
[
materials
.
length
-
3
].
emissive
.
setHSV
(
0.54
,
1
,
0.7
*
(
0.5
+
0.5
*
Math
.
sin
(
35
*
timer
)
)
);
materials
[
materials
.
length
-
4
].
emissive
.
setHSV
(
0.04
,
1
,
0.7
*
(
0.5
+
0.5
*
Math
.
cos
(
35
*
timer
)
)
);
particleLight
.
position
.
x
=
Math
.
sin
(
timer
*
7
)
*
300
;
particleLight
.
position
.
y
=
Math
.
cos
(
timer
*
5
)
*
400
;
particleLight
.
position
.
z
=
Math
.
cos
(
timer
*
3
)
*
300
;
...
...
src/materials/MeshBasicMaterial.js
浏览文件 @
aaaf14a0
...
...
@@ -35,6 +35,7 @@ THREE.MeshBasicMaterial = function ( parameters ) {
parameters
=
parameters
||
{};
// color property represents emissive for MeshBasicMaterial
this
.
color
=
parameters
.
color
!==
undefined
?
new
THREE
.
Color
(
parameters
.
color
)
:
new
THREE
.
Color
(
0xffffff
);
this
.
map
=
parameters
.
map
!==
undefined
?
parameters
.
map
:
null
;
...
...
src/materials/MeshLambertMaterial.js
浏览文件 @
aaaf14a0
...
...
@@ -38,6 +38,7 @@ THREE.MeshLambertMaterial = function ( parameters ) {
parameters
=
parameters
||
{};
// color property represents diffuse for MeshLambertMaterial
this
.
color
=
parameters
.
color
!==
undefined
?
new
THREE
.
Color
(
parameters
.
color
)
:
new
THREE
.
Color
(
0xffffff
);
this
.
ambient
=
parameters
.
ambient
!==
undefined
?
new
THREE
.
Color
(
parameters
.
ambient
)
:
new
THREE
.
Color
(
0xffffff
);
this
.
emissive
=
parameters
.
emissive
!==
undefined
?
new
THREE
.
Color
(
parameters
.
emissive
)
:
new
THREE
.
Color
(
0x000000
);
...
...
src/materials/MeshPhongMaterial.js
浏览文件 @
aaaf14a0
...
...
@@ -40,6 +40,7 @@ THREE.MeshPhongMaterial = function ( parameters ) {
parameters
=
parameters
||
{};
// color property represents diffuse for MeshPhongMaterial
this
.
color
=
parameters
.
color
!==
undefined
?
new
THREE
.
Color
(
parameters
.
color
)
:
new
THREE
.
Color
(
0xffffff
);
this
.
ambient
=
parameters
.
ambient
!==
undefined
?
new
THREE
.
Color
(
parameters
.
ambient
)
:
new
THREE
.
Color
(
0xffffff
);
this
.
emissive
=
parameters
.
emissive
!==
undefined
?
new
THREE
.
Color
(
parameters
.
emissive
)
:
new
THREE
.
Color
(
0x000000
);
...
...
src/renderers/WebGLShaders.js
浏览文件 @
aaaf14a0
...
...
@@ -295,11 +295,11 @@ THREE.ShaderChunk = {
lights_lambert_vertex
:
[
"
vLightFront = vec3(
emissive
);
"
,
"
vLightFront = vec3(
0.0
);
"
,
"
#ifdef DOUBLE_SIDED
"
,
"
vLightBack = vec3(
emissive
);
"
,
"
vLightBack = vec3(
0.0
);
"
,
"
#endif
"
,
...
...
@@ -405,11 +405,11 @@ THREE.ShaderChunk = {
"
#endif
"
,
"
vLightFront = vLightFront * diffuse + ambient * ambientLightColor;
"
,
"
vLightFront = vLightFront * diffuse + ambient * ambientLightColor
+ emissive
;
"
,
"
#ifdef DOUBLE_SIDED
"
,
"
vLightBack = vLightBack * diffuse + ambient * ambientLightColor;
"
,
"
vLightBack = vLightBack * diffuse + ambient * ambientLightColor
+ emissive
;
"
,
"
#endif
"
,
...
...
@@ -1387,8 +1387,8 @@ THREE.ShaderLib = {
THREE
.
UniformsLib
[
"
shadowmap
"
],
{
"
ambient
"
:
{
type
:
"
c
"
,
value
:
new
THREE
.
Color
(
0x
050505
)
},
"
emissive
"
:
{
type
:
"
c
"
,
value
:
new
THREE
.
Color
(
0x000000
)
},
"
ambient
"
:
{
type
:
"
c
"
,
value
:
new
THREE
.
Color
(
0x
ffffff
)
},
"
emissive
"
:
{
type
:
"
c
"
,
value
:
new
THREE
.
Color
(
0x000000
)
},
"
wrapRGB
"
:
{
type
:
"
v3
"
,
value
:
new
THREE
.
Vector3
(
1
,
1
,
1
)
}
}
...
...
@@ -1502,7 +1502,7 @@ THREE.ShaderLib = {
THREE
.
UniformsLib
[
"
shadowmap
"
],
{
"
ambient
"
:
{
type
:
"
c
"
,
value
:
new
THREE
.
Color
(
0x
050505
)
},
"
ambient
"
:
{
type
:
"
c
"
,
value
:
new
THREE
.
Color
(
0x
ffffff
)
},
"
emissive
"
:
{
type
:
"
c
"
,
value
:
new
THREE
.
Color
(
0x000000
)
},
"
specular
"
:
{
type
:
"
c
"
,
value
:
new
THREE
.
Color
(
0x111111
)
},
"
shininess
"
:
{
type
:
"
f
"
,
value
:
30
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录