Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
8904cb3b
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,发现更多精彩内容 >>
未验证
提交
8904cb3b
编写于
4月 02, 2018
作者:
M
Mr.doob
提交者:
GitHub
4月 02, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13750 from WestLangley/dev-pmrem_cleanup
PMREM: Clean up
上级
d00ee6b9
bfd9631b
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
16 addition
and
15 deletion
+16
-15
examples/js/pmrem/PMREMCubeUVPacker.js
examples/js/pmrem/PMREMCubeUVPacker.js
+4
-5
examples/js/pmrem/PMREMGenerator.js
examples/js/pmrem/PMREMGenerator.js
+12
-10
未找到文件。
examples/js/pmrem/PMREMCubeUVPacker.js
浏览文件 @
8904cb3b
...
@@ -13,8 +13,7 @@
...
@@ -13,8 +13,7 @@
* The arrangement of the faces is fixed, as assuming this arrangement, the sampling function has been written.
* The arrangement of the faces is fixed, as assuming this arrangement, the sampling function has been written.
*/
*/
THREE
.
PMREMCubeUVPacker
=
function
(
cubeTextureLods
,
numLods
)
{
THREE
.
PMREMCubeUVPacker
=
function
(
cubeTextureLods
,
numLods
)
{
this
.
cubeLods
=
cubeTextureLods
;
this
.
cubeLods
=
cubeTextureLods
;
this
.
numLods
=
numLods
;
this
.
numLods
=
numLods
;
...
...
examples/js/pmrem/PMREMGenerator.js
浏览文件 @
8904cb3b
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
* by this class.
* by this class.
*/
*/
THREE
.
PMREMGenerator
=
function
(
sourceTexture
,
samplesPerLevel
,
resolution
)
{
THREE
.
PMREMGenerator
=
function
(
sourceTexture
,
samplesPerLevel
,
resolution
)
{
this
.
sourceTexture
=
sourceTexture
;
this
.
sourceTexture
=
sourceTexture
;
this
.
resolution
=
(
resolution
!==
undefined
)
?
resolution
:
256
;
// NODE: 256 is currently hard coded in the glsl code for performance reasons
this
.
resolution
=
(
resolution
!==
undefined
)
?
resolution
:
256
;
// NODE: 256 is currently hard coded in the glsl code for performance reasons
...
@@ -52,7 +52,7 @@ THREE.PMREMGenerator = function( sourceTexture, samplesPerLevel, resolution ) {
...
@@ -52,7 +52,7 @@ THREE.PMREMGenerator = function( sourceTexture, samplesPerLevel, resolution ) {
this
.
camera
=
new
THREE
.
OrthographicCamera
(
-
1
,
1
,
1
,
-
1
,
0.0
,
1000
);
this
.
camera
=
new
THREE
.
OrthographicCamera
(
-
1
,
1
,
1
,
-
1
,
0.0
,
1000
);
this
.
shader
=
this
.
getShader
();
this
.
shader
=
this
.
getShader
();
this
.
shader
.
defines
[
'
SAMPLES_PER_LEVEL
'
]
=
this
.
samplesPerLevel
;
this
.
shader
.
defines
[
'
SAMPLES_PER_LEVEL
'
]
=
this
.
samplesPerLevel
;
this
.
planeMesh
=
new
THREE
.
Mesh
(
new
THREE
.
PlaneGeometry
(
2
,
2
,
0
),
this
.
shader
);
this
.
planeMesh
=
new
THREE
.
Mesh
(
new
THREE
.
PlaneGeometry
(
2
,
2
,
0
),
this
.
shader
);
this
.
planeMesh
.
material
.
side
=
THREE
.
DoubleSide
;
this
.
planeMesh
.
material
.
side
=
THREE
.
DoubleSide
;
this
.
scene
=
new
THREE
.
Scene
();
this
.
scene
=
new
THREE
.
Scene
();
...
@@ -66,7 +66,7 @@ THREE.PMREMGenerator = function( sourceTexture, samplesPerLevel, resolution ) {
...
@@ -66,7 +66,7 @@ THREE.PMREMGenerator = function( sourceTexture, samplesPerLevel, resolution ) {
THREE
.
PMREMGenerator
.
prototype
=
{
THREE
.
PMREMGenerator
.
prototype
=
{
constructor
:
THREE
.
PMREMGenerator
,
constructor
:
THREE
.
PMREMGenerator
,
/*
/*
* Prashant Sharma / spidersharma03: More thought and work is needed here.
* Prashant Sharma / spidersharma03: More thought and work is needed here.
...
@@ -81,7 +81,7 @@ THREE.PMREMGenerator.prototype = {
...
@@ -81,7 +81,7 @@ THREE.PMREMGenerator.prototype = {
* This method requires the most amount of thinking I guess. Here is a paper which we could try to implement in future::
* This method requires the most amount of thinking I guess. Here is a paper which we could try to implement in future::
* http://http.developer.nvidia.com/GPUGems3/gpugems3_ch20.html
* http://http.developer.nvidia.com/GPUGems3/gpugems3_ch20.html
*/
*/
update
:
function
(
renderer
)
{
update
:
function
(
renderer
)
{
this
.
shader
.
uniforms
[
'
envMap
'
].
value
=
this
.
sourceTexture
;
this
.
shader
.
uniforms
[
'
envMap
'
].
value
=
this
.
sourceTexture
;
this
.
shader
.
envMap
=
this
.
sourceTexture
;
this
.
shader
.
envMap
=
this
.
sourceTexture
;
...
@@ -101,7 +101,7 @@ THREE.PMREMGenerator.prototype = {
...
@@ -101,7 +101,7 @@ THREE.PMREMGenerator.prototype = {
var
r
=
i
/
(
this
.
numLods
-
1
);
var
r
=
i
/
(
this
.
numLods
-
1
);
this
.
shader
.
uniforms
[
'
roughness
'
].
value
=
r
*
0.9
;
// see comment above, pragmatic choice
this
.
shader
.
uniforms
[
'
roughness
'
].
value
=
r
*
0.9
;
// see comment above, pragmatic choice
this
.
shader
.
uniforms
[
'
queryScale
'
].
value
.
x
=
(
i
==
0
)
?
-
1
:
1
;
this
.
shader
.
uniforms
[
'
queryScale
'
].
value
.
x
=
(
i
==
0
)
?
-
1
:
1
;
var
size
=
this
.
cubeLods
[
i
].
width
;
var
size
=
this
.
cubeLods
[
i
].
width
;
this
.
shader
.
uniforms
[
'
mapSize
'
].
value
=
size
;
this
.
shader
.
uniforms
[
'
mapSize
'
].
value
=
size
;
this
.
renderToCubeMapTarget
(
renderer
,
this
.
cubeLods
[
i
]
);
this
.
renderToCubeMapTarget
(
renderer
,
this
.
cubeLods
[
i
]
);
...
@@ -118,17 +118,17 @@ THREE.PMREMGenerator.prototype = {
...
@@ -118,17 +118,17 @@ THREE.PMREMGenerator.prototype = {
},
},
renderToCubeMapTarget
:
function
(
renderer
,
renderTarget
)
{
renderToCubeMapTarget
:
function
(
renderer
,
renderTarget
)
{
for
(
var
i
=
0
;
i
<
6
;
i
++
)
{
for
(
var
i
=
0
;
i
<
6
;
i
++
)
{
this
.
renderToCubeMapTargetFace
(
renderer
,
renderTarget
,
i
)
this
.
renderToCubeMapTargetFace
(
renderer
,
renderTarget
,
i
)
;
}
}
},
},
renderToCubeMapTargetFace
:
function
(
renderer
,
renderTarget
,
faceIndex
)
{
renderToCubeMapTargetFace
:
function
(
renderer
,
renderTarget
,
faceIndex
)
{
renderTarget
.
activeCubeFace
=
faceIndex
;
renderTarget
.
activeCubeFace
=
faceIndex
;
this
.
shader
.
uniforms
[
'
faceIndex
'
].
value
=
faceIndex
;
this
.
shader
.
uniforms
[
'
faceIndex
'
].
value
=
faceIndex
;
...
@@ -136,7 +136,7 @@ THREE.PMREMGenerator.prototype = {
...
@@ -136,7 +136,7 @@ THREE.PMREMGenerator.prototype = {
},
},
getShader
:
function
()
{
getShader
:
function
()
{
return
new
THREE
.
ShaderMaterial
(
{
return
new
THREE
.
ShaderMaterial
(
{
...
@@ -258,12 +258,14 @@ THREE.PMREMGenerator.prototype = {
...
@@ -258,12 +258,14 @@ THREE.PMREMGenerator.prototype = {
//rgbColor = testColorMap( roughness ).rgb;
\n\
//rgbColor = testColorMap( roughness ).rgb;
\n\
gl_FragColor = linearToOutputTexel( vec4( rgbColor, 1.0 ) );
\n\
gl_FragColor = linearToOutputTexel( vec4( rgbColor, 1.0 ) );
\n\
}
"
,
}
"
,
blending
:
THREE
.
CustomBlending
,
blending
:
THREE
.
CustomBlending
,
blendSrc
:
THREE
.
OneFactor
,
blendSrc
:
THREE
.
OneFactor
,
blendDst
:
THREE
.
ZeroFactor
,
blendDst
:
THREE
.
ZeroFactor
,
blendSrcAlpha
:
THREE
.
OneFactor
,
blendSrcAlpha
:
THREE
.
OneFactor
,
blendDstAlpha
:
THREE
.
ZeroFactor
,
blendDstAlpha
:
THREE
.
ZeroFactor
,
blendEquation
:
THREE
.
AddEquation
blendEquation
:
THREE
.
AddEquation
}
);
}
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录