Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
a3b72a98
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
a3b72a98
编写于
4月 17, 2021
作者:
M
Michael Herzog
提交者:
GitHub
4月 17, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Examples: Clean up. (#21671)
上级
e2e3c295
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
43 addition
and
40 deletion
+43
-40
examples/js/loaders/FBXLoader.js
examples/js/loaders/FBXLoader.js
+1
-1
examples/js/shaders/SSRShader.js
examples/js/shaders/SSRShader.js
+41
-38
examples/jsm/loaders/FBXLoader.js
examples/jsm/loaders/FBXLoader.js
+1
-1
未找到文件。
examples/js/loaders/FBXLoader.js
浏览文件 @
a3b72a98
...
...
@@ -3594,7 +3594,7 @@
function
isFbxFormatBinary
(
buffer
)
{
const
CORRECT
=
'
Kaydara
FBX Binary
\
0
'
;
const
CORRECT
=
'
Kaydara
\
u0020FBX
\
u0020Binary
\
u0020
\
u0020
\
0
'
;
return
buffer
.
byteLength
>=
CORRECT
.
length
&&
CORRECT
===
convertArrayBufferToString
(
buffer
,
0
,
CORRECT
.
length
);
}
...
...
examples/js/shaders/SSRShader.js
浏览文件 @
a3b72a98
...
...
@@ -204,45 +204,48 @@
float viewReflectRayZ=viewPosition.z+s*(d1viewPosition.z-viewPosition.z);
#endif
if(viewReflectRayZ>vZ) continue;
bool hit;
#ifdef INFINITE_THICK
hit=true;
#else
float away=pointToLineDistance(vP,viewPosition,d1viewPosition);
float minThickness;
vec2 xyNeighbor=xy;
xyNeighbor.x+=1.;
vec2 uvNeighbor=xyNeighbor/resolution;
vec3 vPNeighbor=getViewPosition(uvNeighbor,d,cW);
minThickness=vPNeighbor.x-vP.x;
minThickness*=3.;
float tk=max(minThickness,thickness);
hit=away<=tk;
#endif
if(hit){
vec3 vN=getViewNormal( uv );
if(dot(viewReflectDir,vN)>=0.) continue;
float distance=pointPlaneDistance(vP,viewPosition,viewNormal);
if(distance>maxDistance) break;
float op=opacity;
#ifdef DISTANCE_ATTENUATION
float ratio=1.-(distance/maxDistance);
float attenuation=ratio*ratio;
op=opacity*attenuation;
#endif
#ifdef FRESNEL
float fresnelCoe=(dot(viewIncidentDir,viewReflectDir)+1.)/2.;
op*=fresnelCoe;
// if(viewReflectRayZ>vZ) continue; // will cause "npm run make-screenshot webgl_postprocessing_ssr" high probability hang.
// https://github.com/mrdoob/three.js/pull/21539#issuecomment-821061164
if(viewReflectRayZ<=vZ){
bool hit;
#ifdef INFINITE_THICK
hit=true;
#else
float away=pointToLineDistance(vP,viewPosition,d1viewPosition);
float minThickness;
vec2 xyNeighbor=xy;
xyNeighbor.x+=1.;
vec2 uvNeighbor=xyNeighbor/resolution;
vec3 vPNeighbor=getViewPosition(uvNeighbor,d,cW);
minThickness=vPNeighbor.x-vP.x;
minThickness*=3.;
float tk=max(minThickness,thickness);
hit=away<=tk;
#endif
vec4 reflectColor=texture2D(tDiffuse,uv);
gl_FragColor.xyz=reflectColor.xyz;
gl_FragColor.a=op;
break;
if(hit){
vec3 vN=getViewNormal( uv );
if(dot(viewReflectDir,vN)>=0.) continue;
float distance=pointPlaneDistance(vP,viewPosition,viewNormal);
if(distance>maxDistance) break;
float op=opacity;
#ifdef DISTANCE_ATTENUATION
float ratio=1.-(distance/maxDistance);
float attenuation=ratio*ratio;
op=opacity*attenuation;
#endif
#ifdef FRESNEL
float fresnelCoe=(dot(viewIncidentDir,viewReflectDir)+1.)/2.;
op*=fresnelCoe;
#endif
vec4 reflectColor=texture2D(tDiffuse,uv);
gl_FragColor.xyz=reflectColor.xyz;
gl_FragColor.a=op;
break;
}
}
}
}
...
...
examples/jsm/loaders/FBXLoader.js
浏览文件 @
a3b72a98
...
...
@@ -3892,7 +3892,7 @@ class FBXTree {
function
isFbxFormatBinary
(
buffer
)
{
const
CORRECT
=
'
Kaydara
FBX Binary
\
0
'
;
const
CORRECT
=
'
Kaydara
\
u0020FBX
\
u0020Binary
\
u0020
\
u0020
\
0
'
;
return
buffer
.
byteLength
>=
CORRECT
.
length
&&
CORRECT
===
convertArrayBufferToString
(
buffer
,
0
,
CORRECT
.
length
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录