Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
47afab80
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,发现更多精彩内容 >>
提交
47afab80
编写于
11月 22, 2019
作者:
E
Emmett Lalish
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
2k -> 1k envMaps
上级
9dbd38f3
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
21 addition
and
36 deletion
+21
-36
examples/js/pmrem/PMREMGenerator.js
examples/js/pmrem/PMREMGenerator.js
+6
-7
examples/jsm/pmrem/PMREMGenerator.js
examples/jsm/pmrem/PMREMGenerator.js
+8
-8
examples/textures/equirectangular/pedestrian_overpass_1k.hdr
examples/textures/equirectangular/pedestrian_overpass_1k.hdr
+0
-0
examples/textures/equirectangular/pedestrian_overpass_2k.hdr
examples/textures/equirectangular/pedestrian_overpass_2k.hdr
+0
-0
examples/textures/equirectangular/venice_sunset_1k.hdr
examples/textures/equirectangular/venice_sunset_1k.hdr
+0
-0
examples/textures/equirectangular/venice_sunset_2k.hdr
examples/textures/equirectangular/venice_sunset_2k.hdr
+0
-0
examples/webgl_loader_gltf.html
examples/webgl_loader_gltf.html
+3
-3
examples/webgl_loader_gltf_extensions.html
examples/webgl_loader_gltf_extensions.html
+4
-18
未找到文件。
examples/js/pmrem/PMREMGenerator.js
浏览文件 @
47afab80
...
...
@@ -23,9 +23,8 @@ THREE.PMREMGenerator = ( function () {
// variance #defines in cube_uv_reflection_fragment.glsl.js.
var
EXTRA_LOD_SIGMA
=
[
0.125
,
0.215
,
0.35
,
0.446
,
0.526
,
0.582
];
var
TOTAL_LODS
=
LOD_MAX
-
LOD_MIN
+
1
+
EXTRA_LOD_SIGMA
.
length
;
// The maximum length of the blur for loop, chosen to equal the number needed
// for GENERATED_SIGMA. Smaller _sigmas will use fewer samples and exit early,
// but not recompile the shader.
// The maximum length of the blur for loop. Smaller sigmas will use fewer
// samples and exit early, but not recompile the shader.
var
MAX_SAMPLES
=
20
;
var
ENCODINGS
=
{
[
THREE
.
LinearEncoding
]:
0
,
...
...
@@ -173,10 +172,10 @@ THREE.PMREMGenerator = ( function () {
}
var
planes
=
new
THREE
.
BufferGeometry
();
planes
.
add
Attribute
(
planes
.
set
Attribute
(
'
position
'
,
new
THREE
.
BufferAttribute
(
position
,
positionSize
)
);
planes
.
add
Attribute
(
'
uv
'
,
new
THREE
.
BufferAttribute
(
uv
,
uvSize
)
);
planes
.
add
Attribute
(
planes
.
set
Attribute
(
'
uv
'
,
new
THREE
.
BufferAttribute
(
uv
,
uvSize
)
);
planes
.
set
Attribute
(
'
faceIndex
'
,
new
THREE
.
BufferAttribute
(
faceIndex
,
faceIndexSize
)
);
_lodPlanes
.
push
(
planes
);
...
...
@@ -214,7 +213,7 @@ THREE.PMREMGenerator = ( function () {
_pingPongRenderTarget
.
dispose
();
_renderer
.
setRenderTarget
(
null
);
var
size
=
_renderer
.
getSize
();
var
size
=
_renderer
.
getSize
(
new
THREE
.
Vector2
()
);
_renderer
.
setViewport
(
0
,
0
,
size
.
x
,
size
.
y
);
}
...
...
examples/jsm/pmrem/PMREMGenerator.js
浏览文件 @
47afab80
...
...
@@ -45,12 +45,12 @@ var PMREMGenerator = ( function () {
var
SIZE_MAX
=
Math
.
pow
(
2
,
LOD_MAX
);
// The standard deviations (radians) associated with the extra mips. These are
// chosen to approximate a Trowbridge-Reitz distribution function times the
// geometric shadowing function.
// geometric shadowing function. These sigma values squared must match the
// variance #defines in cube_uv_reflection_fragment.glsl.js.
var
EXTRA_LOD_SIGMA
=
[
0.125
,
0.215
,
0.35
,
0.446
,
0.526
,
0.582
];
var
TOTAL_LODS
=
LOD_MAX
-
LOD_MIN
+
1
+
EXTRA_LOD_SIGMA
.
length
;
// The maximum length of the blur for loop, chosen to equal the number needed
// for GENERATED_SIGMA. Smaller _sigmas will use fewer samples and exit early,
// but not recompile the shader.
// The maximum length of the blur for loop. Smaller sigmas will use fewer
// samples and exit early, but not recompile the shader.
var
MAX_SAMPLES
=
20
;
var
ENCODINGS
=
{
[
LinearEncoding
]:
0
,
...
...
@@ -198,10 +198,10 @@ var PMREMGenerator = ( function () {
}
var
planes
=
new
BufferGeometry
();
planes
.
add
Attribute
(
planes
.
set
Attribute
(
'
position
'
,
new
BufferAttribute
(
position
,
positionSize
)
);
planes
.
add
Attribute
(
'
uv
'
,
new
BufferAttribute
(
uv
,
uvSize
)
);
planes
.
add
Attribute
(
planes
.
set
Attribute
(
'
uv
'
,
new
BufferAttribute
(
uv
,
uvSize
)
);
planes
.
set
Attribute
(
'
faceIndex
'
,
new
BufferAttribute
(
faceIndex
,
faceIndexSize
)
);
_lodPlanes
.
push
(
planes
);
...
...
@@ -239,7 +239,7 @@ var PMREMGenerator = ( function () {
_pingPongRenderTarget
.
dispose
();
_renderer
.
setRenderTarget
(
null
);
var
size
=
_renderer
.
getSize
();
var
size
=
_renderer
.
getSize
(
new
Vector2
()
);
_renderer
.
setViewport
(
0
,
0
,
size
.
x
,
size
.
y
);
}
...
...
examples/textures/equirectangular/pedestrian_overpass_1k.hdr
0 → 100644
浏览文件 @
47afab80
文件已添加
examples/textures/equirectangular/pedestrian_overpass_2k.hdr
已删除
100644 → 0
浏览文件 @
9dbd38f3
文件已删除
examples/textures/equirectangular/venice_sunset_1k.hdr
0 → 100644
浏览文件 @
47afab80
文件已添加
examples/textures/equirectangular/venice_sunset_2k.hdr
已删除
100644 → 0
浏览文件 @
9dbd38f3
文件已删除
examples/webgl_loader_gltf.html
浏览文件 @
47afab80
...
...
@@ -45,12 +45,12 @@
new
RGBELoader
()
.
setDataType
(
THREE
.
UnsignedByteType
)
.
setPath
(
'
textures/equirectangular/
'
)
.
load
(
'
pedestrian_overpass_
2
k.hdr
'
,
function
(
texture
)
{
.
load
(
'
pedestrian_overpass_
1
k.hdr
'
,
function
(
texture
)
{
var
pmremGenerator
=
new
PMREMGenerator
(
renderer
);
scene
.
background
=
pmremGenerator
.
fromEquirectangular
(
texture
).
texture
;
var
envMap
=
pmremGenerator
.
fromEquirectangular
(
texture
).
texture
;
var
envMap
=
scene
.
background
;
scene
.
background
=
envMap
;
// model
...
...
examples/webgl_loader_gltf_extensions.html
浏览文件 @
47afab80
...
...
@@ -27,7 +27,6 @@
import
{
DRACOLoader
}
from
'
./jsm/loaders/DRACOLoader.js
'
;
import
{
RGBELoader
}
from
'
./jsm/loaders/RGBELoader.js
'
;
import
{
PMREMGenerator
}
from
'
./jsm/pmrem/PMREMGenerator.js
'
;
import
{
PMREMCubeUVPacker
}
from
'
./jsm/pmrem/PMREMCubeUVPacker.js
'
;
var
orbitControls
;
var
container
,
camera
,
scene
,
renderer
,
loader
;
...
...
@@ -156,25 +155,12 @@
new
RGBELoader
()
.
setDataType
(
THREE
.
UnsignedByteType
)
.
setPath
(
'
textures/equirectangular/
'
)
.
load
(
'
venice_sunset_
2
k.hdr
'
,
function
(
texture
)
{
.
load
(
'
venice_sunset_
1
k.hdr
'
,
function
(
texture
)
{
var
options
=
{
minFilter
:
texture
.
minFilter
,
magFilter
:
texture
.
magFilter
};
var
pmremGenerator
=
new
PMREMGenerator
(
renderer
);
envMap
=
pmremGenerator
.
fromEquirectangular
(
texture
).
texture
;
background
=
new
THREE
.
WebGLRenderTargetCube
(
1024
,
1024
,
options
).
fromEquirectangularTexture
(
renderer
,
texture
);
var
pmremGenerator
=
new
PMREMGenerator
(
background
.
texture
);
pmremGenerator
.
update
(
renderer
);
var
pmremCubeUVPacker
=
new
PMREMCubeUVPacker
(
pmremGenerator
.
cubeLods
);
pmremCubeUVPacker
.
update
(
renderer
);
envMap
=
pmremCubeUVPacker
.
CubeUVRenderTarget
.
texture
;
pmremGenerator
.
dispose
();
pmremCubeUVPacker
.
dispose
();
background
=
envMap
;
//
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录