Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
af426ea3
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,发现更多精彩内容 >>
提交
af426ea3
编写于
11月 24, 2019
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Examples: Improved webgl2_multisampled_renderbuffers.
上级
70c886d8
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
30 addition
and
24 deletion
+30
-24
examples/webgl2_multisampled_renderbuffers.html
examples/webgl2_multisampled_renderbuffers.html
+30
-24
未找到文件。
examples/webgl2_multisampled_renderbuffers.html
浏览文件 @
af426ea3
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
#container
{
#container
{
position
:
absolute
;
position
:
absolute
;
top
:
8
0px
;
top
:
7
0px
;
width
:
100%
;
width
:
100%
;
bottom
:
0px
;
bottom
:
0px
;
}
}
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
<div
id=
"info"
>
<div
id=
"info"
>
<a
href=
"http://threejs.org"
target=
"_blank"
rel=
"noopener"
>
three.js
</a>
- Multisampled Renderbuffers
<br
/>
<a
href=
"http://threejs.org"
target=
"_blank"
rel=
"noopener"
>
three.js
</a>
- Multisampled Renderbuffers
<br
/>
Left: WebGL
MultisampleRenderTarget, Right: WebGL
RenderTarget.
Left: WebGL
RenderTarget, Right: WebGLMultisample
RenderTarget.
</div>
</div>
<div
id=
"container"
>
<div
id=
"container"
>
</div>
</div>
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
container
=
document
.
getElementById
(
'
container
'
);
container
=
document
.
getElementById
(
'
container
'
);
camera
=
new
THREE
.
PerspectiveCamera
(
45
,
(
container
.
offsetWidth
*
0.5
)
/
container
.
offsetHeight
,
1
,
2000
);
camera
=
new
THREE
.
PerspectiveCamera
(
45
,
container
.
offsetWidth
/
container
.
offsetHeight
,
1
,
2000
);
camera
.
position
.
z
=
500
;
camera
.
position
.
z
=
500
;
scene
=
new
THREE
.
Scene
();
scene
=
new
THREE
.
Scene
();
...
@@ -71,30 +71,35 @@
...
@@ -71,30 +71,35 @@
//
//
var
hemiLight
=
new
THREE
.
HemisphereLight
(
0xffffff
,
0x
444444
);
var
hemiLight
=
new
THREE
.
HemisphereLight
(
0xffffff
,
0x
222222
,
1.5
);
hemiLight
.
position
.
set
(
0
,
1000
,
0
);
hemiLight
.
position
.
set
(
1
,
1
,
1
);
scene
.
add
(
hemiLight
);
scene
.
add
(
hemiLight
);
var
dirLight
=
new
THREE
.
DirectionalLight
(
0xffffff
,
0.8
);
dirLight
.
position
.
set
(
-
3000
,
1000
,
-
1000
);
scene
.
add
(
dirLight
);
//
//
group
=
new
THREE
.
Group
();
group
=
new
THREE
.
Group
();
var
geometry
=
new
THREE
.
IcosahedronBufferGeometry
(
10
,
2
);
var
geometry
=
new
THREE
.
SphereBufferGeometry
(
10
,
64
,
40
);
var
material
=
new
THREE
.
MeshStandardMaterial
(
{
color
:
0xee0808
,
flatShading
:
true
}
);
var
material
=
new
THREE
.
MeshLambertMaterial
(
{
color
:
0xee0808
}
);
var
material2
=
new
THREE
.
MeshBasicMaterial
(
{
color
:
0xffffff
,
wireframe
:
true
}
);
for
(
var
i
=
0
;
i
<
10
0
;
i
++
)
{
for
(
var
i
=
0
;
i
<
10
;
i
++
)
{
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
,
material
);
mesh
.
position
.
x
=
Math
.
random
()
*
500
-
250
;
mesh
.
position
.
x
=
Math
.
random
()
*
600
-
300
;
mesh
.
position
.
y
=
Math
.
random
()
*
500
-
250
;
mesh
.
position
.
y
=
Math
.
random
()
*
600
-
300
;
mesh
.
position
.
z
=
Math
.
random
()
*
500
-
250
;
mesh
.
position
.
z
=
Math
.
random
()
*
600
-
300
;
mesh
.
scale
.
setScalar
(
Math
.
random
()
*
2
+
1
);
mesh
.
rotation
.
x
=
Math
.
random
();
mesh
.
rotation
.
z
=
Math
.
random
();
mesh
.
scale
.
setScalar
(
Math
.
random
()
*
5
+
5
);
group
.
add
(
mesh
);
group
.
add
(
mesh
);
var
mesh2
=
new
THREE
.
Mesh
(
geometry
,
material2
);
mesh2
.
position
.
copy
(
mesh
.
position
);
mesh2
.
rotation
.
copy
(
mesh
.
rotation
);
mesh2
.
scale
.
copy
(
mesh
.
scale
);
group
.
add
(
mesh2
);
}
}
scene
.
add
(
group
);
scene
.
add
(
group
);
...
@@ -102,12 +107,11 @@
...
@@ -102,12 +107,11 @@
//
//
var
canvas
=
document
.
createElement
(
'
canvas
'
);
var
canvas
=
document
.
createElement
(
'
canvas
'
);
canvas
.
style
.
imageRendering
=
'
pixelated
'
;
// disable browser interpolation
var
context
=
canvas
.
getContext
(
'
webgl2
'
,
{
alpha
:
false
,
antialias
:
false
}
);
var
context
=
canvas
.
getContext
(
'
webgl2
'
,
{
alpha
:
false
,
antialias
:
false
}
);
renderer
=
new
THREE
.
WebGLRenderer
(
{
canvas
:
canvas
,
context
:
context
}
);
renderer
=
new
THREE
.
WebGLRenderer
(
{
canvas
:
canvas
,
context
:
context
}
);
renderer
.
autoClear
=
false
;
renderer
.
autoClear
=
false
;
renderer
.
setPixelRatio
(
window
.
devicePixelRatio
);
renderer
.
setSize
(
container
.
offsetWidth
,
container
.
offsetHeight
);
renderer
.
setSize
(
container
.
offsetWidth
,
container
.
offsetHeight
);
container
.
appendChild
(
renderer
.
domElement
);
container
.
appendChild
(
renderer
.
domElement
);
...
@@ -126,13 +130,13 @@
...
@@ -126,13 +130,13 @@
//
//
composer1
=
new
EffectComposer
(
renderer
,
renderTarget
);
composer1
=
new
EffectComposer
(
renderer
);
composer1
.
addPass
(
renderPass
);
composer1
.
addPass
(
renderPass
);
composer1
.
addPass
(
copyPass
);
composer1
.
addPass
(
copyPass
);
//
//
composer2
=
new
EffectComposer
(
renderer
);
composer2
=
new
EffectComposer
(
renderer
,
renderTarget
);
composer2
.
addPass
(
renderPass
);
composer2
.
addPass
(
renderPass
);
composer2
.
addPass
(
copyPass
);
composer2
.
addPass
(
copyPass
);
...
@@ -144,7 +148,7 @@
...
@@ -144,7 +148,7 @@
function
onWindowResize
()
{
function
onWindowResize
()
{
camera
.
aspect
=
(
container
.
offsetWidth
*
0.5
)
/
container
.
offsetHeight
;
camera
.
aspect
=
container
.
offsetWidth
/
container
.
offsetHeight
;
camera
.
updateProjectionMatrix
();
camera
.
updateProjectionMatrix
();
renderer
.
setSize
(
container
.
offsetWidth
,
container
.
offsetHeight
);
renderer
.
setSize
(
container
.
offsetWidth
,
container
.
offsetHeight
);
...
@@ -161,14 +165,16 @@
...
@@ -161,14 +165,16 @@
group
.
rotation
.
y
+=
clock
.
getDelta
()
*
0.1
;
group
.
rotation
.
y
+=
clock
.
getDelta
()
*
0.1
;
renderer
.
set
Viewport
(
0
,
0
,
halfWidth
,
container
.
offsetHeight
);
renderer
.
set
ScissorTest
(
true
);
renderer
.
setScissor
(
0
,
0
,
halfWidth
-
1
,
container
.
offsetHeight
);
composer1
.
render
();
composer1
.
render
();
renderer
.
setViewport
(
halfWidth
,
0
,
halfWidth
,
container
.
offsetHeight
);
renderer
.
setScissor
(
halfWidth
,
0
,
halfWidth
,
container
.
offsetHeight
);
composer2
.
render
();
composer2
.
render
();
renderer
.
setScissorTest
(
false
);
}
}
</script>
</script>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录