Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
636d2e5d
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,发现更多精彩内容 >>
提交
636d2e5d
编写于
12月 07, 2016
作者:
B
Ben Houston
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
set render target names properly for all created render targets in ThreeJS.
上级
4f53d937
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
35 addition
and
9 deletion
+35
-9
examples/js/pmrem/PMREMCubeUVPacker.js
examples/js/pmrem/PMREMCubeUVPacker.js
+1
-0
examples/js/pmrem/PMREMGenerator.js
examples/js/pmrem/PMREMGenerator.js
+1
-0
examples/js/postprocessing/AdaptiveToneMappingPass.js
examples/js/postprocessing/AdaptiveToneMappingPass.js
+3
-0
examples/js/postprocessing/BloomPass.js
examples/js/postprocessing/BloomPass.js
+2
-0
examples/js/postprocessing/BokehPass.js
examples/js/postprocessing/BokehPass.js
+3
-1
examples/js/postprocessing/EffectComposer.js
examples/js/postprocessing/EffectComposer.js
+2
-1
examples/js/postprocessing/OutlinePass.js
examples/js/postprocessing/OutlinePass.js
+7
-0
examples/js/postprocessing/SMAAPass.js
examples/js/postprocessing/SMAAPass.js
+6
-2
examples/js/postprocessing/SSAARenderPass.js
examples/js/postprocessing/SSAARenderPass.js
+1
-1
examples/js/postprocessing/SavePass.js
examples/js/postprocessing/SavePass.js
+1
-1
examples/js/postprocessing/TAARenderPass.js
examples/js/postprocessing/TAARenderPass.js
+2
-0
examples/js/postprocessing/UnrealBloomPass.js
examples/js/postprocessing/UnrealBloomPass.js
+3
-0
examples/webgl_postprocessing_ssao.html
examples/webgl_postprocessing_ssao.html
+1
-1
src/cameras/CubeCamera.js
src/cameras/CubeCamera.js
+1
-1
src/renderers/webgl/WebGLShadowMap.js
src/renderers/webgl/WebGLShadowMap.js
+1
-1
未找到文件。
examples/js/pmrem/PMREMCubeUVPacker.js
浏览文件 @
636d2e5d
...
...
@@ -32,6 +32,7 @@ THREE.PMREMCubeUVPacker = function( cubeTextureLods, numLods ) {
};
this
.
CubeUVRenderTarget
=
new
THREE
.
WebGLRenderTarget
(
size
,
size
,
params
);
this
.
CubeUVRenderTarget
.
texture
.
name
=
"
PMREMCubeUVPacker.cubeUv
"
;
this
.
CubeUVRenderTarget
.
texture
.
mapping
=
THREE
.
CubeUVReflectionMapping
;
this
.
camera
=
new
THREE
.
OrthographicCamera
(
-
size
*
0.5
,
size
*
0.5
,
-
size
*
0.5
,
size
*
0.5
,
0.0
,
1000
);
...
...
examples/js/pmrem/PMREMGenerator.js
浏览文件 @
636d2e5d
...
...
@@ -42,6 +42,7 @@ THREE.PMREMGenerator = function( sourceTexture ) {
for
(
var
i
=
0
;
i
<
this
.
numLods
;
i
++
)
{
var
renderTarget
=
new
THREE
.
WebGLRenderTargetCube
(
size
,
size
,
params
);
renderTarget
.
texture
.
name
=
"
PMREMGenerator.cube
"
+
i
;
this
.
cubeLods
.
push
(
renderTarget
);
size
=
Math
.
max
(
16
,
size
/
2
);
...
...
examples/js/postprocessing/AdaptiveToneMappingPass.js
浏览文件 @
636d2e5d
...
...
@@ -190,14 +190,17 @@ THREE.AdaptiveToneMappingPass.prototype = Object.assign( Object.create( THREE.Pa
var
pars
=
{
minFilter
:
THREE
.
LinearFilter
,
magFilter
:
THREE
.
LinearFilter
,
format
:
THREE
.
RGBAFormat
};
// was RGB format. changed to RGBA format. see discussion in #8415 / #8450
this
.
luminanceRT
=
new
THREE
.
WebGLRenderTarget
(
this
.
resolution
,
this
.
resolution
,
pars
);
this
.
luminanceRT
.
texture
.
name
=
"
AdaptiveToneMappingPass.l
"
;
this
.
luminanceRT
.
texture
.
generateMipmaps
=
false
;
this
.
previousLuminanceRT
=
new
THREE
.
WebGLRenderTarget
(
this
.
resolution
,
this
.
resolution
,
pars
);
this
.
previousLuminanceRT
.
texture
.
name
=
"
AdaptiveToneMappingPass.pl
"
;
this
.
previousLuminanceRT
.
texture
.
generateMipmaps
=
false
;
// We only need mipmapping for the current luminosity because we want a down-sampled version to sample in our adaptive shader
pars
.
minFilter
=
THREE
.
LinearMipMapLinearFilter
;
this
.
currentLuminanceRT
=
new
THREE
.
WebGLRenderTarget
(
this
.
resolution
,
this
.
resolution
,
pars
);
this
.
currentLuminanceRT
.
texture
.
name
=
"
AdaptiveToneMappingPass.cl
"
;
if
(
this
.
adaptive
)
{
...
...
examples/js/postprocessing/BloomPass.js
浏览文件 @
636d2e5d
...
...
@@ -16,7 +16,9 @@ THREE.BloomPass = function ( strength, kernelSize, sigma, resolution ) {
var
pars
=
{
minFilter
:
THREE
.
LinearFilter
,
magFilter
:
THREE
.
LinearFilter
,
format
:
THREE
.
RGBAFormat
};
this
.
renderTargetX
=
new
THREE
.
WebGLRenderTarget
(
resolution
,
resolution
,
pars
);
this
.
renderTargetX
.
texture
.
name
=
"
BloomPass.x
"
;
this
.
renderTargetY
=
new
THREE
.
WebGLRenderTarget
(
resolution
,
resolution
,
pars
);
this
.
renderTargetY
.
texture
.
name
=
"
BloomPass.y
"
;
// copy material
...
...
examples/js/postprocessing/BokehPass.js
浏览文件 @
636d2e5d
...
...
@@ -23,10 +23,12 @@ THREE.BokehPass = function ( scene, camera, params ) {
this
.
renderTargetColor
=
new
THREE
.
WebGLRenderTarget
(
width
,
height
,
{
minFilter
:
THREE
.
LinearFilter
,
magFilter
:
THREE
.
LinearFilter
,
format
:
THREE
.
RGBFormat
format
:
THREE
.
RGBFormat
,
name
:
"
BokehPass.color
"
}
);
this
.
renderTargetDepth
=
this
.
renderTargetColor
.
clone
();
this
.
renderTargetDepth
.
texture
.
name
=
"
BokehPass.depth
"
;
// depth material
...
...
examples/js/postprocessing/EffectComposer.js
浏览文件 @
636d2e5d
...
...
@@ -16,11 +16,12 @@ THREE.EffectComposer = function ( renderer, renderTarget ) {
};
var
size
=
renderer
.
getSize
();
renderTarget
=
new
THREE
.
WebGLRenderTarget
(
size
.
width
,
size
.
height
,
parameters
);
renderTarget
.
texture
.
name
=
"
EffectComposer.rt1
"
;
}
this
.
renderTarget1
=
renderTarget
;
this
.
renderTarget2
=
renderTarget
.
clone
();
this
.
renderTarget2
.
texture
.
name
=
"
EffectComposer.rt2
"
;
this
.
writeBuffer
=
this
.
renderTarget1
;
this
.
readBuffer
=
this
.
renderTarget2
;
...
...
examples/js/postprocessing/OutlinePass.js
浏览文件 @
636d2e5d
...
...
@@ -28,6 +28,7 @@ THREE.OutlinePass = function ( resolution, scene, camera, selectedObjects ) {
this
.
maskBufferMaterial
=
new
THREE
.
MeshBasicMaterial
({
color
:
0xffffff
});
this
.
maskBufferMaterial
.
side
=
THREE
.
DoubleSide
;
this
.
renderTargetMaskBuffer
=
new
THREE
.
WebGLRenderTarget
(
this
.
resolution
.
x
,
this
.
resolution
.
y
,
pars
);
this
.
renderTargetMaskBuffer
.
texture
.
name
=
"
OutlinePass.mask
"
;
this
.
renderTargetMaskBuffer
.
texture
.
generateMipmaps
=
false
;
this
.
depthMaterial
=
new
THREE
.
MeshDepthMaterial
();
...
...
@@ -39,20 +40,26 @@ THREE.OutlinePass = function ( resolution, scene, camera, selectedObjects ) {
this
.
prepareMaskMaterial
.
side
=
THREE
.
DoubleSide
;
this
.
renderTargetDepthBuffer
=
new
THREE
.
WebGLRenderTarget
(
this
.
resolution
.
x
,
this
.
resolution
.
y
,
pars
);
this
.
renderTargetDepthBuffer
.
texture
.
name
=
"
OutlinePass.depth
"
;
this
.
renderTargetDepthBuffer
.
texture
.
generateMipmaps
=
false
;
this
.
renderTargetMaskDownSampleBuffer
=
new
THREE
.
WebGLRenderTarget
(
resx
,
resy
,
pars
);
this
.
renderTargetMaskDownSampleBuffer
.
texture
.
name
=
"
OutlinePass.depthDownSample
"
;
this
.
renderTargetMaskDownSampleBuffer
.
texture
.
generateMipmaps
=
false
;
this
.
renderTargetBlurBuffer1
=
new
THREE
.
WebGLRenderTarget
(
resx
,
resy
,
pars
);
this
.
renderTargetBlurBuffer1
.
texture
.
name
=
"
OutlinePass.blur1
"
;
this
.
renderTargetBlurBuffer1
.
texture
.
generateMipmaps
=
false
;
this
.
renderTargetBlurBuffer2
=
new
THREE
.
WebGLRenderTarget
(
Math
.
round
(
resx
/
2
),
Math
.
round
(
resy
/
2
),
pars
);
this
.
renderTargetBlurBuffer2
.
texture
.
name
=
"
OutlinePass.blur2
"
;
this
.
renderTargetBlurBuffer2
.
texture
.
generateMipmaps
=
false
;
this
.
edgeDetectionMaterial
=
this
.
getEdgeDetectionMaterial
();
this
.
renderTargetEdgeBuffer1
=
new
THREE
.
WebGLRenderTarget
(
resx
,
resy
,
pars
);
this
.
renderTargetEdgeBuffer1
.
texture
.
name
=
"
OutlinePass.edge1
"
;
this
.
renderTargetEdgeBuffer1
.
texture
.
generateMipmaps
=
false
;
this
.
renderTargetEdgeBuffer2
=
new
THREE
.
WebGLRenderTarget
(
Math
.
round
(
resx
/
2
),
Math
.
round
(
resy
/
2
),
pars
);
this
.
renderTargetEdgeBuffer2
.
texture
.
name
=
"
OutlinePass.edge2
"
;
this
.
renderTargetEdgeBuffer2
.
texture
.
generateMipmaps
=
false
;
var
MAX_EDGE_THICKNESS
=
4
;
...
...
examples/js/postprocessing/SMAAPass.js
浏览文件 @
636d2e5d
...
...
@@ -13,7 +13,8 @@ THREE.SMAAPass = function ( width, height ) {
stencilBuffer
:
false
,
generateMipmaps
:
false
,
minFilter
:
THREE
.
LinearFilter
,
format
:
THREE
.
RGBFormat
format
:
THREE
.
RGBFormat
,
name
:
"
SMAAPass.edges
"
}
);
this
.
weightsRT
=
new
THREE
.
WebGLRenderTarget
(
width
,
height
,
{
...
...
@@ -21,7 +22,8 @@ THREE.SMAAPass = function ( width, height ) {
stencilBuffer
:
false
,
generateMipmaps
:
false
,
minFilter
:
THREE
.
LinearFilter
,
format
:
THREE
.
RGBAFormat
format
:
THREE
.
RGBAFormat
,
name
:
"
SMAAPass.weights
"
}
);
// textures
...
...
@@ -30,6 +32,7 @@ THREE.SMAAPass = function ( width, height ) {
areaTextureImage
.
src
=
this
.
getAreaTexture
();
this
.
areaTexture
=
new
THREE
.
Texture
();
this
.
areaTexture
.
name
=
"
SMAAPass.area
"
;
this
.
areaTexture
.
image
=
areaTextureImage
;
this
.
areaTexture
.
format
=
THREE
.
RGBFormat
;
this
.
areaTexture
.
minFilter
=
THREE
.
LinearFilter
;
...
...
@@ -41,6 +44,7 @@ THREE.SMAAPass = function ( width, height ) {
searchTextureImage
.
src
=
this
.
getSearchTexture
();
this
.
searchTexture
=
new
THREE
.
Texture
();
this
.
searchTexture
.
name
=
"
SMAAPass.search
"
;
this
.
searchTexture
.
image
=
searchTextureImage
;
this
.
searchTexture
.
magFilter
=
THREE
.
NearestFilter
;
this
.
searchTexture
.
minFilter
=
THREE
.
NearestFilter
;
...
...
examples/js/postprocessing/SSAARenderPass.js
浏览文件 @
636d2e5d
...
...
@@ -73,7 +73,7 @@ THREE.SSAARenderPass.prototype = Object.assign( Object.create( THREE.Pass.protot
if
(
!
this
.
sampleRenderTarget
)
{
this
.
sampleRenderTarget
=
new
THREE
.
WebGLRenderTarget
(
readBuffer
.
width
,
readBuffer
.
height
,
{
minFilter
:
THREE
.
LinearFilter
,
magFilter
:
THREE
.
LinearFilter
,
format
:
THREE
.
RGBAFormat
}
);
{
minFilter
:
THREE
.
LinearFilter
,
magFilter
:
THREE
.
LinearFilter
,
format
:
THREE
.
RGBAFormat
,
name
:
"
SSAARenderPass.sample
"
}
);
}
...
...
examples/js/postprocessing/SavePass.js
浏览文件 @
636d2e5d
...
...
@@ -27,7 +27,7 @@ THREE.SavePass = function ( renderTarget ) {
if
(
this
.
renderTarget
===
undefined
)
{
this
.
renderTargetParameters
=
{
minFilter
:
THREE
.
LinearFilter
,
magFilter
:
THREE
.
LinearFilter
,
format
:
THREE
.
RGBFormat
,
stencilBuffer
:
false
};
this
.
renderTargetParameters
=
{
minFilter
:
THREE
.
LinearFilter
,
magFilter
:
THREE
.
LinearFilter
,
format
:
THREE
.
RGBFormat
,
stencilBuffer
:
false
,
name
:
"
SavePass.rt
"
};
this
.
renderTarget
=
new
THREE
.
WebGLRenderTarget
(
window
.
innerWidth
,
window
.
innerHeight
,
this
.
renderTargetParameters
);
}
...
...
examples/js/postprocessing/TAARenderPass.js
浏览文件 @
636d2e5d
...
...
@@ -49,12 +49,14 @@ THREE.TAARenderPass.prototype = Object.assign( Object.create( THREE.SSAARenderPa
if
(
!
this
.
sampleRenderTarget
)
{
this
.
sampleRenderTarget
=
new
THREE
.
WebGLRenderTarget
(
readBuffer
.
width
,
readBuffer
.
height
,
this
.
params
);
this
.
sampleRenderTarget
.
texture
.
name
=
"
TAARenderPass.sample
"
;
}
if
(
!
this
.
holdRenderTarget
)
{
this
.
holdRenderTarget
=
new
THREE
.
WebGLRenderTarget
(
readBuffer
.
width
,
readBuffer
.
height
,
this
.
params
);
this
.
holdRenderTarget
.
texture
.
name
=
"
TAARenderPass.hold
"
;
}
...
...
examples/js/postprocessing/UnrealBloomPass.js
浏览文件 @
636d2e5d
...
...
@@ -22,18 +22,21 @@ THREE.UnrealBloomPass = function ( resolution, strength, radius, threshold ) {
var
resy
=
Math
.
round
(
this
.
resolution
.
y
/
2
);
this
.
renderTargetBright
=
new
THREE
.
WebGLRenderTarget
(
resx
,
resy
,
pars
);
this
.
renderTargetBright
.
texture
.
name
=
"
UnrealBloomPass.bright
"
;
this
.
renderTargetBright
.
texture
.
generateMipmaps
=
false
;
for
(
var
i
=
0
;
i
<
this
.
nMips
;
i
++
)
{
var
renderTarget
=
new
THREE
.
WebGLRenderTarget
(
resx
,
resy
,
pars
);
renderTarget
.
texture
.
name
=
"
UnrealBloomPass.h
"
+
i
;
renderTarget
.
texture
.
generateMipmaps
=
false
;
this
.
renderTargetsHorizontal
.
push
(
renderTarget
);
var
renderTarget
=
new
THREE
.
WebGLRenderTarget
(
resx
,
resy
,
pars
);
renderTarget
.
texture
.
name
=
"
UnrealBloomPass.v
"
+
i
;
renderTarget
.
texture
.
generateMipmaps
=
false
;
this
.
renderTargetsVertical
.
push
(
renderTarget
);
...
...
examples/webgl_postprocessing_ssao.html
浏览文件 @
636d2e5d
...
...
@@ -178,7 +178,7 @@ Spiral sampling http://web.archive.org/web/20120421191837/http://www.cgafaq.info
depthMaterial
.
depthPacking
=
THREE
.
RGBADepthPacking
;
depthMaterial
.
blending
=
THREE
.
NoBlending
;
var
pars
=
{
minFilter
:
THREE
.
LinearFilter
,
magFilter
:
THREE
.
LinearFilter
};
var
pars
=
{
minFilter
:
THREE
.
LinearFilter
,
magFilter
:
THREE
.
LinearFilter
,
name
:
"
SSAOShader.rt
"
};
depthRenderTarget
=
new
THREE
.
WebGLRenderTarget
(
window
.
innerWidth
,
window
.
innerHeight
,
pars
);
// Setup SSAO pass
...
...
src/cameras/CubeCamera.js
浏览文件 @
636d2e5d
...
...
@@ -49,7 +49,7 @@ function CubeCamera( near, far, cubeResolution ) {
cameraNZ
.
lookAt
(
new
Vector3
(
0
,
0
,
-
1
)
);
this
.
add
(
cameraNZ
);
var
options
=
{
format
:
RGBFormat
,
magFilter
:
LinearFilter
,
minFilter
:
LinearFilter
};
var
options
=
{
format
:
RGBFormat
,
magFilter
:
LinearFilter
,
minFilter
:
LinearFilter
,
name
:
"
cubeCamera
"
};
this
.
renderTarget
=
new
WebGLRenderTargetCube
(
cubeResolution
,
cubeResolution
,
options
);
...
...
src/renderers/webgl/WebGLShadowMap.js
浏览文件 @
636d2e5d
...
...
@@ -186,7 +186,7 @@ function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) {
if
(
shadow
.
map
===
null
)
{
var
pars
=
{
minFilter
:
NearestFilter
,
magFilter
:
NearestFilter
,
format
:
RGBAFormat
};
var
pars
=
{
minFilter
:
NearestFilter
,
magFilter
:
NearestFilter
,
format
:
RGBAFormat
,
name
:
(
light
.
name
+
"
.shadowMap
"
)
};
shadow
.
map
=
new
WebGLRenderTarget
(
_shadowMapSize
.
x
,
_shadowMapSize
.
y
,
pars
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录