Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
b6497304
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,发现更多精彩内容 >>
提交
b6497304
编写于
4月 05, 2012
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'alteredq/dev' into dev
上级
adc89592
367ee788
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
8 deletion
+12
-8
build/Three.js
build/Three.js
+4
-4
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+4
-4
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+4
-0
未找到文件。
build/Three.js
浏览文件 @
b6497304
...
...
@@ -366,10 +366,10 @@ j.cullFace(j.FRONT_AND_BACK),j.enable(j.CULL_FACE)):j.disable(j.CULL_FACE)};this
break
;
case
THREE
.
AdditiveBlending
:
j
.
enable
(
j
.
BLEND
);
j
.
blendEquation
(
j
.
FUNC_ADD
);
j
.
blendFunc
(
j
.
SRC_ALPHA
,
j
.
ONE
);
break
;
case
THREE
.
SubtractiveBlending
:
j
.
enable
(
j
.
BLEND
);
j
.
blendEquation
(
j
.
FUNC_ADD
);
j
.
blendFunc
(
j
.
ZERO
,
j
.
ONE_MINUS_SRC_COLOR
);
break
;
case
THREE
.
MultiplyBlending
:
j
.
enable
(
j
.
BLEND
);
j
.
blendEquation
(
j
.
FUNC_ADD
);
j
.
blendFunc
(
j
.
ZERO
,
j
.
SRC_COLOR
);
break
;
case
THREE
.
CustomBlending
:
j
.
enable
(
j
.
BLEND
);
break
;
default
:
j
.
enable
(
j
.
BLEND
),
j
.
blendEquationSeparate
(
j
.
FUNC_ADD
,
j
.
FUNC_ADD
),
j
.
blendFuncSeparate
(
j
.
SRC_ALPHA
,
j
.
ONE_MINUS_SRC_ALPHA
,
j
.
ONE
,
j
.
ONE_MINUS_SRC_ALPHA
)}
$
=
a
}
if
(
a
===
THREE
.
CustomBlending
){
if
(
b
!==
W
&&
(
j
.
blendEquation
(
y
(
b
)),
W
=
b
),
c
!==
ba
||
d
!==
ia
)
j
.
blendFunc
(
y
(
c
),
y
(
d
)),
ba
=
c
,
ia
=
d
}
else
ia
=
ba
=
W
=
null
};
this
.
setTexture
=
function
(
a
,
b
){
if
(
a
.
needsUpdate
){
if
(
!
a
.
__webglInit
)
a
.
__webglInit
=!
0
,
a
.
__webglTexture
=
j
.
createTexture
(),
B
.
info
.
memory
.
textures
++
;
j
.
activeTexture
(
j
.
TEXTURE0
+
b
);
j
.
bindTexture
(
j
.
TEXTURE_2D
,
a
.
__webglTexture
);
j
.
pixelStorei
(
j
.
UNPACK_PREMULTIPLY_ALPHA_WEBGL
,
a
.
premultiplyAlpha
);
var
c
=
a
.
image
,
d
=
0
===
(
c
.
width
&
c
.
width
-
1
)
&&
0
===
(
c
.
height
&
c
.
height
-
1
),
e
=
y
(
a
.
format
),
f
=
y
(
a
.
type
);
u
(
j
.
TEXTURE_2D
,
a
,
d
);
a
instanceof
THREE
.
DataTexture
?
j
.
texImage2D
(
j
.
TEXTURE_2D
,
0
,
e
,
c
.
width
,
c
.
height
,
0
,
e
,
f
,
c
.
data
):
j
.
texImage2D
(
j
.
TEXTURE_2D
,
0
,
e
,
e
,
f
,
a
.
image
);
a
.
generateMipmaps
&&
d
&&
j
.
generateMipmap
(
j
.
TEXTURE_2D
);
a
.
needsUpdate
=!
1
;
if
(
a
.
onUpdate
)
a
.
onUpdate
()}
else
j
.
activeTexture
(
j
.
TEXTURE0
+
b
),
j
.
bindTexture
(
j
.
TEXTURE_2D
,
a
.
__webglTexture
)};
this
.
setRenderTarget
=
function
(
a
){
var
b
=
a
instanceof
THREE
.
WebGLRenderTargetCube
;
if
(
a
&&!
a
.
__webglFramebuffer
){
if
(
void
0
===
a
.
depthBuffer
)
a
.
depthBuffer
=!
0
;
if
(
void
0
===
a
.
stencilBuffer
)
a
.
stencilBuffer
=!
0
;
a
.
__webglTexture
=
j
.
createTexture
();
var
c
=
0
===
(
a
.
width
&
a
.
width
-
1
)
&&
0
===
(
a
.
height
&
a
.
height
-
1
),
d
=
y
(
a
.
format
),
e
=
y
(
a
.
type
);
if
(
b
){
a
.
__webglFramebuffer
=
[];
a
.
__webglRenderbuffer
=
[];
j
.
bindTexture
(
j
.
TEXTURE_CUBE_MAP
,
a
.
__webglTexture
);
u
(
j
.
TEXTURE_CUBE_MAP
,
a
,
c
);
for
(
c
=
0
;
6
>
c
;
c
++
){
a
.
__webglFramebuffer
[
c
]
=
j
.
createFramebuffer
();
a
.
__webglRenderbuffer
[
c
]
=
j
.
createRenderbuffer
();
j
.
texImage2D
(
j
.
TEXTURE_CUBE_MAP_POSITIVE_X
+
c
,
0
,
d
,
a
.
width
,
a
.
height
,
0
,
d
,
e
,
null
);
var
f
=
a
,
g
=
j
.
TEXTURE_CUBE_MAP_POSITIVE_X
+
c
;
j
.
bindFramebuffer
(
j
.
FRAMEBUFFER
,
a
.
__webglFramebuffer
[
c
]);
j
.
framebufferTexture2D
(
j
.
FRAMEBUFFER
,
j
.
COLOR_ATTACHMENT0
,
g
,
f
.
__webglTexture
,
0
);
t
(
a
.
__webglRenderbuffer
[
c
],
a
)}}
else
a
.
__webglFramebuffer
=
j
.
createFramebuffer
(),
a
.
__webglRenderbuffer
=
j
.
createRenderbuffer
(),
j
.
bindTexture
(
j
.
TEXTURE_2D
,
a
.
__webglTexture
),
u
(
j
.
TEXTURE_2D
,
a
,
c
),
j
.
texImage2D
(
j
.
TEXTURE_2D
,
0
,
d
,
a
.
width
,
a
.
height
,
0
,
d
,
e
,
null
),
d
=
j
.
TEXTURE_2D
,
j
.
bindFramebuffer
(
j
.
FRAMEBUFFER
,
a
.
__webglFramebuffer
)
,
j
.
framebufferTexture2D
(
j
.
FRAMEBUFFER
,
j
.
COLOR_ATTACHMENT0
,
d
,
a
.
__webglTexture
,
0
),
t
(
a
.
__webglRenderbuffer
,
a
);
b
?
j
.
bindTexture
(
j
.
TEXTURE_CUBE_MAP
,
null
):
j
.
bindTexture
(
j
.
TEXTURE_2D
,
null
);
j
.
bindRenderbuffer
(
j
.
RENDERBUFFER
,
null
);
j
.
bindFramebuffer
(
j
.
FRAMEBUFFER
,
null
)}
a
?(
b
=
b
?
a
.
__webglFramebuffer
[
a
.
activeCubeFace
]:
a
.
__webglFramebuffer
,
d
=
a
.
width
,
a
=
a
.
height
,
c
=
e
=
0
):(
b
=
null
,
d
=
fb
,
a
=
bb
,
e
=
Ya
,
c
=
jb
);
b
!==
D
&&
(
j
.
bindFramebuffer
(
j
.
FRAMEBUFFER
,
b
),
j
.
viewport
(
e
,
c
,
d
,
a
),
D
=
b
);
gb
=
d
;
ob
=
a
};
this
.
shadowMapPlugin
=
new
THREE
.
ShadowMapPlugin
;
this
.
addPrePlugin
(
this
.
shadowMapPlugin
);
this
.
addPostPlugin
(
new
THREE
.
SpritePlugin
);
this
.
addPostPlugin
(
new
THREE
.
LensFlarePlugin
)};
a
.
depthBuffer
)
a
.
depthBuffer
=!
0
;
if
(
void
0
===
a
.
stencilBuffer
)
a
.
stencilBuffer
=!
0
;
a
.
__webglTexture
=
j
.
createTexture
();
var
c
=
0
===
(
a
.
width
&
a
.
width
-
1
)
&&
0
===
(
a
.
height
&
a
.
height
-
1
),
d
=
y
(
a
.
format
),
e
=
y
(
a
.
type
);
if
(
b
){
a
.
__webglFramebuffer
=
[];
a
.
__webglRenderbuffer
=
[];
j
.
bindTexture
(
j
.
TEXTURE_CUBE_MAP
,
a
.
__webglTexture
);
u
(
j
.
TEXTURE_CUBE_MAP
,
a
,
c
);
for
(
var
f
=
0
;
6
>
f
;
f
++
){
a
.
__webglFramebuffer
[
f
]
=
j
.
createFramebuffer
();
a
.
__webglRenderbuffer
[
f
]
=
j
.
createRenderbuffer
();
j
.
texImage2D
(
j
.
TEXTURE_CUBE_MAP_POSITIVE_X
+
f
,
0
,
d
,
a
.
width
,
a
.
height
,
0
,
d
,
e
,
null
);
var
g
=
a
,
h
=
j
.
TEXTURE_CUBE_MAP_POSITIVE_X
+
f
;
j
.
bindFramebuffer
(
j
.
FRAMEBUFFER
,
a
.
__webglFramebuffer
[
f
]);
j
.
framebufferTexture2D
(
j
.
FRAMEBUFFER
,
j
.
COLOR_ATTACHMENT0
,
h
,
g
.
__webglTexture
,
0
);
t
(
a
.
__webglRenderbuffer
[
f
],
a
)}
c
&&
j
.
generateMipmap
(
j
.
TEXTURE_CUBE_MAP
)}
else
a
.
__webglFramebuffer
=
j
.
createFramebuffer
(),
a
.
__webglRenderbuffer
=
j
.
createRenderbuffer
(),
j
.
bindTexture
(
j
.
TEXTURE_2D
,
a
.
__webglTexture
),
u
(
j
.
TEXTURE_2D
,
a
,
c
),
j
.
texImage2D
(
j
.
TEXTURE_2D
,
0
,
d
,
a
.
width
,
a
.
height
,
0
,
d
,
e
,
null
),
d
=
j
.
TEXTURE_2D
,
j
.
bindFramebuffer
(
j
.
FRAMEBUFFER
,
a
.
__webglFramebuffer
),
j
.
framebufferTexture2D
(
j
.
FRAMEBUFFER
,
j
.
COLOR_ATTACHMENT0
,
d
,
a
.
__webglTexture
,
0
),
t
(
a
.
__webglRenderbuffer
,
a
),
c
&&
j
.
generateMipmap
(
j
.
TEXTURE_2D
);
b
?
j
.
bindTexture
(
j
.
TEXTURE_CUBE_MAP
,
null
):
j
.
bindTexture
(
j
.
TEXTURE_2D
,
null
);
j
.
bindRenderbuffer
(
j
.
RENDERBUFFER
,
null
);
j
.
bindFramebuffer
(
j
.
FRAMEBUFFER
,
null
)}
a
?(
b
=
b
?
a
.
__webglFramebuffer
[
a
.
activeCubeFace
]:
a
.
__webglFramebuffer
,
c
=
a
.
width
,
a
=
a
.
height
,
e
=
d
=
0
):(
b
=
null
,
c
=
fb
,
a
=
bb
,
d
=
Ya
,
e
=
jb
);
b
!==
D
&&
(
j
.
bindFramebuffer
(
j
.
FRAMEBUFFER
,
b
),
j
.
viewport
(
d
,
e
,
c
,
a
),
D
=
b
);
gb
=
c
;
ob
=
a
};
this
.
shadowMapPlugin
=
new
THREE
.
ShadowMapPlugin
;
this
.
addPrePlugin
(
this
.
shadowMapPlugin
);
this
.
addPostPlugin
(
new
THREE
.
SpritePlugin
);
this
.
addPostPlugin
(
new
THREE
.
LensFlarePlugin
)};
THREE
.
WebGLRenderTarget
=
function
(
a
,
b
,
c
){
this
.
width
=
a
;
this
.
height
=
b
;
c
=
c
||
{};
this
.
wrapS
=
void
0
!==
c
.
wrapS
?
c
.
wrapS
:
THREE
.
ClampToEdgeWrapping
;
this
.
wrapT
=
void
0
!==
c
.
wrapT
?
c
.
wrapT
:
THREE
.
ClampToEdgeWrapping
;
this
.
magFilter
=
void
0
!==
c
.
magFilter
?
c
.
magFilter
:
THREE
.
LinearFilter
;
this
.
minFilter
=
void
0
!==
c
.
minFilter
?
c
.
minFilter
:
THREE
.
LinearMipMapLinearFilter
;
this
.
offset
=
new
THREE
.
Vector2
(
0
,
0
);
this
.
repeat
=
new
THREE
.
Vector2
(
1
,
1
);
this
.
format
=
void
0
!==
c
.
format
?
c
.
format
:
THREE
.
RGBAFormat
;
this
.
type
=
void
0
!==
c
.
type
?
c
.
type
:
THREE
.
UnsignedByteType
;
this
.
depthBuffer
=
void
0
!==
c
.
depthBuffer
?
c
.
depthBuffer
:
!
0
;
this
.
stencilBuffer
=
void
0
!==
c
.
stencilBuffer
?
c
.
stencilBuffer
:
!
0
;
this
.
generateMipmaps
=!
0
};
THREE
.
WebGLRenderTarget
.
prototype
.
clone
=
function
(){
var
a
=
new
THREE
.
WebGLRenderTarget
(
this
.
width
,
this
.
height
);
a
.
wrapS
=
this
.
wrapS
;
a
.
wrapT
=
this
.
wrapT
;
a
.
magFilter
=
this
.
magFilter
;
a
.
minFilter
=
this
.
minFilter
;
a
.
offset
.
copy
(
this
.
offset
);
a
.
repeat
.
copy
(
this
.
repeat
);
a
.
format
=
this
.
format
;
a
.
type
=
this
.
type
;
a
.
depthBuffer
=
this
.
depthBuffer
;
a
.
stencilBuffer
=
this
.
stencilBuffer
;
return
a
};
THREE
.
WebGLRenderTargetCube
=
function
(
a
,
b
,
c
){
THREE
.
WebGLRenderTarget
.
call
(
this
,
a
,
b
,
c
);
this
.
activeCubeFace
=
0
};
...
...
build/custom/ThreeWebGL.js
浏览文件 @
b6497304
...
...
@@ -315,10 +315,10 @@ e.cullFace(e.FRONT_AND_BACK),e.enable(e.CULL_FACE)):e.disable(e.CULL_FACE)};this
break
;
case
THREE
.
AdditiveBlending
:
e
.
enable
(
e
.
BLEND
);
e
.
blendEquation
(
e
.
FUNC_ADD
);
e
.
blendFunc
(
e
.
SRC_ALPHA
,
e
.
ONE
);
break
;
case
THREE
.
SubtractiveBlending
:
e
.
enable
(
e
.
BLEND
);
e
.
blendEquation
(
e
.
FUNC_ADD
);
e
.
blendFunc
(
e
.
ZERO
,
e
.
ONE_MINUS_SRC_COLOR
);
break
;
case
THREE
.
MultiplyBlending
:
e
.
enable
(
e
.
BLEND
);
e
.
blendEquation
(
e
.
FUNC_ADD
);
e
.
blendFunc
(
e
.
ZERO
,
e
.
SRC_COLOR
);
break
;
case
THREE
.
CustomBlending
:
e
.
enable
(
e
.
BLEND
);
break
;
default
:
e
.
enable
(
e
.
BLEND
),
e
.
blendEquationSeparate
(
e
.
FUNC_ADD
,
e
.
FUNC_ADD
),
e
.
blendFuncSeparate
(
e
.
SRC_ALPHA
,
e
.
ONE_MINUS_SRC_ALPHA
,
e
.
ONE
,
e
.
ONE_MINUS_SRC_ALPHA
)}
Aa
=
a
}
if
(
a
===
THREE
.
CustomBlending
){
if
(
b
!==
Ma
&&
(
e
.
blendEquation
(
G
(
b
)),
Ma
=
b
),
c
!==
Wa
||
d
!==
Ta
)
e
.
blendFunc
(
G
(
c
),
G
(
d
)),
Wa
=
c
,
Ta
=
d
}
else
Ta
=
Wa
=
Ma
=
null
};
this
.
setTexture
=
function
(
a
,
b
){
if
(
a
.
needsUpdate
){
if
(
!
a
.
__webglInit
)
a
.
__webglInit
=!
0
,
a
.
__webglTexture
=
e
.
createTexture
(),
C
.
info
.
memory
.
textures
++
;
e
.
activeTexture
(
e
.
TEXTURE0
+
b
);
e
.
bindTexture
(
e
.
TEXTURE_2D
,
a
.
__webglTexture
);
e
.
pixelStorei
(
e
.
UNPACK_PREMULTIPLY_ALPHA_WEBGL
,
a
.
premultiplyAlpha
);
var
c
=
a
.
image
,
d
=
0
===
(
c
.
width
&
c
.
width
-
1
)
&&
0
===
(
c
.
height
&
c
.
height
-
1
),
f
=
G
(
a
.
format
),
g
=
G
(
a
.
type
);
P
(
e
.
TEXTURE_2D
,
a
,
d
);
a
instanceof
THREE
.
DataTexture
?
e
.
texImage2D
(
e
.
TEXTURE_2D
,
0
,
f
,
c
.
width
,
c
.
height
,
0
,
f
,
g
,
c
.
data
):
e
.
texImage2D
(
e
.
TEXTURE_2D
,
0
,
f
,
f
,
g
,
a
.
image
);
a
.
generateMipmaps
&&
d
&&
e
.
generateMipmap
(
e
.
TEXTURE_2D
);
a
.
needsUpdate
=!
1
;
if
(
a
.
onUpdate
)
a
.
onUpdate
()}
else
e
.
activeTexture
(
e
.
TEXTURE0
+
b
),
e
.
bindTexture
(
e
.
TEXTURE_2D
,
a
.
__webglTexture
)};
this
.
setRenderTarget
=
function
(
a
){
var
b
=
a
instanceof
THREE
.
WebGLRenderTargetCube
;
if
(
a
&&!
a
.
__webglFramebuffer
){
if
(
void
0
===
a
.
depthBuffer
)
a
.
depthBuffer
=!
0
;
if
(
void
0
===
a
.
stencilBuffer
)
a
.
stencilBuffer
=!
0
;
a
.
__webglTexture
=
e
.
createTexture
();
var
c
=
0
===
(
a
.
width
&
a
.
width
-
1
)
&&
0
===
(
a
.
height
&
a
.
height
-
1
),
d
=
G
(
a
.
format
),
f
=
G
(
a
.
type
);
if
(
b
){
a
.
__webglFramebuffer
=
[];
a
.
__webglRenderbuffer
=
[];
e
.
bindTexture
(
e
.
TEXTURE_CUBE_MAP
,
a
.
__webglTexture
);
P
(
e
.
TEXTURE_CUBE_MAP
,
a
,
c
);
for
(
c
=
0
;
6
>
c
;
c
++
){
a
.
__webglFramebuffer
[
c
]
=
e
.
createFramebuffer
();
a
.
__webglRenderbuffer
[
c
]
=
e
.
createRenderbuffer
();
e
.
texImage2D
(
e
.
TEXTURE_CUBE_MAP_POSITIVE_X
+
c
,
0
,
d
,
a
.
width
,
a
.
height
,
0
,
d
,
f
,
null
);
var
g
=
a
,
h
=
e
.
TEXTURE_CUBE_MAP_POSITIVE_X
+
c
;
e
.
bindFramebuffer
(
e
.
FRAMEBUFFER
,
a
.
__webglFramebuffer
[
c
]);
e
.
framebufferTexture2D
(
e
.
FRAMEBUFFER
,
e
.
COLOR_ATTACHMENT0
,
h
,
g
.
__webglTexture
,
0
);
A
(
a
.
__webglRenderbuffer
[
c
],
a
)}}
else
a
.
__webglFramebuffer
=
e
.
createFramebuffer
(),
a
.
__webglRenderbuffer
=
e
.
createRenderbuffer
(),
e
.
bindTexture
(
e
.
TEXTURE_2D
,
a
.
__webglTexture
),
P
(
e
.
TEXTURE_2D
,
a
,
c
),
e
.
texImage2D
(
e
.
TEXTURE_2D
,
0
,
d
,
a
.
width
,
a
.
height
,
0
,
d
,
f
,
null
),
d
=
e
.
TEXTURE_2D
,
e
.
bindFramebuffer
(
e
.
FRAMEBUFFER
,
a
.
__webglFramebuffer
)
,
e
.
framebufferTexture2D
(
e
.
FRAMEBUFFER
,
e
.
COLOR_ATTACHMENT0
,
d
,
a
.
__webglTexture
,
0
),
A
(
a
.
__webglRenderbuffer
,
a
);
b
?
e
.
bindTexture
(
e
.
TEXTURE_CUBE_MAP
,
null
):
e
.
bindTexture
(
e
.
TEXTURE_2D
,
null
);
e
.
bindRenderbuffer
(
e
.
RENDERBUFFER
,
null
);
e
.
bindFramebuffer
(
e
.
FRAMEBUFFER
,
null
)}
a
?(
b
=
b
?
a
.
__webglFramebuffer
[
a
.
activeCubeFace
]:
a
.
__webglFramebuffer
,
d
=
a
.
width
,
a
=
a
.
height
,
c
=
f
=
0
):(
b
=
null
,
d
=
Pb
,
a
=
ac
,
f
=
$b
,
c
=
Hb
);
b
!==
T
&&
(
e
.
bindFramebuffer
(
e
.
FRAMEBUFFER
,
b
),
e
.
viewport
(
f
,
c
,
d
,
a
),
T
=
b
);
pc
=
d
;
qc
=
a
};
this
.
shadowMapPlugin
=
new
THREE
.
ShadowMapPlugin
;
this
.
addPrePlugin
(
this
.
shadowMapPlugin
);
this
.
addPostPlugin
(
new
THREE
.
SpritePlugin
);
this
.
addPostPlugin
(
new
THREE
.
LensFlarePlugin
)};
a
.
depthBuffer
)
a
.
depthBuffer
=!
0
;
if
(
void
0
===
a
.
stencilBuffer
)
a
.
stencilBuffer
=!
0
;
a
.
__webglTexture
=
e
.
createTexture
();
var
c
=
0
===
(
a
.
width
&
a
.
width
-
1
)
&&
0
===
(
a
.
height
&
a
.
height
-
1
),
d
=
G
(
a
.
format
),
f
=
G
(
a
.
type
);
if
(
b
){
a
.
__webglFramebuffer
=
[];
a
.
__webglRenderbuffer
=
[];
e
.
bindTexture
(
e
.
TEXTURE_CUBE_MAP
,
a
.
__webglTexture
);
P
(
e
.
TEXTURE_CUBE_MAP
,
a
,
c
);
for
(
var
g
=
0
;
6
>
g
;
g
++
){
a
.
__webglFramebuffer
[
g
]
=
e
.
createFramebuffer
();
a
.
__webglRenderbuffer
[
g
]
=
e
.
createRenderbuffer
();
e
.
texImage2D
(
e
.
TEXTURE_CUBE_MAP_POSITIVE_X
+
g
,
0
,
d
,
a
.
width
,
a
.
height
,
0
,
d
,
f
,
null
);
var
h
=
a
,
i
=
e
.
TEXTURE_CUBE_MAP_POSITIVE_X
+
g
;
e
.
bindFramebuffer
(
e
.
FRAMEBUFFER
,
a
.
__webglFramebuffer
[
g
]);
e
.
framebufferTexture2D
(
e
.
FRAMEBUFFER
,
e
.
COLOR_ATTACHMENT0
,
i
,
h
.
__webglTexture
,
0
);
A
(
a
.
__webglRenderbuffer
[
g
],
a
)}
c
&&
e
.
generateMipmap
(
e
.
TEXTURE_CUBE_MAP
)}
else
a
.
__webglFramebuffer
=
e
.
createFramebuffer
(),
a
.
__webglRenderbuffer
=
e
.
createRenderbuffer
(),
e
.
bindTexture
(
e
.
TEXTURE_2D
,
a
.
__webglTexture
),
P
(
e
.
TEXTURE_2D
,
a
,
c
),
e
.
texImage2D
(
e
.
TEXTURE_2D
,
0
,
d
,
a
.
width
,
a
.
height
,
0
,
d
,
f
,
null
),
d
=
e
.
TEXTURE_2D
,
e
.
bindFramebuffer
(
e
.
FRAMEBUFFER
,
a
.
__webglFramebuffer
),
e
.
framebufferTexture2D
(
e
.
FRAMEBUFFER
,
e
.
COLOR_ATTACHMENT0
,
d
,
a
.
__webglTexture
,
0
),
A
(
a
.
__webglRenderbuffer
,
a
),
c
&&
e
.
generateMipmap
(
e
.
TEXTURE_2D
);
b
?
e
.
bindTexture
(
e
.
TEXTURE_CUBE_MAP
,
null
):
e
.
bindTexture
(
e
.
TEXTURE_2D
,
null
);
e
.
bindRenderbuffer
(
e
.
RENDERBUFFER
,
null
);
e
.
bindFramebuffer
(
e
.
FRAMEBUFFER
,
null
)}
a
?(
b
=
b
?
a
.
__webglFramebuffer
[
a
.
activeCubeFace
]:
a
.
__webglFramebuffer
,
c
=
a
.
width
,
a
=
a
.
height
,
f
=
d
=
0
):(
b
=
null
,
c
=
Pb
,
a
=
ac
,
d
=
$b
,
f
=
Hb
);
b
!==
T
&&
(
e
.
bindFramebuffer
(
e
.
FRAMEBUFFER
,
b
),
e
.
viewport
(
d
,
f
,
c
,
a
),
T
=
b
);
pc
=
c
;
qc
=
a
};
this
.
shadowMapPlugin
=
new
THREE
.
ShadowMapPlugin
;
this
.
addPrePlugin
(
this
.
shadowMapPlugin
);
this
.
addPostPlugin
(
new
THREE
.
SpritePlugin
);
this
.
addPostPlugin
(
new
THREE
.
LensFlarePlugin
)};
THREE
.
WebGLRenderTarget
=
function
(
a
,
b
,
c
){
this
.
width
=
a
;
this
.
height
=
b
;
c
=
c
||
{};
this
.
wrapS
=
void
0
!==
c
.
wrapS
?
c
.
wrapS
:
THREE
.
ClampToEdgeWrapping
;
this
.
wrapT
=
void
0
!==
c
.
wrapT
?
c
.
wrapT
:
THREE
.
ClampToEdgeWrapping
;
this
.
magFilter
=
void
0
!==
c
.
magFilter
?
c
.
magFilter
:
THREE
.
LinearFilter
;
this
.
minFilter
=
void
0
!==
c
.
minFilter
?
c
.
minFilter
:
THREE
.
LinearMipMapLinearFilter
;
this
.
offset
=
new
THREE
.
Vector2
(
0
,
0
);
this
.
repeat
=
new
THREE
.
Vector2
(
1
,
1
);
this
.
format
=
void
0
!==
c
.
format
?
c
.
format
:
THREE
.
RGBAFormat
;
this
.
type
=
void
0
!==
c
.
type
?
c
.
type
:
THREE
.
UnsignedByteType
;
this
.
depthBuffer
=
void
0
!==
c
.
depthBuffer
?
c
.
depthBuffer
:
!
0
;
this
.
stencilBuffer
=
void
0
!==
c
.
stencilBuffer
?
c
.
stencilBuffer
:
!
0
;
this
.
generateMipmaps
=!
0
};
THREE
.
WebGLRenderTarget
.
prototype
.
clone
=
function
(){
var
a
=
new
THREE
.
WebGLRenderTarget
(
this
.
width
,
this
.
height
);
a
.
wrapS
=
this
.
wrapS
;
a
.
wrapT
=
this
.
wrapT
;
a
.
magFilter
=
this
.
magFilter
;
a
.
minFilter
=
this
.
minFilter
;
a
.
offset
.
copy
(
this
.
offset
);
a
.
repeat
.
copy
(
this
.
repeat
);
a
.
format
=
this
.
format
;
a
.
type
=
this
.
type
;
a
.
depthBuffer
=
this
.
depthBuffer
;
a
.
stencilBuffer
=
this
.
stencilBuffer
;
return
a
};
THREE
.
WebGLRenderTargetCube
=
function
(
a
,
b
,
c
){
THREE
.
WebGLRenderTarget
.
call
(
this
,
a
,
b
,
c
);
this
.
activeCubeFace
=
0
};
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
b6497304
...
...
@@ -5864,6 +5864,8 @@ THREE.WebGLRenderer = function ( parameters ) {
}
if
(
isTargetPowerOfTwo
)
_gl
.
generateMipmap
(
_gl
.
TEXTURE_CUBE_MAP
);
}
else
{
renderTarget
.
__webglFramebuffer
=
_gl
.
createFramebuffer
();
...
...
@@ -5877,6 +5879,8 @@ THREE.WebGLRenderer = function ( parameters ) {
setupFrameBuffer
(
renderTarget
.
__webglFramebuffer
,
renderTarget
,
_gl
.
TEXTURE_2D
);
setupRenderBuffer
(
renderTarget
.
__webglRenderbuffer
,
renderTarget
);
if
(
isTargetPowerOfTwo
)
_gl
.
generateMipmap
(
_gl
.
TEXTURE_2D
);
}
// Release everything
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录