Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
93287e89
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,发现更多精彩内容 >>
提交
93287e89
编写于
11月 18, 2016
作者:
A
aardgoose
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
convert {} to new THREE.Uniform()
上级
ea8bb4a9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
20 deletion
+19
-20
examples/js/postprocessing/BloomPass.js
examples/js/postprocessing/BloomPass.js
+8
-8
examples/js/postprocessing/ShaderPass.js
examples/js/postprocessing/ShaderPass.js
+1
-1
examples/js/postprocessing/TexturePass.js
examples/js/postprocessing/TexturePass.js
+2
-2
examples/webgl_materials_skin.html
examples/webgl_materials_skin.html
+8
-9
未找到文件。
examples/js/postprocessing/BloomPass.js
浏览文件 @
93287e89
...
...
@@ -27,7 +27,7 @@ THREE.BloomPass = function ( strength, kernelSize, sigma, resolution ) {
this
.
copyUniforms
=
Object
.
assign
(
{},
copyShader
.
uniforms
);
this
.
copyUniforms
[
"
opacity
"
]
=
{
value
:
strength
}
;
this
.
copyUniforms
[
"
opacity
"
]
=
new
THREE
.
Uniform
(
strength
)
;
this
.
materialCopy
=
new
THREE
.
ShaderMaterial
(
{
...
...
@@ -48,8 +48,8 @@ THREE.BloomPass = function ( strength, kernelSize, sigma, resolution ) {
this
.
convolutionUniforms
=
Object
.
assign
(
{},
convolutionShader
.
uniforms
);
this
.
convolutionUniforms
[
"
uImageIncrement
"
]
=
{
value
:
THREE
.
BloomPass
.
blurX
}
;
this
.
convolutionUniforms
[
"
cKernel
"
]
=
{
value
:
THREE
.
ConvolutionShader
.
buildKernel
(
sigma
)
}
;
this
.
convolutionUniforms
[
"
uImageIncrement
"
]
=
new
THREE
.
Uniform
(
THREE
.
BloomPass
.
blurX
)
;
this
.
convolutionUniforms
[
"
cKernel
"
]
=
new
THREE
.
Uniform
(
THREE
.
ConvolutionShader
.
buildKernel
(
sigma
)
)
;
this
.
materialConvolution
=
new
THREE
.
ShaderMaterial
(
{
...
...
@@ -85,16 +85,16 @@ THREE.BloomPass.prototype = Object.assign( Object.create( THREE.Pass.prototype )
this
.
quad
.
material
=
this
.
materialConvolution
;
this
.
convolutionUniforms
[
"
tDiffuse
"
]
=
{
value
:
readBuffer
.
texture
}
;
this
.
convolutionUniforms
[
"
uImageIncrement
"
]
=
{
value
:
THREE
.
BloomPass
.
blurX
}
;
this
.
convolutionUniforms
[
"
tDiffuse
"
]
=
new
THREE
.
Uniform
(
readBuffer
.
texture
)
;
this
.
convolutionUniforms
[
"
uImageIncrement
"
]
=
new
THREE
.
Uniform
(
THREE
.
BloomPass
.
blurX
)
;
renderer
.
render
(
this
.
scene
,
this
.
camera
,
this
.
renderTargetX
,
true
);
// Render quad with blured scene into texture (convolution pass 2)
this
.
convolutionUniforms
[
"
tDiffuse
"
]
=
{
value
:
this
.
renderTargetX
.
texture
}
;
this
.
convolutionUniforms
[
"
uImageIncrement
"
]
=
{
value
:
THREE
.
BloomPass
.
blurY
}
;
this
.
convolutionUniforms
[
"
tDiffuse
"
]
=
new
THREE
.
Uniform
(
this
.
renderTargetX
.
texture
)
;
this
.
convolutionUniforms
[
"
uImageIncrement
"
]
=
new
THREE
.
Uniform
(
THREE
.
BloomPass
.
blurY
)
;
renderer
.
render
(
this
.
scene
,
this
.
camera
,
this
.
renderTargetY
,
true
);
...
...
@@ -102,7 +102,7 @@ THREE.BloomPass.prototype = Object.assign( Object.create( THREE.Pass.prototype )
this
.
quad
.
material
=
this
.
materialCopy
;
this
.
copyUniforms
[
"
tDiffuse
"
]
=
{
value
:
this
.
renderTargetY
.
texture
}
;
this
.
copyUniforms
[
"
tDiffuse
"
]
=
new
THREE
.
Uniform
(
this
.
renderTargetY
.
texture
)
;
if
(
maskActive
)
renderer
.
context
.
enable
(
renderer
.
context
.
STENCIL_TEST
);
...
...
examples/js/postprocessing/ShaderPass.js
浏览文件 @
93287e89
...
...
@@ -45,7 +45,7 @@ THREE.ShaderPass.prototype = Object.assign( Object.create( THREE.Pass.prototype
if
(
this
.
uniforms
[
this
.
textureID
]
)
{
this
.
uniforms
[
this
.
textureID
]
=
{
value
:
readBuffer
.
texture
}
;
this
.
uniforms
[
this
.
textureID
]
=
new
THREE
.
Uniform
(
readBuffer
.
texture
)
;
}
...
...
examples/js/postprocessing/TexturePass.js
浏览文件 @
93287e89
...
...
@@ -47,8 +47,8 @@ THREE.TexturePass.prototype = Object.assign( Object.create( THREE.Pass.prototype
this
.
quad
.
material
=
this
.
material
;
this
.
uniforms
[
"
opacity
"
]
=
{
value
:
this
.
opacity
}
;
this
.
uniforms
[
"
tDiffuse
"
]
=
{
value
:
this
.
map
}
;
this
.
uniforms
[
"
opacity
"
]
=
new
THREE
.
Uniform
(
this
.
opacity
)
;
this
.
uniforms
[
"
tDiffuse
"
]
=
new
THREE
.
Uniform
(
this
.
map
)
;
this
.
material
.
transparent
=
(
this
.
opacity
<
1.0
);
renderer
.
render
(
this
.
scene
,
this
.
camera
,
this
.
renderToScreen
?
null
:
readBuffer
,
this
.
clear
);
...
...
examples/webgl_materials_skin.html
浏览文件 @
93287e89
...
...
@@ -134,10 +134,9 @@
var
uniforms
=
Object
.
assign
(
{},
uniformsUV
);
uniforms
[
"
tDiffuse
"
]
=
{
value
:
uniformsUV
[
"
tDiffuse
"
].
value
};
uniforms
[
"
tNormal
"
]
=
{
value
:
uniformsUV
[
"
tNormal
"
].
value
};
uniforms
[
"
passID
"
]
=
{
value
:
1
};
uniforms
[
"
tDiffuse
"
]
=
new
THREE
.
Uniform
(
uniformsUV
[
"
tDiffuse
"
].
value
);
uniforms
[
"
tNormal
"
]
=
new
THREE
.
Uniform
(
uniformsUV
[
"
tNormal
"
].
value
);
uniforms
[
"
passID
"
]
=
new
THREE
.
Uniform
(
1
);
var
parameters
=
{
fragmentShader
:
shader
.
fragmentShader
,
vertexShader
:
shader
.
vertexShader
,
uniforms
:
uniforms
,
lights
:
true
};
var
parametersUV
=
{
fragmentShader
:
shader
.
fragmentShader
,
vertexShader
:
shader
.
vertexShaderUV
,
uniforms
:
uniformsUV
,
lights
:
true
};
...
...
@@ -236,12 +235,12 @@
//
uniforms
[
"
tBlur1
"
]
=
{
value
:
composerScene
.
renderTarget2
.
texture
}
;
uniforms
[
"
tBlur2
"
]
=
{
value
:
composerUV1
.
renderTarget2
.
texture
}
;
uniforms
[
"
tBlur3
"
]
=
{
value
:
composerUV2
.
renderTarget2
.
texture
}
;
uniforms
[
"
tBlur4
"
]
=
{
value
:
composerUV3
.
renderTarget2
.
texture
}
;
uniforms
[
"
tBlur1
"
]
=
new
THREE
.
Uniform
(
composerScene
.
renderTarget2
.
texture
)
;
uniforms
[
"
tBlur2
"
]
=
new
THREE
.
Uniform
(
composerUV1
.
renderTarget2
.
texture
)
;
uniforms
[
"
tBlur3
"
]
=
new
THREE
.
Uniform
(
composerUV2
.
renderTarget2
.
texture
)
;
uniforms
[
"
tBlur4
"
]
=
new
THREE
.
Uniform
(
composerUV3
.
renderTarget2
.
texture
)
;
uniforms
[
"
tBeckmann
"
]
=
{
value
:
composerBeckmann
.
renderTarget1
.
texture
}
;
uniforms
[
"
tBeckmann
"
]
=
new
THREE
.
Uniform
(
composerBeckmann
.
renderTarget1
.
texture
)
;
//
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录