Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
848a1814
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,发现更多精彩内容 >>
提交
848a1814
编写于
7月 09, 2017
作者:
W
WestLangley
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
material.shading ==> material.flatShading
上级
b76e7349
变更
57
隐藏空白更改
内联
并排
Showing
57 changed file
with
113 addition
and
130 deletion
+113
-130
examples/js/crossfade/scenes.js
examples/js/crossfade/scenes.js
+1
-1
examples/js/renderers/RaytracingWorker.js
examples/js/renderers/RaytracingWorker.js
+4
-4
examples/misc_controls_orbit.html
examples/misc_controls_orbit.html
+1
-1
examples/misc_controls_pointerlock.html
examples/misc_controls_pointerlock.html
+1
-1
examples/misc_controls_trackball.html
examples/misc_controls_trackball.html
+1
-1
examples/misc_lights_test.html
examples/misc_lights_test.html
+1
-1
examples/misc_sound.html
examples/misc_sound.html
+3
-3
examples/raytracing_sandbox.html
examples/raytracing_sandbox.html
+10
-10
examples/webgl2_sandbox.html
examples/webgl2_sandbox.html
+2
-2
examples/webgl_camera_logarithmicdepthbuffer.html
examples/webgl_camera_logarithmicdepthbuffer.html
+0
-1
examples/webgl_geometry_colors.html
examples/webgl_geometry_colors.html
+2
-2
examples/webgl_geometry_colors_blender.html
examples/webgl_geometry_colors_blender.html
+0
-4
examples/webgl_geometry_teapot.html
examples/webgl_geometry_teapot.html
+4
-4
examples/webgl_geometry_text.html
examples/webgl_geometry_text.html
+2
-2
examples/webgl_geometry_text_earcut.html
examples/webgl_geometry_text_earcut.html
+2
-2
examples/webgl_geometry_text_pnltri.html
examples/webgl_geometry_text_pnltri.html
+2
-2
examples/webgl_interactive_cubes_gpu.html
examples/webgl_interactive_cubes_gpu.html
+1
-1
examples/webgl_interactive_raycasting_points.html
examples/webgl_interactive_raycasting_points.html
+1
-1
examples/webgl_lights_hemisphere.html
examples/webgl_lights_hemisphere.html
+1
-1
examples/webgl_loader_collada_kinematics.html
examples/webgl_loader_collada_kinematics.html
+2
-2
examples/webgl_loader_gltf2.html
examples/webgl_loader_gltf2.html
+1
-2
examples/webgl_loader_obj2.html
examples/webgl_loader_obj2.html
+9
-9
examples/webgl_loader_obj2_ww.html
examples/webgl_loader_obj2_ww.html
+9
-9
examples/webgl_loader_ply.html
examples/webgl_loader_ply.html
+2
-2
examples/webgl_loader_ttf.html
examples/webgl_loader_ttf.html
+1
-1
examples/webgl_marchingcubes.html
examples/webgl_marchingcubes.html
+1
-1
examples/webgl_materials.html
examples/webgl_materials.html
+8
-8
examples/webgl_materials_channels.html
examples/webgl_materials_channels.html
+2
-2
examples/webgl_materials_envmaps_hdr.html
examples/webgl_materials_envmaps_hdr.html
+2
-4
examples/webgl_materials_reflectivity.html
examples/webgl_materials_reflectivity.html
+0
-2
examples/webgl_materials_variations_basic.html
examples/webgl_materials_variations_basic.html
+1
-2
examples/webgl_materials_variations_lambert.html
examples/webgl_materials_variations_lambert.html
+1
-1
examples/webgl_materials_variations_phong.html
examples/webgl_materials_variations_phong.html
+1
-2
examples/webgl_materials_variations_standard.html
examples/webgl_materials_variations_standard.html
+1
-2
examples/webgl_materials_variations_toon.html
examples/webgl_materials_variations_toon.html
+1
-2
examples/webgl_mirror.html
examples/webgl_mirror.html
+1
-1
examples/webgl_mirror_nodes.html
examples/webgl_mirror_nodes.html
+1
-1
examples/webgl_modifier_subdivision.html
examples/webgl_modifier_subdivision.html
+1
-1
examples/webgl_morphnormals.html
examples/webgl_morphnormals.html
+2
-3
examples/webgl_multiple_canvases_circle.html
examples/webgl_multiple_canvases_circle.html
+2
-2
examples/webgl_multiple_canvases_complex.html
examples/webgl_multiple_canvases_complex.html
+2
-2
examples/webgl_multiple_canvases_grid.html
examples/webgl_multiple_canvases_grid.html
+2
-2
examples/webgl_multiple_elements.html
examples/webgl_multiple_elements.html
+1
-1
examples/webgl_multiple_renderers.html
examples/webgl_multiple_renderers.html
+2
-2
examples/webgl_multiple_views.html
examples/webgl_multiple_views.html
+2
-2
examples/webgl_postprocessing.html
examples/webgl_postprocessing.html
+1
-1
examples/webgl_postprocessing_dof.html
examples/webgl_postprocessing_dof.html
+1
-1
examples/webgl_postprocessing_glitch.html
examples/webgl_postprocessing_glitch.html
+1
-1
examples/webgl_postprocessing_godrays.html
examples/webgl_postprocessing_godrays.html
+1
-1
examples/webgl_postprocessing_nodes.html
examples/webgl_postprocessing_nodes.html
+1
-1
examples/webgl_postprocessing_unreal_bloom.html
examples/webgl_postprocessing_unreal_bloom.html
+1
-2
examples/webgl_sandbox.html
examples/webgl_sandbox.html
+2
-2
examples/webgl_shading_physical.html
examples/webgl_shading_physical.html
+1
-1
examples/webgl_shadowmap_viewer.html
examples/webgl_shadowmap_viewer.html
+2
-4
examples/webgl_shadowmesh.html
examples/webgl_shadowmesh.html
+1
-1
examples/webgl_tonemapping.html
examples/webgl_tonemapping.html
+0
-1
examples/webvr_rollercoaster.html
examples/webvr_rollercoaster.html
+4
-2
未找到文件。
examples/js/crossfade/scenes.js
浏览文件 @
848a1814
...
...
@@ -87,7 +87,7 @@ function Scene ( type, numObjects, cameraZ, fov, rotationSpeed, clearColor ) {
this
.
rotationSpeed
=
rotationSpeed
;
var
defaultMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
,
vertexColors
:
THREE
.
VertexColors
}
);
var
defaultMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
flatShading
:
true
,
vertexColors
:
THREE
.
VertexColors
}
);
this
.
mesh
=
new
THREE
.
Mesh
(
generateGeometry
(
type
,
numObjects
),
defaultMaterial
);
this
.
scene
.
add
(
this
.
mesh
);
...
...
examples/js/renderers/RaytracingWorker.js
浏览文件 @
848a1814
...
...
@@ -267,7 +267,7 @@ THREE.RaytracingRendererWorker = function () {
// the same normal can be reused for all lights
// (should be possible to cache even more)
computePixelNormal
(
normalVector
,
localPoint
,
material
.
s
hading
,
face
,
vertices
);
computePixelNormal
(
normalVector
,
localPoint
,
material
.
flatS
hading
,
face
,
vertices
);
normalVector
.
applyMatrix3
(
_object
.
normalMatrix
).
normalize
();
normalComputed
=
true
;
...
...
@@ -397,16 +397,16 @@ THREE.RaytracingRendererWorker = function () {
var
tmpVec2
=
new
THREE
.
Vector3
();
var
tmpVec3
=
new
THREE
.
Vector3
();
return
function
computePixelNormal
(
outputVector
,
point
,
s
hading
,
face
,
vertices
)
{
return
function
computePixelNormal
(
outputVector
,
point
,
flatS
hading
,
face
,
vertices
)
{
var
faceNormal
=
face
.
normal
;
var
vertexNormals
=
face
.
vertexNormals
;
if
(
shading
===
THREE
.
FlatShading
)
{
if
(
flatShading
===
true
)
{
outputVector
.
copy
(
faceNormal
);
}
else
if
(
shading
===
THREE
.
SmoothShading
)
{
}
else
{
// compute barycentric coordinates
...
...
examples/misc_controls_orbit.html
浏览文件 @
848a1814
...
...
@@ -82,7 +82,7 @@
// world
var
geometry
=
new
THREE
.
CylinderGeometry
(
0
,
10
,
30
,
4
,
1
);
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
}
);
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
flatShading
:
true
}
);
for
(
var
i
=
0
;
i
<
500
;
i
++
)
{
...
...
examples/misc_controls_pointerlock.html
浏览文件 @
848a1814
...
...
@@ -283,7 +283,7 @@
for
(
var
i
=
0
;
i
<
500
;
i
++
)
{
material
=
new
THREE
.
MeshPhongMaterial
(
{
specular
:
0xffffff
,
shading
:
THREE
.
FlatShading
,
vertexColors
:
THREE
.
VertexColors
}
);
material
=
new
THREE
.
MeshPhongMaterial
(
{
specular
:
0xffffff
,
flatShading
:
true
,
vertexColors
:
THREE
.
VertexColors
}
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
position
.
x
=
Math
.
floor
(
Math
.
random
()
*
20
-
10
)
*
20
;
...
...
examples/misc_controls_trackball.html
浏览文件 @
848a1814
...
...
@@ -85,7 +85,7 @@
scene
.
fog
=
new
THREE
.
FogExp2
(
0xcccccc
,
0.002
);
var
geometry
=
new
THREE
.
CylinderGeometry
(
0
,
10
,
30
,
4
,
1
);
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
}
);
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
flatShading
:
true
}
);
for
(
var
i
=
0
;
i
<
500
;
i
++
)
{
...
...
examples/misc_lights_test.html
浏览文件 @
848a1814
...
...
@@ -71,7 +71,7 @@
// Spheres
geometry
=
new
THREE
.
SphereGeometry
(
100
,
16
,
8
);
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
,
overdraw
:
0.5
,
shininess
:
0
}
);
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
flatShading
:
true
,
overdraw
:
0.5
,
shininess
:
0
}
);
for
(
var
i
=
0
;
i
<
30
;
i
++
)
{
...
...
examples/misc_sound.html
浏览文件 @
848a1814
...
...
@@ -86,9 +86,9 @@
var
sphere
=
new
THREE
.
SphereGeometry
(
20
,
32
,
16
);
material1
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffaa00
,
shading
:
THREE
.
FlatShading
,
shininess
:
0
}
);
material2
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xff2200
,
shading
:
THREE
.
FlatShading
,
shininess
:
0
}
);
material3
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x6622aa
,
shading
:
THREE
.
FlatShading
,
shininess
:
0
}
);
material1
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffaa00
,
flatShading
:
true
,
shininess
:
0
}
);
material2
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xff2200
,
flatShading
:
true
,
shininess
:
0
}
);
material3
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x6622aa
,
flatShading
:
true
,
shininess
:
0
}
);
// sound spheres
...
...
examples/raytracing_sandbox.html
浏览文件 @
848a1814
...
...
@@ -45,7 +45,7 @@
specular
:
0x222222
,
shininess
:
150
,
vertexColors
:
THREE
.
NoColors
,
shading
:
THREE
.
SmoothShading
flatShading
:
false
}
);
var
phongMaterialBox
=
new
THREE
.
MeshPhongMaterial
(
{
...
...
@@ -53,7 +53,7 @@
specular
:
0x111111
,
shininess
:
100
,
vertexColors
:
THREE
.
NoColors
,
shading
:
THREE
.
FlatShading
flatShading
:
true
}
);
var
phongMaterialBoxBottom
=
new
THREE
.
MeshPhongMaterial
(
{
...
...
@@ -61,7 +61,7 @@
specular
:
0x111111
,
shininess
:
100
,
vertexColors
:
THREE
.
NoColors
,
shading
:
THREE
.
FlatShading
flatShading
:
true
}
);
var
phongMaterialBoxLeft
=
new
THREE
.
MeshPhongMaterial
(
{
...
...
@@ -69,7 +69,7 @@
specular
:
0x111111
,
shininess
:
100
,
vertexColors
:
THREE
.
NoColors
,
shading
:
THREE
.
FlatShading
flatShading
:
true
}
);
var
phongMaterialBoxRight
=
new
THREE
.
MeshPhongMaterial
(
{
...
...
@@ -77,7 +77,7 @@
specular
:
0x111111
,
shininess
:
100
,
vertexColors
:
THREE
.
NoColors
,
shading
:
THREE
.
FlatShading
flatShading
:
true
}
);
var
mirrorMaterialFlat
=
new
THREE
.
MeshPhongMaterial
(
{
...
...
@@ -85,7 +85,7 @@
specular
:
0xff8888
,
shininess
:
10000
,
vertexColors
:
THREE
.
NoColors
,
shading
:
THREE
.
FlatShading
flatShading
:
true
}
);
mirrorMaterialFlat
.
mirror
=
true
;
mirrorMaterialFlat
.
reflectivity
=
1
;
...
...
@@ -95,7 +95,7 @@
specular
:
0xaaaaaa
,
shininess
:
10000
,
vertexColors
:
THREE
.
NoColors
,
shading
:
THREE
.
FlatShading
flatShading
:
true
}
);
mirrorMaterialFlatDark
.
mirror
=
true
;
mirrorMaterialFlatDark
.
reflectivity
=
1
;
...
...
@@ -105,7 +105,7 @@
specular
:
0x222222
,
shininess
:
10000
,
vertexColors
:
THREE
.
NoColors
,
shading
:
THREE
.
SmoothShading
flatShading
:
false
}
);
mirrorMaterialSmooth
.
mirror
=
true
;
mirrorMaterialSmooth
.
reflectivity
=
0.3
;
...
...
@@ -115,7 +115,7 @@
specular
:
0x00ff00
,
shininess
:
10000
,
vertexColors
:
THREE
.
NoColors
,
shading
:
THREE
.
FlatShading
flatShading
:
true
}
);
glassMaterialFlat
.
glass
=
true
;
glassMaterialFlat
.
reflectivity
=
0.5
;
...
...
@@ -125,7 +125,7 @@
specular
:
0xffaa55
,
shininess
:
10000
,
vertexColors
:
THREE
.
NoColors
,
shading
:
THREE
.
SmoothShading
flatShading
:
false
}
);
glassMaterialSmooth
.
glass
=
true
;
glassMaterialSmooth
.
reflectivity
=
0.25
;
...
...
examples/webgl2_sandbox.html
浏览文件 @
848a1814
...
...
@@ -81,8 +81,8 @@
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffaa00
,
wireframe
:
true
}
),
new
THREE
.
MeshBasicMaterial
(
{
map
:
texture1
,
fog
:
false
}
),
new
THREE
.
MeshLambertMaterial
(
{
color
:
0xdddddd
}
),
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xdddddd
,
specular
:
0x009900
,
shininess
:
30
,
shading
:
THREE
.
FlatShading
}
),
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xdddddd
,
specular
:
0x009900
,
shininess
:
30
,
shading
:
THREE
.
SmoothShading
}
)
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xdddddd
,
specular
:
0x009900
,
shininess
:
30
,
flatShading
:
true
}
),
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xdddddd
,
specular
:
0x009900
,
shininess
:
30
}
)
];
...
...
examples/webgl_camera_logarithmicdepthbuffer.html
浏览文件 @
848a1814
...
...
@@ -190,7 +190,6 @@
color
:
0xffffff
,
specular
:
0x050505
,
shininess
:
50
,
shading
:
THREE
.
SmoothShading
,
emissive
:
0x000000
};
...
...
examples/webgl_geometry_colors.html
浏览文件 @
848a1814
...
...
@@ -151,8 +151,8 @@
var
materials
=
[
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
,
vertexColors
:
THREE
.
VertexColors
,
shininess
:
0
}
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
shading
:
THREE
.
FlatShading
,
wireframe
:
true
,
transparent
:
true
}
)
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
flatShading
:
true
,
vertexColors
:
THREE
.
VertexColors
,
shininess
:
0
}
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
wireframe
:
true
,
transparent
:
true
}
)
];
...
...
examples/webgl_geometry_colors_blender.html
浏览文件 @
848a1814
...
...
@@ -105,8 +105,6 @@
function
createScene1
(
geometry
,
materials
)
{
materials
[
0
].
shading
=
THREE
.
FlatShading
;
mesh
=
new
THREE
.
Mesh
(
geometry
,
materials
);
mesh
.
position
.
x
=
400
;
mesh
.
scale
.
x
=
mesh
.
scale
.
y
=
mesh
.
scale
.
z
=
250
;
...
...
@@ -116,8 +114,6 @@
function
createScene2
(
geometry
,
materials
)
{
materials
[
0
].
shading
=
THREE
.
FlatShading
;
mesh2
=
new
THREE
.
Mesh
(
geometry
,
materials
);
mesh2
.
position
.
x
=
-
400
;
mesh2
.
scale
.
x
=
mesh2
.
scale
.
y
=
mesh2
.
scale
.
z
=
250
;
...
...
examples/webgl_geometry_teapot.html
浏览文件 @
848a1814
...
...
@@ -135,15 +135,15 @@
wireMaterial
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xFFFFFF
,
wireframe
:
true
}
)
;
flatMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
materialColor
,
specular
:
0x0
,
shading
:
THREE
.
FlatShading
,
side
:
THREE
.
DoubleSide
}
);
flatMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
materialColor
,
specular
:
0x0
00000
,
flatShading
:
true
,
side
:
THREE
.
DoubleSide
}
);
gouraudMaterial
=
new
THREE
.
MeshLambertMaterial
(
{
color
:
materialColor
,
side
:
THREE
.
DoubleSide
}
);
phongMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
materialColor
,
s
hading
:
THREE
.
SmoothShading
,
s
ide
:
THREE
.
DoubleSide
}
);
phongMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
materialColor
,
side
:
THREE
.
DoubleSide
}
);
texturedMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
materialColor
,
map
:
textureMap
,
s
hading
:
THREE
.
SmoothShading
,
s
ide
:
THREE
.
DoubleSide
}
);
texturedMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
materialColor
,
map
:
textureMap
,
side
:
THREE
.
DoubleSide
}
);
reflectiveMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
materialColor
,
envMap
:
textureCube
,
s
hading
:
THREE
.
SmoothShading
,
s
ide
:
THREE
.
DoubleSide
}
);
reflectiveMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
materialColor
,
envMap
:
textureCube
,
side
:
THREE
.
DoubleSide
}
);
// scene itself
scene
=
new
THREE
.
Scene
();
...
...
examples/webgl_geometry_text.html
浏览文件 @
848a1814
...
...
@@ -182,8 +182,8 @@
}
materials
=
[
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
}
),
// front
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
SmoothShading
}
)
// side
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
flatShading
:
true
}
),
// front
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
}
)
// side
];
group
=
new
THREE
.
Group
();
...
...
examples/webgl_geometry_text_earcut.html
浏览文件 @
848a1814
...
...
@@ -240,8 +240,8 @@
}
materials
=
[
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
}
),
// front
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
SmoothShading
}
)
// side
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
flatShading
:
true
}
),
// front
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
}
)
// side
];
group
=
new
THREE
.
Group
();
...
...
examples/webgl_geometry_text_pnltri.html
浏览文件 @
848a1814
...
...
@@ -212,8 +212,8 @@
}
materials
=
[
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
}
),
// front
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
SmoothShading
}
)
// side
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
flatShading
:
true
}
),
// front
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
}
)
// side
];
group
=
new
THREE
.
Group
();
...
...
examples/webgl_interactive_cubes_gpu.html
浏览文件 @
848a1814
...
...
@@ -86,7 +86,7 @@
var
geometry
=
new
THREE
.
Geometry
(),
pickingGeometry
=
new
THREE
.
Geometry
(),
pickingMaterial
=
new
THREE
.
MeshBasicMaterial
(
{
vertexColors
:
THREE
.
VertexColors
}
),
defaultMaterial
=
new
THREE
.
MeshPhongMaterial
({
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
,
vertexColors
:
THREE
.
VertexColors
,
shininess
:
0
}
);
defaultMaterial
=
new
THREE
.
MeshPhongMaterial
({
color
:
0xffffff
,
flatShading
:
true
,
vertexColors
:
THREE
.
VertexColors
,
shininess
:
0
}
);
function
applyVertexColors
(
g
,
c
)
{
...
...
examples/webgl_interactive_raycasting_points.html
浏览文件 @
848a1814
...
...
@@ -247,7 +247,7 @@
//
var
sphereGeometry
=
new
THREE
.
SphereGeometry
(
0.1
,
32
,
32
);
var
sphereMaterial
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xff0000
,
shading
:
THREE
.
FlatShading
}
);
var
sphereMaterial
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xff0000
}
);
for
(
var
i
=
0
;
i
<
40
;
i
++
)
{
...
...
examples/webgl_lights_hemisphere.html
浏览文件 @
848a1814
...
...
@@ -184,7 +184,7 @@
loader
.
load
(
'
models/animated/flamingo.js
'
,
function
(
geometry
)
{
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
specular
:
0xffffff
,
shininess
:
20
,
morphTargets
:
true
,
vertexColors
:
THREE
.
FaceColors
,
shading
:
THREE
.
FlatShading
}
);
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
specular
:
0xffffff
,
shininess
:
20
,
morphTargets
:
true
,
vertexColors
:
THREE
.
FaceColors
,
flatShading
:
true
}
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
var
s
=
0.35
;
...
...
examples/webgl_loader_collada_kinematics.html
浏览文件 @
848a1814
...
...
@@ -66,8 +66,8 @@
if
(
child
instanceof
THREE
.
Mesh
)
{
child
.
geometry
.
computeFaceNormals
();
child
.
material
.
shading
=
THREE
.
FlatShading
;
// model does not have normals
child
.
material
.
flatShading
=
true
;
}
...
...
examples/webgl_loader_gltf2.html
浏览文件 @
848a1814
...
...
@@ -184,8 +184,7 @@
if
(
sceneInfo
.
addGround
)
{
var
groundMaterial
=
new
THREE
.
MeshPhongMaterial
({
color
:
0xFFFFFF
,
shading
:
THREE
.
SmoothShading
color
:
0xFFFFFF
});
ground
=
new
THREE
.
Mesh
(
new
THREE
.
PlaneBufferGeometry
(
512
,
512
),
groundMaterial
);
...
...
examples/webgl_loader_obj2.html
浏览文件 @
848a1814
...
...
@@ -106,7 +106,7 @@
this
.
controls
=
null
;
this
.
smoothShading
=
tru
e
;
this
.
flatShading
=
fals
e
;
this
.
doubleSide
=
false
;
this
.
cube
=
null
;
...
...
@@ -245,14 +245,14 @@
this
.
renderer
.
render
(
this
.
scene
,
this
.
camera
);
};
OBJLoader2Example
.
prototype
.
alterS
moothS
hading
=
function
()
{
OBJLoader2Example
.
prototype
.
alterShading
=
function
()
{
var
scope
=
this
;
scope
.
smoothShading
=
!
scope
.
smooth
Shading
;
console
.
log
(
scope
.
smoothShading
?
'
Enabling SmoothShading
'
:
'
Enabling FlatS
hading
'
);
scope
.
flatShading
=
!
scope
.
flat
Shading
;
console
.
log
(
scope
.
flatShading
?
'
Enabling flat shading
'
:
'
Enabling smooth s
hading
'
);
scope
.
traversalFunction
=
function
(
material
)
{
material
.
shading
=
scope
.
smoothShading
?
THREE
.
SmoothShading
:
THREE
.
F
latShading
;
material
.
flatShading
=
scope
.
f
latShading
;
material
.
needsUpdate
=
true
;
};
var
scopeTraverse
=
function
(
object3d
)
{
...
...
@@ -304,7 +304,7 @@
// Init dat.gui and controls
var
OBJLoader2Control
=
function
()
{
this
.
smoothShading
=
app
.
smooth
Shading
;
this
.
flatShading
=
app
.
flat
Shading
;
this
.
doubleSide
=
app
.
doubleSide
;
};
var
objLoader2Control
=
new
OBJLoader2Control
();
...
...
@@ -317,10 +317,10 @@
var
menuDiv
=
document
.
getElementById
(
'
dat
'
);
menuDiv
.
appendChild
(
gui
.
domElement
);
var
folderQueue
=
gui
.
addFolder
(
'
OBJLoader2 Options
'
);
var
controlSmooth
=
folderQueue
.
add
(
objLoader2Control
,
'
smoothShading
'
).
name
(
'
Smooth
Shading
'
);
var
controlSmooth
=
folderQueue
.
add
(
objLoader2Control
,
'
flatShading
'
).
name
(
'
Flat
Shading
'
);
controlSmooth
.
onChange
(
function
(
value
)
{
console
.
log
(
'
Setting
smooth
Shading to:
'
+
value
);
app
.
alterS
moothS
hading
();
console
.
log
(
'
Setting
flat
Shading to:
'
+
value
);
app
.
alterShading
();
});
var
controlDouble
=
folderQueue
.
add
(
objLoader2Control
,
'
doubleSide
'
).
name
(
'
Double Side Materials
'
);
...
...
examples/webgl_loader_obj2_ww.html
浏览文件 @
848a1814
...
...
@@ -111,7 +111,7 @@
this
.
controls
=
null
;
this
.
smoothShading
=
tru
e
;
this
.
flatShading
=
fals
e
;
this
.
doubleSide
=
false
;
this
.
streamMeshes
=
true
;
...
...
@@ -312,14 +312,14 @@
this
.
renderer
.
render
(
this
.
scene
,
this
.
camera
);
};
WWOBJLoader2Example
.
prototype
.
alterS
moothS
hading
=
function
()
{
WWOBJLoader2Example
.
prototype
.
alterShading
=
function
()
{
var
scope
=
this
;
scope
.
smoothShading
=
!
scope
.
smooth
Shading
;
console
.
log
(
scope
.
smoothShading
?
'
Enabling SmoothShading
'
:
'
Enabling FlatS
hading
'
);
scope
.
flatShading
=
!
scope
.
flat
Shading
;
console
.
log
(
scope
.
flatShading
?
'
Enabling flat shading
'
:
'
Enabling smooth s
hading
'
);
scope
.
traversalFunction
=
function
(
material
)
{
material
.
shading
=
scope
.
smoothShading
?
THREE
.
SmoothShading
:
THREE
.
F
latShading
;
material
.
flatShading
=
scope
.
f
latShading
;
material
.
needsUpdate
=
true
;
};
var
scopeTraverse
=
function
(
object3d
)
{
...
...
@@ -408,7 +408,7 @@
// Init dat.gui and controls
var
elemFileInput
=
document
.
getElementById
(
'
fileUploadInput
'
);
var
WWOBJLoader2Control
=
function
()
{
this
.
smoothShading
=
app
.
smooth
Shading
;
this
.
flatShading
=
app
.
flat
Shading
;
this
.
doubleSide
=
app
.
doubleSide
;
this
.
streamMeshes
=
app
.
streamMeshes
;
};
...
...
@@ -422,10 +422,10 @@
var
menuDiv
=
document
.
getElementById
(
'
dat
'
);
menuDiv
.
appendChild
(
gui
.
domElement
);
var
folderOptions
=
gui
.
addFolder
(
'
WWOBJLoader2 Options
'
);
var
controlSmooth
=
folderOptions
.
add
(
wwObjLoader2Control
,
'
smoothShading
'
).
name
(
'
Smooth
Shading
'
);
var
controlSmooth
=
folderOptions
.
add
(
wwObjLoader2Control
,
'
flatShading
'
).
name
(
'
Flat
Shading
'
);
controlSmooth
.
onChange
(
function
(
value
)
{
console
.
log
(
'
Setting
smooth
Shading to:
'
+
value
);
app
.
alterS
moothS
hading
();
console
.
log
(
'
Setting
flat
Shading to:
'
+
value
);
app
.
alterShading
();
});
var
controlDouble
=
folderOptions
.
add
(
wwObjLoader2Control
,
'
doubleSide
'
).
name
(
'
Double Side Materials
'
);
...
...
examples/webgl_loader_ply.html
浏览文件 @
848a1814
...
...
@@ -94,7 +94,7 @@
geometry
.
computeVertexNormals
();
var
material
=
new
THREE
.
MeshStandardMaterial
(
{
color
:
0x0055ff
,
shading
:
THREE
.
FlatShading
}
);
var
material
=
new
THREE
.
MeshStandardMaterial
(
{
color
:
0x0055ff
,
flatShading
:
true
}
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
position
.
y
=
-
0.2
;
...
...
@@ -113,7 +113,7 @@
geometry
.
computeVertexNormals
();
var
material
=
new
THREE
.
MeshStandardMaterial
(
{
color
:
0x0055ff
,
shading
:
THREE
.
FlatShading
}
);
var
material
=
new
THREE
.
MeshStandardMaterial
(
{
color
:
0x0055ff
,
flatShading
:
true
}
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
position
.
x
=
-
0.2
;
...
...
examples/webgl_loader_ttf.html
浏览文件 @
848a1814
...
...
@@ -100,7 +100,7 @@
pointLight
.
color
.
setHSL
(
Math
.
random
(),
1
,
0.5
);
scene
.
add
(
pointLight
);
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
}
);
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
flatShading
:
true
}
);
group
=
new
THREE
.
Group
();
group
.
position
.
y
=
100
;
...
...
examples/webgl_marchingcubes.html
浏览文件 @
848a1814
...
...
@@ -313,7 +313,7 @@
"
flat
"
:
{
m
:
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x000000
,
specular
:
0x111111
,
shininess
:
1
,
shading
:
THREE
.
FlatShading
}
),
m
:
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x000000
,
specular
:
0x111111
,
shininess
:
1
,
flatShading
:
true
}
),
h
:
0
,
s
:
0
,
l
:
1
},
...
...
examples/webgl_materials.html
浏览文件 @
848a1814
...
...
@@ -56,21 +56,21 @@
texture
.
needsUpdate
=
true
;
materials
.
push
(
new
THREE
.
MeshLambertMaterial
(
{
map
:
texture
,
transparent
:
true
}
)
);
materials
.
push
(
new
THREE
.
MeshLambertMaterial
(
{
color
:
0xdddddd
,
shading
:
THREE
.
FlatShading
}
)
);
materials
.
push
(
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xdddddd
,
specular
:
0x009900
,
shininess
:
30
,
shading
:
THREE
.
FlatShading
}
)
);
materials
.
push
(
new
THREE
.
MeshNormalMaterial
(
)
);
materials
.
push
(
new
THREE
.
MeshLambertMaterial
(
{
color
:
0xdddddd
}
)
);
materials
.
push
(
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xdddddd
,
specular
:
0x009900
,
shininess
:
30
,
flatShading
:
true
}
)
);
materials
.
push
(
new
THREE
.
MeshNormalMaterial
()
);
materials
.
push
(
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffaa00
,
transparent
:
true
,
blending
:
THREE
.
AdditiveBlending
}
)
);
//materials.push( new THREE.MeshBasicMaterial( { color: 0xff0000, blending: THREE.SubtractiveBlending } ) );
materials
.
push
(
new
THREE
.
MeshLambertMaterial
(
{
color
:
0xdddddd
,
shading
:
THREE
.
SmoothShading
}
)
);
materials
.
push
(
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xdddddd
,
specular
:
0x009900
,
shininess
:
30
,
shading
:
THREE
.
SmoothShading
,
map
:
texture
,
transparent
:
true
}
)
);
materials
.
push
(
new
THREE
.
MeshNormalMaterial
(
{
shading
:
THREE
.
SmoothShading
}
)
);
materials
.
push
(
new
THREE
.
MeshLambertMaterial
(
{
color
:
0xdddddd
}
)
);
materials
.
push
(
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xdddddd
,
specular
:
0x009900
,
shininess
:
30
,
map
:
texture
,
transparent
:
true
}
)
);
materials
.
push
(
new
THREE
.
MeshNormalMaterial
(
{
flatShading
:
true
}
)
);
materials
.
push
(
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffaa00
,
wireframe
:
true
}
)
);
materials
.
push
(
new
THREE
.
MeshDepthMaterial
()
);
materials
.
push
(
new
THREE
.
MeshLambertMaterial
(
{
color
:
0x666666
,
emissive
:
0xff0000
,
shading
:
THREE
.
SmoothShading
}
)
);
materials
.
push
(
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x000000
,
specular
:
0x666666
,
emissive
:
0xff0000
,
shininess
:
10
,
shading
:
THREE
.
SmoothShading
,
opacity
:
0.9
,
transparent
:
true
}
)
);
materials
.
push
(
new
THREE
.
MeshLambertMaterial
(
{
color
:
0x666666
,
emissive
:
0xff0000
}
)
);
materials
.
push
(
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x000000
,
specular
:
0x666666
,
emissive
:
0xff0000
,
shininess
:
10
,
opacity
:
0.9
,
transparent
:
true
}
)
);
materials
.
push
(
new
THREE
.
MeshBasicMaterial
(
{
map
:
texture
,
transparent
:
true
}
)
);
...
...
examples/webgl_materials_channels.html
浏览文件 @
848a1814
...
...
@@ -166,7 +166,7 @@
normalMap
:
normalMap
,
normalScale
:
new
THREE
.
Vector2
(
1
,
-
1
),
//
shading: THREE.FlatShading
,
//
flatShading: true
,
side
:
THREE
.
DoubleSide
}
);
...
...
@@ -199,7 +199,7 @@
normalMap
:
normalMap
,
normalScale
:
new
THREE
.
Vector2
(
1
,
-
1
),
//
shading: THREE.FlatShading
,
//
flatShading: true
,
side
:
THREE
.
DoubleSide
}
);
...
...
examples/webgl_materials_envmaps_hdr.html
浏览文件 @
848a1814
...
...
@@ -94,8 +94,7 @@
bumpScale
:
-
0.05
,
color
:
0xff4444
,
metalness
:
0.5
,
roughness
:
1.0
,
shading
:
THREE
.
SmoothShading
roughness
:
1.0
}
);
var
geometry
=
new
THREE
.
TorusKnotGeometry
(
18
,
8
,
150
,
20
);
...
...
@@ -111,8 +110,7 @@
roughnessMap
:
null
,
color
:
0xffffff
,
metalness
:
0.0
,
roughness
:
0.0
,
shading
:
THREE
.
SmoothShading
roughness
:
0.0
}
);
var
planeGeometry
=
new
THREE
.
PlaneBufferGeometry
(
200
,
200
);
...
...
examples/webgl_materials_reflectivity.html
浏览文件 @
848a1814
...
...
@@ -95,7 +95,6 @@
opacity
:
0.5
,
side
:
THREE
.
BackSide
,
transparent
:
true
,
shading
:
THREE
.
SmoothShading
,
envMapIntensity
:
5
,
premultipliedAlpha
:
true
// TODO: Add custom blend mode that modulates background color by this materials color.
...
...
@@ -109,7 +108,6 @@
opacity
:
0.15
,
side
:
THREE
.
FrontSide
,
transparent
:
true
,
shading
:
THREE
.
SmoothShading
,
envMapIntensity
:
5
,
premultipliedAlpha
:
true
}
);
...
...
examples/webgl_materials_variations_basic.html
浏览文件 @
848a1814
...
...
@@ -76,7 +76,7 @@
imgTexture
.
anisotropy
=
16
;
imgTexture
=
null
;
var
shininess
=
50
,
specular
=
0x333333
,
shading
=
THREE
.
SmoothShading
;
var
shininess
=
50
,
specular
=
0x333333
;
var
materials
=
[];
...
...
@@ -99,7 +99,6 @@
map
:
imgTexture
,
color
:
diffuseColor
,
reflectivity
:
beta
,
shading
:
THREE
.
SmoothShading
,
envMap
:
alpha
<
0.5
?
reflectionCube
:
null
}
);
...
...
examples/webgl_materials_variations_lambert.html
浏览文件 @
848a1814
...
...
@@ -76,7 +76,7 @@
imgTexture
.
anisotropy
=
16
;
imgTexture
=
null
;
var
shininess
=
50
,
specular
=
0x333333
,
shading
=
THREE
.
SmoothShading
;
var
shininess
=
50
,
specular
=
0x333333
;
var
materials
=
[];
...
...
examples/webgl_materials_variations_phong.html
浏览文件 @
848a1814
...
...
@@ -76,7 +76,7 @@
imgTexture
.
anisotropy
=
16
;
imgTexture
=
null
;
var
shininess
=
50
,
specular
=
0x333333
,
bumpScale
=
1
,
shading
=
THREE
.
SmoothShading
;
var
shininess
=
50
,
specular
=
0x333333
,
bumpScale
=
1
;
var
materials
=
[];
...
...
@@ -108,7 +108,6 @@
specular
:
specularColor
,
reflectivity
:
beta
,
shininess
:
specularShininess
,
shading
:
THREE
.
SmoothShading
,
envMap
:
alphaIndex
%
2
===
0
?
null
:
reflectionCube
}
);
...
...
examples/webgl_materials_variations_standard.html
浏览文件 @
848a1814
...
...
@@ -101,7 +101,7 @@
hdrCubeRenderTarget
=
pmremCubeUVPacker
.
CubeUVRenderTarget
;
var
shininess
=
50
,
specular
=
0x333333
,
bumpScale
=
1
,
shading
=
THREE
.
SmoothShading
;
var
shininess
=
50
,
specular
=
0x333333
,
bumpScale
=
1
;
var
materials
=
[];
...
...
@@ -130,7 +130,6 @@
color
:
diffuseColor
,
metalness
:
beta
,
roughness
:
1.0
-
alpha
,
shading
:
THREE
.
SmoothShading
,
envMap
:
index
%
2
===
0
?
null
:
hdrCubeRenderTarget
.
texture
}
);
...
...
examples/webgl_materials_variations_toon.html
浏览文件 @
848a1814
...
...
@@ -78,7 +78,7 @@
imgTexture
.
anisotropy
=
16
;
imgTexture
=
null
;
var
shininess
=
50
,
specular
=
0x333333
,
bumpScale
=
1
,
shading
=
THREE
.
SmoothShading
;
var
shininess
=
50
,
specular
=
0x333333
,
bumpScale
=
1
;
var
materials
=
[];
...
...
@@ -110,7 +110,6 @@
specular
:
specularColor
,
reflectivity
:
beta
,
shininess
:
specularShininess
,
shading
:
THREE
.
SmoothShading
,
envMap
:
alphaIndex
%
2
===
0
?
null
:
reflectionCube
}
);
...
...
examples/webgl_mirror.html
浏览文件 @
848a1814
...
...
@@ -127,7 +127,7 @@
sphereGroup
.
add
(
halfSphere
);
var
geometry
=
new
THREE
.
IcosahedronGeometry
(
5
,
0
);
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
emissive
:
0x333333
,
shading
:
THREE
.
FlatShading
}
);
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
emissive
:
0x333333
,
flatShading
:
true
}
);
smallSphere
=
new
THREE
.
Mesh
(
geometry
,
material
);
scene
.
add
(
smallSphere
);
...
...
examples/webgl_mirror_nodes.html
浏览文件 @
848a1814
...
...
@@ -229,7 +229,7 @@
sphereGroup
.
add
(
halfSphere
);
var
geometry
=
new
THREE
.
IcosahedronGeometry
(
5
,
0
);
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
emissive
:
0x333333
,
shading
:
THREE
.
FlatShading
}
);
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
emissive
:
0x333333
,
flatShading
:
true
}
);
smallSphere
=
new
THREE
.
Mesh
(
geometry
,
material
);
scene
.
add
(
smallSphere
);
...
...
examples/webgl_modifier_subdivision.html
浏览文件 @
848a1814
...
...
@@ -235,7 +235,7 @@
group
.
add
(
mesh
);
var
meshmaterials
=
[
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
,
vertexColors
:
THREE
.
VertexColors
}
),
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
flatShading
:
true
,
vertexColors
:
THREE
.
VertexColors
}
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
wireframe
:
true
,
opacity
:
0.15
,
transparent
:
true
}
)
];
...
...
examples/webgl_morphnormals.html
浏览文件 @
848a1814
...
...
@@ -77,7 +77,7 @@
color
:
0xffffff
,
morphTargets
:
true
,
vertexColors
:
THREE
.
FaceColors
,
shading
:
THREE
.
FlatShading
flatShading
:
true
}
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
...
...
@@ -103,8 +103,7 @@
color
:
0xffffff
,
morphTargets
:
true
,
morphNormals
:
true
,
vertexColors
:
THREE
.
FaceColors
,
shading
:
THREE
.
SmoothShading
vertexColors
:
THREE
.
FaceColors
}
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
...
...
examples/webgl_multiple_canvases_circle.html
浏览文件 @
848a1814
...
...
@@ -285,8 +285,8 @@
var
materials
=
[
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
,
vertexColors
:
THREE
.
VertexColors
,
shininess
:
0
}
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
shading
:
THREE
.
FlatShading
,
wireframe
:
true
}
)
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
flatShading
:
true
,
vertexColors
:
THREE
.
VertexColors
,
shininess
:
0
}
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
wireframe
:
true
,
transparent
:
true
}
)
];
...
...
examples/webgl_multiple_canvases_complex.html
浏览文件 @
848a1814
...
...
@@ -209,8 +209,8 @@
var
materials
=
[
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
,
vertexColors
:
THREE
.
VertexColors
,
shininess
:
0
}
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
shading
:
THREE
.
FlatShading
,
wireframe
:
true
,
transparent
:
true
}
)
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
flatShading
:
true
,
vertexColors
:
THREE
.
VertexColors
,
shininess
:
0
}
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
wireframe
:
true
,
transparent
:
true
}
)
];
...
...
examples/webgl_multiple_canvases_grid.html
浏览文件 @
848a1814
...
...
@@ -226,8 +226,8 @@
var
materials
=
[
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
,
vertexColors
:
THREE
.
VertexColors
,
shininess
:
0
}
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
shading
:
THREE
.
FlatShading
,
wireframe
:
true
,
transparent
:
true
}
)
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
flatShading
:
true
,
vertexColors
:
THREE
.
VertexColors
,
shininess
:
0
}
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
wireframe
:
true
,
transparent
:
true
}
)
];
...
...
examples/webgl_multiple_elements.html
浏览文件 @
848a1814
...
...
@@ -140,7 +140,7 @@
color
:
new
THREE
.
Color
().
setHSL
(
Math
.
random
(),
1
,
0.75
),
roughness
:
0.5
,
metalness
:
0
,
shading
:
THREE
.
FlatShading
flatShading
:
true
}
);
...
...
examples/webgl_multiple_renderers.html
浏览文件 @
848a1814
...
...
@@ -140,8 +140,8 @@
var
materials
=
[
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
,
vertexColors
:
THREE
.
VertexColors
,
shininess
:
0
}
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
shading
:
THREE
.
FlatShading
,
wireframe
:
true
,
transparent
:
true
}
)
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
flatShading
:
true
,
vertexColors
:
THREE
.
VertexColors
,
shininess
:
0
}
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
wireframe
:
true
,
transparent
:
true
}
)
];
...
...
examples/webgl_multiple_views.html
浏览文件 @
848a1814
...
...
@@ -203,8 +203,8 @@
var
materials
=
[
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
,
vertexColors
:
THREE
.
VertexColors
,
shininess
:
0
}
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
shading
:
THREE
.
FlatShading
,
wireframe
:
true
,
transparent
:
true
}
)
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
flatShading
:
true
,
vertexColors
:
THREE
.
VertexColors
,
shininess
:
0
}
),
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
wireframe
:
true
,
transparent
:
true
}
)
];
...
...
examples/webgl_postprocessing.html
浏览文件 @
848a1814
...
...
@@ -52,7 +52,7 @@
scene
.
add
(
object
);
var
geometry
=
new
THREE
.
SphereGeometry
(
1
,
4
,
4
);
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
shading
:
THREE
.
FlatShading
}
);
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
,
flatShading
:
true
}
);
for
(
var
i
=
0
;
i
<
100
;
i
++
)
{
...
...
examples/webgl_postprocessing_dof.html
浏览文件 @
848a1814
...
...
@@ -103,7 +103,7 @@
var
textureCube
=
new
THREE
.
CubeTextureLoader
().
load
(
urls
);
parameters
=
{
color
:
0xff1100
,
envMap
:
textureCube
,
shading
:
THREE
.
FlatShading
};
parameters
=
{
color
:
0xff1100
,
envMap
:
textureCube
};
cubeMaterial
=
new
THREE
.
MeshBasicMaterial
(
parameters
);
singleMaterial
=
false
;
...
...
examples/webgl_postprocessing_glitch.html
浏览文件 @
848a1814
...
...
@@ -80,7 +80,7 @@
for
(
var
i
=
0
;
i
<
100
;
i
++
)
{
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
*
Math
.
random
(),
shading
:
THREE
.
FlatShading
}
);
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xffffff
*
Math
.
random
(),
flatShading
:
true
}
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
position
.
set
(
Math
.
random
()
-
0.5
,
Math
.
random
()
-
0.5
,
Math
.
random
()
-
0.5
).
normalize
();
...
...
examples/webgl_postprocessing_godrays.html
浏览文件 @
848a1814
...
...
@@ -86,7 +86,7 @@
materialDepth
=
new
THREE
.
MeshDepthMaterial
();
var
materialScene
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
,
shading
:
THREE
.
FlatShading
}
);
var
materialScene
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0x000000
}
);
// tree
...
...
examples/webgl_postprocessing_nodes.html
浏览文件 @
848a1814
...
...
@@ -521,7 +521,7 @@
for
(
var
i
=
0
;
i
<
100
;
i
++
)
{
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x888888
+
(
Math
.
random
()
*
0x888888
),
shading
:
THREE
.
FlatShading
}
);
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x888888
+
(
Math
.
random
()
*
0x888888
),
flatShading
:
true
}
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
position
.
set
(
Math
.
random
()
-
0.5
,
Math
.
random
()
-
0.5
,
Math
.
random
()
-
0.5
).
normalize
();
mesh
.
position
.
multiplyScalar
(
Math
.
random
()
*
400
);
...
...
examples/webgl_postprocessing_unreal_bloom.html
浏览文件 @
848a1814
...
...
@@ -102,8 +102,7 @@
standardMaterial
=
new
THREE
.
MeshStandardMaterial
(
{
map
:
null
,
color
:
0xffffff
,
metalness
:
1.0
,
shading
:
THREE
.
SmoothShading
metalness
:
1.0
}
);
var
geometry
=
new
THREE
.
TorusKnotGeometry
(
18
,
8
,
150
,
20
);
...
...
examples/webgl_sandbox.html
浏览文件 @
848a1814
...
...
@@ -91,8 +91,8 @@
new
THREE
.
ShaderMaterial
(
{
uniforms
:
uniforms
,
vertexShader
:
vertexShader
,
fragmentShader
:
fragmentShader
,
transparent
:
true
}
),
new
THREE
.
MeshLambertMaterial
(
{
map
:
texture2
}
),
new
THREE
.
MeshLambertMaterial
(
{
color
:
0xdddddd
}
),
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xdddddd
,
specular
:
0x009900
,
shininess
:
30
,
shading
:
THREE
.
FlatShading
}
),
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xdddddd
,
specular
:
0x009900
,
shininess
:
30
,
shading
:
THREE
.
SmoothShading
}
)
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xdddddd
,
specular
:
0x009900
,
shininess
:
30
,
flatShading
:
true
}
),
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xdddddd
,
specular
:
0x009900
,
shininess
:
30
}
)
];
...
...
examples/webgl_shading_physical.html
浏览文件 @
848a1814
...
...
@@ -213,7 +213,7 @@
loader
.
load
(
"
models/animated/sittingBox.js
"
,
function
(
geometry
)
{
var
morphMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x000000
,
specular
:
0xff9900
,
shininess
:
50
,
morphTargets
:
true
,
side
:
THREE
.
DoubleSide
,
shading
:
THREE
.
FlatShading
}
);
var
morphMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0x000000
,
specular
:
0xff9900
,
shininess
:
50
,
morphTargets
:
true
,
side
:
THREE
.
DoubleSide
,
flatShading
:
true
}
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
morphMaterial
);
...
...
examples/webgl_shadowmap_viewer.html
浏览文件 @
848a1814
...
...
@@ -105,8 +105,7 @@
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xff0000
,
shininess
:
150
,
specular
:
0x222222
,
shading
:
THREE
.
SmoothShading
specular
:
0x222222
}
);
torusKnot
=
new
THREE
.
Mesh
(
geometry
,
material
);
...
...
@@ -127,8 +126,7 @@
var
material
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
0xa0adaf
,
shininess
:
150
,
specular
:
0xffffff
,
shading
:
THREE
.
SmoothShading
specular
:
0x111111
}
);
var
ground
=
new
THREE
.
Mesh
(
geometry
,
material
);
...
...
examples/webgl_shadowmesh.html
浏览文件 @
848a1814
...
...
@@ -163,7 +163,7 @@
// YELLOW PYRAMID and PYRAMID'S SHADOW
var
pyramidGeometry
=
new
THREE
.
CylinderGeometry
(
0
,
0.5
,
2
,
4
);
var
pyramidMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
'
rgb(255,255,0)
'
,
emissive
:
0x440000
,
shading
:
THREE
.
FlatShading
,
shininess
:
0
}
);
var
pyramidMaterial
=
new
THREE
.
MeshPhongMaterial
(
{
color
:
'
rgb(255,255,0)
'
,
emissive
:
0x440000
,
flatShading
:
true
,
shininess
:
0
}
);
pyramid
=
new
THREE
.
Mesh
(
pyramidGeometry
,
pyramidMaterial
);
pyramid
.
position
.
set
(
-
4
,
1
,
2
);
scene
.
add
(
pyramid
);
...
...
examples/webgl_tonemapping.html
浏览文件 @
848a1814
...
...
@@ -96,7 +96,6 @@
color
:
0xffffff
,
metalness
:
0.9
,
roughness
:
0.8
,
shading
:
THREE
.
SmoothShading
,
premultipliedAlpha
:
true
,
transparent
:
true
}
);
...
...
examples/webvr_rollercoaster.html
浏览文件 @
848a1814
...
...
@@ -165,7 +165,8 @@
var
geometry
=
new
THREE
.
CylinderBufferGeometry
(
10
,
10
,
5
,
15
);
var
material
=
new
THREE
.
MeshLambertMaterial
(
{
color
:
0xff8080
,
shading
:
THREE
.
FlatShading
color
:
0xff8080
,
//flatShading: true // Lambert does not support flat shading
}
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
position
.
set
(
-
80
,
10
,
-
70
);
...
...
@@ -176,7 +177,8 @@
var
geometry
=
new
THREE
.
CylinderBufferGeometry
(
5
,
6
,
4
,
10
);
var
material
=
new
THREE
.
MeshLambertMaterial
(
{
color
:
0x8080ff
,
shading
:
THREE
.
FlatShading
color
:
0x8080ff
,
//flatShading: true // Lambert does not support flat shading
}
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
position
.
set
(
50
,
2
,
30
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录