Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
d2bbdef5
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,发现更多精彩内容 >>
提交
d2bbdef5
编写于
6月 14, 2016
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improved webgl_tonemapping example.
上级
6b23c9a6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
21 deletion
+23
-21
examples/webgl_tonemapping.html
examples/webgl_tonemapping.html
+23
-21
未找到文件。
examples/webgl_tonemapping.html
浏览文件 @
d2bbdef5
...
...
@@ -79,7 +79,7 @@
Cineon
:
THREE
.
CineonToneMapping
};
var
camera
,
scene
,
renderer
,
controls
,
objects
=
[]
;
var
camera
,
scene
,
renderer
,
controls
,
group
;
var
composer
;
var
standardMaterial
,
standardMaterialPremultiplied
,
floorMaterial
;
...
...
@@ -97,7 +97,6 @@
scene
=
new
THREE
.
Scene
();
renderer
=
new
THREE
.
WebGLRenderer
(
{
antialias
:
false
}
);
renderer
.
setClearColor
(
new
THREE
.
Color
(
0xffffff
)
);
standardMaterial
=
new
THREE
.
MeshStandardMaterial
(
{
bumpScale
:
-
0.05
,
...
...
@@ -135,29 +134,30 @@
standardMaterial
.
needsUpdate
=
true
;
}
);
group
=
new
THREE
.
Group
();
scene
.
add
(
group
);
var
geometry
=
new
THREE
.
TorusKnotGeometry
(
18
,
8
,
150
,
20
);;
var
torusMesh1
=
new
THREE
.
Mesh
(
geometry
,
standardMaterial
);
torusMesh1
.
position
.
x
=
0.0
;
torusMesh1
.
castShadow
=
true
;
torusMesh1
.
receiveShadow
=
true
;
scene
.
add
(
torusMesh1
);
objects
.
push
(
torusMesh1
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
standardMaterial
);
mesh
.
castShadow
=
true
;
mesh
.
receiveShadow
=
true
;
group
.
add
(
mesh
);
floorMaterial
=
new
THREE
.
MeshStandardMaterial
(
{
map
:
null
,
roughnessMap
:
null
,
color
:
0x
ffffff
,
color
:
0x
888888
,
metalness
:
0.0
,
roughness
:
0
.0
,
s
hading
:
THREE
.
SmoothShading
roughness
:
1
.0
,
s
ide
:
THREE
.
BackSide
}
);
var
planeGeometry
=
new
THREE
.
PlaneBufferGeometry
(
200
,
200
);
var
planeMesh1
=
new
THREE
.
Mesh
(
planeG
eometry
,
floorMaterial
);
planeMesh1
.
position
.
y
=
-
50
;
planeMesh1
.
rotation
.
x
=
-
Math
.
PI
*
0.5
;
planeMesh1
.
receiveShadow
=
true
;
scene
.
add
(
planeMesh1
);
var
geometry
=
new
THREE
.
BoxBufferGeometry
(
200
,
200
,
200
);
var
mesh
=
new
THREE
.
Mesh
(
g
eometry
,
floorMaterial
);
mesh
.
position
.
y
=
50
;
mesh
.
rotation
.
x
=
-
Math
.
PI
*
0.5
;
mesh
.
receiveShadow
=
true
;
scene
.
add
(
mesh
);
// Materials
var
hdrpath
=
"
../examples/textures/cube/hdrPisa/
"
;
...
...
@@ -183,12 +183,14 @@
// Lights
scene
.
add
(
new
THREE
.
AmbientLight
(
0x222222
)
);
scene
.
add
(
new
THREE
.
HemisphereLight
(
0x111111
,
0x000000
)
);
var
spotLight
=
new
THREE
.
SpotLight
(
0xffffff
);
spotLight
.
position
.
set
(
50
,
100
,
50
);
spotLight
.
angle
=
Math
.
PI
/
7
;
spotLight
.
penumbra
=
0.8
spotLight
.
decay
=
2
;
spotLight
.
distance
=
300
;
spotLight
.
penumbra
=
0.8
;
spotLight
.
castShadow
=
true
;
scene
.
add
(
spotLight
);
...
...
@@ -277,9 +279,9 @@
camera
.
lookAt
(
scene
.
position
);
for
(
var
i
=
0
,
l
=
objects
.
length
;
i
<
l
;
i
++
)
{
for
(
var
i
=
0
,
l
=
group
.
children
.
length
;
i
<
l
;
i
++
)
{
var
object
=
objects
[
i
];
var
object
=
group
.
children
[
i
];
object
.
rotation
.
y
+=
0.005
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录