Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
786b5da1
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,发现更多精彩内容 >>
提交
786b5da1
编写于
2月 17, 2016
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Simplified and improved msaa and smaa examples.
上级
2ea4c7be
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
69 addition
and
52 deletion
+69
-52
examples/webgl_postprocessing_msaa.html
examples/webgl_postprocessing_msaa.html
+38
-30
examples/webgl_postprocessing_smaa.html
examples/webgl_postprocessing_smaa.html
+31
-22
未找到文件。
examples/webgl_postprocessing_msaa.html
浏览文件 @
786b5da1
...
...
@@ -51,28 +51,14 @@
<script>
var
camera
,
scene
,
renderer
,
composer
,
copyPass
,
msaaPass
;
var
g
eometry
,
material
,
gui
,
object
,
stats
,
texture
;
var
g
ui
,
stats
,
texture
;
var
param
=
{
MSAASampleLevel
:
2
};
var
textureLoader
=
new
THREE
.
TextureLoader
();
container
=
document
.
getElementById
(
"
container
"
);
stats
=
new
Stats
();
stats
.
domElement
.
style
.
position
=
'
absolute
'
;
stats
.
domElement
.
style
.
top
=
'
0px
'
;
container
.
appendChild
(
stats
.
domElement
);
textureLoader
.
load
(
"
./textures/brick_diffuse.jpg
"
,
function
(
meshTexture
)
{
init
(
meshTexture
);
texture
=
meshTexture
;
init
();
animate
();
clearGui
();
});
clearGui
();
function
clearGui
()
{
...
...
@@ -99,29 +85,45 @@
}
function
init
(
meshTexture
)
{
function
init
()
{
meshTexture
.
minFilter
=
THREE
.
NearestFilter
;
meshTexture
.
magFilter
=
THREE
.
NearestFilter
;
meshTexture
.
anisotropy
=
1
;
meshTexture
.
generateMipmaps
=
false
;
container
=
document
.
getElementById
(
"
container
"
);
renderer
=
new
THREE
.
WebGLRenderer
(
{
antialias
:
false
}
);
renderer
.
setPixelRatio
(
window
.
devicePixelRatio
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
document
.
body
.
appendChild
(
renderer
.
domElement
);
stats
=
new
Stats
();
stats
.
domElement
.
style
.
position
=
'
absolute
'
;
stats
.
domElement
.
style
.
top
=
'
0px
'
;
container
.
appendChild
(
stats
.
domElement
);
//
camera
=
new
THREE
.
PerspectiveCamera
(
70
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
1000
);
camera
.
position
.
z
=
4
00
;
camera
.
position
.
z
=
3
00
;
scene
=
new
THREE
.
Scene
();
geometry
=
new
THREE
.
BoxGeometry
(
200
,
200
,
20
0
);
material
=
new
THREE
.
MeshBasicMaterial
(
{
map
:
meshTextur
e
}
);
var
geometry
=
new
THREE
.
BoxGeometry
(
120
,
120
,
12
0
);
var
material
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffffff
,
wireframe
:
tru
e
}
);
object
=
new
THREE
.
Mesh
(
geometry
,
material
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
position
.
x
=
-
100
;
scene
.
add
(
mesh
);
scene
.
add
(
object
);
var
texture
=
new
THREE
.
TextureLoader
().
load
(
"
textures/brick_diffuse.jpg
"
);
texture
.
minFilter
=
THREE
.
NearestFilter
;
texture
.
magFilter
=
THREE
.
NearestFilter
;
texture
.
anisotropy
=
1
;
texture
.
generateMipmaps
=
false
;
var
material
=
new
THREE
.
MeshBasicMaterial
(
{
map
:
texture
}
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
position
.
x
=
100
;
scene
.
add
(
mesh
);
// postprocessing
...
...
@@ -161,8 +163,14 @@
requestAnimationFrame
(
animate
);
object
.
rotation
.
x
+=
0.005
;
object
.
rotation
.
y
+=
0.01
;
for
(
var
i
=
0
;
i
<
scene
.
children
.
length
;
i
++
)
{
var
child
=
scene
.
children
[
i
];
child
.
rotation
.
x
+=
0.005
;
child
.
rotation
.
y
+=
0.01
;
}
composer
.
render
();
...
...
examples/webgl_postprocessing_smaa.html
浏览文件 @
786b5da1
...
...
@@ -32,43 +32,46 @@
<script>
var
camera
,
scene
,
renderer
,
composer
,
pass
,
stats
;
var
geometry
,
material
,
object
;
var
textureLoader
=
new
THREE
.
TextureLoader
();
container
=
document
.
getElementById
(
"
container
"
);
stats
=
new
Stats
();
stats
.
domElement
.
style
.
position
=
'
absolute
'
;
stats
.
domElement
.
style
.
top
=
'
0px
'
;
container
.
appendChild
(
stats
.
domElement
);
textureLoader
.
load
(
"
./textures/brick_diffuse.jpg
"
,
function
(
meshTexture
)
{
init
(
meshTexture
);
init
();
animate
();
});
function
init
(
meshTexture
)
{
container
=
document
.
getElementById
(
"
container
"
);
renderer
=
new
THREE
.
WebGLRenderer
(
{
antialias
:
false
}
);
renderer
.
setPixelRatio
(
window
.
devicePixelRatio
);
renderer
.
setSize
(
window
.
innerWidth
,
window
.
innerHeight
);
document
.
body
.
appendChild
(
renderer
.
domElement
);
stats
=
new
Stats
();
stats
.
domElement
.
style
.
position
=
'
absolute
'
;
stats
.
domElement
.
style
.
top
=
'
0px
'
;
container
.
appendChild
(
stats
.
domElement
);
//
camera
=
new
THREE
.
PerspectiveCamera
(
70
,
window
.
innerWidth
/
window
.
innerHeight
,
1
,
1000
);
camera
.
position
.
z
=
4
00
;
camera
.
position
.
z
=
3
00
;
scene
=
new
THREE
.
Scene
();
geometry
=
new
THREE
.
BoxGeometry
(
200
,
200
,
200
);
material
=
new
THREE
.
MeshBasicMaterial
(
{
map
:
meshTexture
}
);
meshTexture
.
anisotropy
=
4
;
var
geometry
=
new
THREE
.
BoxGeometry
(
120
,
120
,
120
);
var
material
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffffff
,
wireframe
:
true
}
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
position
.
x
=
-
100
;
scene
.
add
(
mesh
);
object
=
new
THREE
.
Mesh
(
geometry
,
material
);
var
texture
=
new
THREE
.
TextureLoader
().
load
(
"
textures/brick_diffuse.jpg
"
);
texture
.
anisotropy
=
4
;
scene
.
add
(
object
);
var
material
=
new
THREE
.
MeshBasicMaterial
(
{
map
:
texture
}
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
position
.
x
=
100
;
scene
.
add
(
mesh
);
// postprocessing
...
...
@@ -105,8 +108,14 @@
requestAnimationFrame
(
animate
);
object
.
rotation
.
x
+=
0.005
;
object
.
rotation
.
y
+=
0.01
;
for
(
var
i
=
0
;
i
<
scene
.
children
.
length
;
i
++
)
{
var
child
=
scene
.
children
[
i
];
child
.
rotation
.
x
+=
0.005
;
child
.
rotation
.
y
+=
0.01
;
}
composer
.
render
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录