Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
5c1e9abd
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,发现更多精彩内容 >>
提交
5c1e9abd
编写于
4月 23, 2019
作者:
F
Fernando Serrano
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up multiview render path, create rendertarget
上级
03b1efa8
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
25 addition
and
25 deletion
+25
-25
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+13
-22
src/renderers/webgl/WebGLMultiview.js
src/renderers/webgl/WebGLMultiview.js
+12
-3
未找到文件。
src/renderers/WebGLRenderer.js
浏览文件 @
5c1e9abd
...
...
@@ -315,7 +315,7 @@ function WebGLRenderer( parameters ) {
this
.
vr
=
vr
;
var
multiview
=
this
.
multiview
=
new
WebGLMultiview
(
_multiviewRequested
,
_gl
,
_canvas
,
extensions
,
capabilities
);
var
multiview
=
this
.
multiview
=
new
WebGLMultiview
(
_multiviewRequested
,
_gl
,
_canvas
,
extensions
,
capabilities
,
properties
);
// shadow map
...
...
@@ -1178,8 +1178,14 @@ function WebGLRenderer( parameters ) {
this
.
setRenderTarget
(
renderTarget
);
}
else
if
(
this
.
multiview
.
isEnabled
()
)
{
this
.
setRenderTarget
(
this
.
multiview
.
renderTarget
);
this
.
multiview
.
bindFramebuffer
(
camera
);
}
//
background
.
render
(
currentRenderList
,
scene
,
camera
,
forceClear
);
...
...
@@ -1224,6 +1230,12 @@ function WebGLRenderer( parameters ) {
textures
.
updateMultisampleRenderTarget
(
_currentRenderTarget
);
if
(
this
.
multiview
.
isEnabled
()
)
{
this
.
multiview
.
unbindFramebuffer
(
camera
);
}
}
// Ensure depth buffer writing is enabled so it can be cleared on next render
...
...
@@ -1369,25 +1381,6 @@ function WebGLRenderer( parameters ) {
if
(
multiview
.
isEnabled
()
)
{
multiview
.
bindMultiviewFrameBuffer
(
camera
);
_gl
.
disable
(
_gl
.
SCISSOR_TEST
);
if
(
camera
.
isArrayCamera
)
{
var
height
=
_canvas
.
height
;
var
width
=
Math
.
floor
(
_canvas
.
width
*
0.5
);
}
else
{
var
width
=
_canvas
.
width
;
var
height
=
_canvas
.
height
;
}
_gl
.
viewport
(
0
,
0
,
width
,
height
);
_gl
.
clear
(
_gl
.
COLOR_BUFFER_BIT
|
_gl
.
DEPTH_BUFFER_BIT
|
_gl
.
STENCIL_BUFFER_BIT
);
for
(
var
i
=
0
,
l
=
renderList
.
length
;
i
<
l
;
i
++
)
{
var
renderItem
=
renderList
[
i
];
...
...
@@ -1401,8 +1394,6 @@ function WebGLRenderer( parameters ) {
}
multiview
.
unbindMultiviewFrameBuffer
(
camera
);
}
else
{
for
(
var
i
=
0
,
l
=
renderList
.
length
;
i
<
l
;
i
++
)
{
...
...
src/renderers/webgl/WebGLMultiview.js
浏览文件 @
5c1e9abd
...
...
@@ -2,7 +2,9 @@
* @author fernandojsg / http://fernandojsg.com
*/
function
WebGLMultiview
(
requested
,
gl
,
canvas
,
extensions
,
capabilities
)
{
import
{
WebGLRenderTarget
}
from
'
../WebGLRenderTarget.js
'
;
function
WebGLMultiview
(
requested
,
gl
,
canvas
,
extensions
,
capabilities
,
properties
)
{
this
.
isAvailable
=
function
()
{
...
...
@@ -81,9 +83,14 @@ function WebGLMultiview( requested, gl, canvas, extensions, capabilities ) {
framebufferWidth
=
halfWidth
;
framebufferHeight
=
canvas
.
height
;
this
.
renderTarget
=
new
WebGLRenderTarget
(
framebufferWidth
,
framebufferHeight
);
// @hack This should be done in WebGLTextures?
properties
.
get
(
this
.
renderTarget
).
__webglFramebuffer
=
framebuffer
;
};
this
.
bind
MultiviewFrameB
uffer
=
function
(
camera
)
{
this
.
bind
Frameb
uffer
=
function
(
camera
)
{
var
width
=
canvas
.
width
;
var
height
=
canvas
.
height
;
...
...
@@ -108,13 +115,15 @@ function WebGLMultiview( requested, gl, canvas, extensions, capabilities ) {
framebufferWidth
=
width
;
framebufferHeight
=
height
;
this
.
renderTarget
.
setSize
(
width
,
height
);
}
gl
.
bindFramebuffer
(
gl
.
DRAW_FRAMEBUFFER
,
framebuffer
);
};
this
.
unbind
MultiviewFrameB
uffer
=
function
(
camera
)
{
this
.
unbind
Frameb
uffer
=
function
(
camera
)
{
gl
.
bindFramebuffer
(
gl
.
DRAW_FRAMEBUFFER
,
null
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录