Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
f2086ff6
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,发现更多精彩内容 >>
提交
f2086ff6
编写于
4月 04, 2021
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Examples: Fixed eslint warnings.
上级
8e605ab3
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
110 addition
and
110 deletion
+110
-110
examples/js/controls/DragControls.js
examples/js/controls/DragControls.js
+2
-2
examples/jsm/controls/DragControls.js
examples/jsm/controls/DragControls.js
+2
-2
examples/jsm/shaders/SSRShader.js
examples/jsm/shaders/SSRShader.js
+81
-81
examples/jsm/shaders/SSRrShader.js
examples/jsm/shaders/SSRrShader.js
+20
-20
examples/jsm/webxr/XREstimatedLight.js
examples/jsm/webxr/XREstimatedLight.js
+3
-3
examples/jsm/webxr/XRHandOculusMeshModel.js
examples/jsm/webxr/XRHandOculusMeshModel.js
+2
-2
未找到文件。
examples/js/controls/DragControls.js
浏览文件 @
f2086ff6
...
...
@@ -105,7 +105,7 @@ THREE.DragControls = function ( _objects, _camera, _domElement ) {
_plane
.
setFromNormalAndCoplanarPoint
(
_camera
.
getWorldDirection
(
_plane
.
normal
),
_worldPosition
.
setFromMatrixPosition
(
object
.
matrixWorld
)
);
if
(
_hovered
!==
object
&&
_hovered
!==
null
)
{
if
(
_hovered
!==
object
&&
_hovered
!==
null
)
{
scope
.
dispatchEvent
(
{
type
:
'
hoveroff
'
,
object
:
_hovered
}
);
...
...
@@ -113,7 +113,7 @@ THREE.DragControls = function ( _objects, _camera, _domElement ) {
_hovered
=
null
;
}
if
(
_hovered
!==
object
)
{
scope
.
dispatchEvent
(
{
type
:
'
hoveron
'
,
object
:
object
}
);
...
...
examples/jsm/controls/DragControls.js
浏览文件 @
f2086ff6
...
...
@@ -114,7 +114,7 @@ var DragControls = function ( _objects, _camera, _domElement ) {
_plane
.
setFromNormalAndCoplanarPoint
(
_camera
.
getWorldDirection
(
_plane
.
normal
),
_worldPosition
.
setFromMatrixPosition
(
object
.
matrixWorld
)
);
if
(
_hovered
!==
object
&&
_hovered
!==
null
)
{
if
(
_hovered
!==
object
&&
_hovered
!==
null
)
{
scope
.
dispatchEvent
(
{
type
:
'
hoveroff
'
,
object
:
_hovered
}
);
...
...
@@ -122,7 +122,7 @@ var DragControls = function ( _objects, _camera, _domElement ) {
_hovered
=
null
;
}
if
(
_hovered
!==
object
)
{
scope
.
dispatchEvent
(
{
type
:
'
hoveron
'
,
object
:
object
}
);
...
...
examples/jsm/shaders/SSRShader.js
浏览文件 @
f2086ff6
import
{
Matrix4
,
Vector2
}
from
"
../../../build/three.module.js
"
;
Matrix4
,
Vector2
}
from
'
../../../build/three.module.js
'
;
/**
* References:
* https://lettier.github.io/3d-game-shaders-for-beginners/screen-space-reflection.html
...
...
@@ -9,49 +9,49 @@ import {
var
SSRShader
=
{
defines
:
{
MAX_STEP
:
0
,
PERSPECTIVE_CAMERA
:
true
,
DISTANCE_ATTENUATION
:
true
,
FRESNEL
:
true
,
INFINITE_THICK
:
false
,
SELECTIVE
:
false
,
},
defines
:
{
MAX_STEP
:
0
,
PERSPECTIVE_CAMERA
:
true
,
DISTANCE_ATTENUATION
:
true
,
FRESNEL
:
true
,
INFINITE_THICK
:
false
,
SELECTIVE
:
false
,
},
uniforms
:
{
'
tDiffuse
'
:
{
value
:
null
},
'
tNormal
'
:
{
value
:
null
},
'
tMetalness
'
:
{
value
:
null
},
'
tDepth
'
:
{
value
:
null
},
'
cameraNear
'
:
{
value
:
null
},
'
cameraFar
'
:
{
value
:
null
},
'
resolution
'
:
{
value
:
new
Vector2
()
},
'
cameraProjectionMatrix
'
:
{
value
:
new
Matrix4
()
},
'
cameraInverseProjectionMatrix
'
:
{
value
:
new
Matrix4
()
},
'
opacity
'
:
{
value
:
.
5
},
'
maxDistance
'
:
{
value
:
180
},
'
cameraRange
'
:
{
value
:
0
},
'
surfDist
'
:
{
value
:
.
007
},
'
thickTolerance
'
:
{
value
:
.
03
},
},
vertexShader
:
/* glsl */
`
uniforms
:
{
"
tDiffuse
"
:
{
value
:
null
},
"
tNormal
"
:
{
value
:
null
},
"
tMetalness
"
:
{
value
:
null
},
"
tDepth
"
:
{
value
:
null
},
"
cameraNear
"
:
{
value
:
null
},
"
cameraFar
"
:
{
value
:
null
},
"
resolution
"
:
{
value
:
new
Vector2
()
},
"
cameraProjectionMatrix
"
:
{
value
:
new
Matrix4
()
},
"
cameraInverseProjectionMatrix
"
:
{
value
:
new
Matrix4
()
},
"
opacity
"
:
{
value
:
.
5
},
"
maxDistance
"
:
{
value
:
180
},
"
cameraRange
"
:
{
value
:
0
},
"
surfDist
"
:
{
value
:
.
007
},
"
thickTolerance
"
:
{
value
:
.
03
},
},
vertexShader
:
/* glsl */
`
varying vec2 vUv;
varying vec2 vUv;
void main() {
void main() {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}
}
`
,
`
,
fragmentShader
:
/* glsl */
`
fragmentShader
:
/* glsl */
`
// precision highp float;
precision highp sampler2D;
varying vec2 vUv;
...
...
@@ -221,41 +221,41 @@ var SSRShader = {
var
SSRDepthShader
=
{
defines
:
{
"
PERSPECTIVE_CAMERA
"
:
1
},
defines
:
{
'
PERSPECTIVE_CAMERA
'
:
1
},
uniforms
:
{
uniforms
:
{
"
tDepth
"
:
{
value
:
null
},
"
cameraNear
"
:
{
value
:
null
},
"
cameraFar
"
:
{
value
:
null
},
'
tDepth
'
:
{
value
:
null
},
'
cameraNear
'
:
{
value
:
null
},
'
cameraFar
'
:
{
value
:
null
},
},
},
vertexShader
:
/* glsl */
`
vertexShader
:
/* glsl */
`
varying vec2 vUv;
varying vec2 vUv;
void main() {
void main() {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}
}
`
,
`
,
fragmentShader
:
/* glsl */
`
fragmentShader
:
/* glsl */
`
uniform sampler2D tDepth;
uniform sampler2D tDepth;
uniform float cameraNear;
uniform float cameraFar;
uniform float cameraNear;
uniform float cameraFar;
varying vec2 vUv;
varying vec2 vUv;
#include <packing>
#include <packing>
float getLinearDepth( const in vec2 uv ) {
...
...
@@ -273,51 +273,51 @@ var SSRDepthShader = {
}
void main() {
void main() {
float depth = getLinearDepth( vUv );
float depth = getLinearDepth( vUv );
float d = 1.0 - depth;
// d=(d-.999)*1000.;
gl_FragColor = vec4( vec3( d ), 1.0 );
gl_FragColor = vec4( vec3( d ), 1.0 );
}
}
`
`
};
var
SSRBlurShader
=
{
uniforms
:
{
uniforms
:
{
"
tDiffuse
"
:
{
value
:
null
},
"
resolution
"
:
{
value
:
new
Vector2
()
},
"
opacity
"
:
{
value
:
.
5
},
'
tDiffuse
'
:
{
value
:
null
},
'
resolution
'
:
{
value
:
new
Vector2
()
},
'
opacity
'
:
{
value
:
.
5
},
},
},
vertexShader
:
/* glsl */
`
vertexShader
:
/* glsl */
`
varying vec2 vUv;
varying vec2 vUv;
void main() {
void main() {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}
}
`
,
`
,
fragmentShader
:
/* glsl */
`
fragmentShader
:
/* glsl */
`
uniform sampler2D tDiffuse;
uniform vec2 resolution;
varying vec2 vUv;
void main() {
uniform sampler2D tDiffuse;
uniform vec2 resolution;
varying vec2 vUv;
void main() {
//reverse engineering from PhotoShop blur filter, then change coefficient
vec2 texelSize = ( 1.0 / resolution );
vec2 texelSize = ( 1.0 / resolution );
vec4 c=texture2D(tDiffuse,vUv);
...
...
examples/jsm/shaders/SSRrShader.js
浏览文件 @
f2086ff6
import
{
Matrix4
,
Vector2
}
from
"
../../../build/three.module.js
"
;
}
from
'
../../../build/three.module.js
'
;
var
SSRrShader
=
{
...
...
@@ -15,21 +15,21 @@ var SSRrShader = {
uniforms
:
{
"
tDiffuse
"
:
{
value
:
null
},
"
tSpecular
"
:
{
value
:
null
},
"
tNormalSelects
"
:
{
value
:
null
},
"
tRefractive
"
:
{
value
:
null
},
"
tDepth
"
:
{
value
:
null
},
"
tDepthSelects
"
:
{
value
:
null
},
"
cameraNear
"
:
{
value
:
null
},
"
cameraFar
"
:
{
value
:
null
},
"
resolution
"
:
{
value
:
new
Vector2
()
},
"
cameraProjectionMatrix
"
:
{
value
:
new
Matrix4
()
},
"
cameraInverseProjectionMatrix
"
:
{
value
:
new
Matrix4
()
},
"
ior
"
:
{
value
:
1.03
},
"
cameraRange
"
:
{
value
:
0
},
"
maxDistance
"
:
{
value
:
180
},
"
surfDist
"
:
{
value
:
.
007
},
'
tDiffuse
'
:
{
value
:
null
},
'
tSpecular
'
:
{
value
:
null
},
'
tNormalSelects
'
:
{
value
:
null
},
'
tRefractive
'
:
{
value
:
null
},
'
tDepth
'
:
{
value
:
null
},
'
tDepthSelects
'
:
{
value
:
null
},
'
cameraNear
'
:
{
value
:
null
},
'
cameraFar
'
:
{
value
:
null
},
'
resolution
'
:
{
value
:
new
Vector2
()
},
'
cameraProjectionMatrix
'
:
{
value
:
new
Matrix4
()
},
'
cameraInverseProjectionMatrix
'
:
{
value
:
new
Matrix4
()
},
'
ior
'
:
{
value
:
1.03
},
'
cameraRange
'
:
{
value
:
0
},
'
maxDistance
'
:
{
value
:
180
},
'
surfDist
'
:
{
value
:
.
007
},
},
...
...
@@ -240,14 +240,14 @@ var SSRrShader = {
var
SSRrDepthShader
=
{
defines
:
{
"
PERSPECTIVE_CAMERA
"
:
1
'
PERSPECTIVE_CAMERA
'
:
1
},
uniforms
:
{
"
tDepth
"
:
{
value
:
null
},
"
cameraNear
"
:
{
value
:
null
},
"
cameraFar
"
:
{
value
:
null
},
'
tDepth
'
:
{
value
:
null
},
'
cameraNear
'
:
{
value
:
null
},
'
cameraFar
'
:
{
value
:
null
},
},
...
...
examples/jsm/webxr/XREstimatedLight.js
浏览文件 @
f2086ff6
...
...
@@ -3,7 +3,7 @@ import {
Group
,
LightProbe
,
WebGLCubeRenderTarget
}
from
"
../../../build/three.module.js
"
;
}
from
'
../../../build/three.module.js
'
;
class
SessionLightProbe
{
...
...
@@ -43,11 +43,11 @@ class SessionLightProbe {
this
.
xrWebGLBinding
=
new
XRWebGLBinding
(
session
,
gl
);
this
.
lightProbe
.
addEventListener
(
'
reflectionchange
'
,
()
=>
{
this
.
lightProbe
.
addEventListener
(
'
reflectionchange
'
,
()
=>
{
this
.
updateReflection
();
});
}
);
}
...
...
examples/jsm/webxr/XRHandOculusMeshModel.js
浏览文件 @
f2086ff6
...
...
@@ -92,9 +92,9 @@ class XRHandOculusMeshModel {
const
bone
=
object
.
getObjectByName
(
boneName
.
replace
(
/%/g
,
handedness
===
'
right
'
?
'
r
'
:
'
l
'
)
);
if
(
bone
!==
undefined
)
{
if
(
bone
!==
undefined
)
{
bone
.
jointName
=
joints
[
i
];
bone
.
jointName
=
joints
[
i
];
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录