Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
4edc1a05
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 搜索 >>
未验证
提交
4edc1a05
编写于
4月 23, 2021
作者:
M
Michael Herzog
提交者:
GitHub
4月 23, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Examples: Clean up. (#21704)
上级
e9f910c8
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
14 deletion
+15
-14
examples/jsm/renderers/nodes/functions/MathFunctions.js
examples/jsm/renderers/nodes/functions/MathFunctions.js
+6
-6
examples/jsm/renderers/nodes/lights/LightContextNode.js
examples/jsm/renderers/nodes/lights/LightContextNode.js
+2
-2
examples/jsm/renderers/nodes/lights/LightNode.js
examples/jsm/renderers/nodes/lights/LightNode.js
+1
-1
examples/jsm/renderers/nodes/lights/LightsNode.js
examples/jsm/renderers/nodes/lights/LightsNode.js
+1
-1
examples/webgpu_instance_uniform.html
examples/webgpu_instance_uniform.html
+1
-1
examples/webgpu_lights_selective.html
examples/webgpu_lights_selective.html
+4
-3
未找到文件。
examples/jsm/renderers/nodes/functions/MathFunctions.js
浏览文件 @
4edc1a05
...
...
@@ -23,13 +23,13 @@ vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
}`
);
export
const
pow2
=
new
FunctionNode
(
`float pow2( const in float x ) { return x*x; }`
);
export
const
pow3
=
new
FunctionNode
(
`float pow3( const in float x ) { return x*x*x; }`
);
export
const
pow4
=
new
FunctionNode
(
`float pow4( const in float x ) { float x2 = x*x; return x2*x2; }`
);
export
const
pow2
=
new
FunctionNode
(
'
float pow2( const in float x ) { return x*x; }
'
);
export
const
pow3
=
new
FunctionNode
(
'
float pow3( const in float x ) { return x*x*x; }
'
);
export
const
pow4
=
new
FunctionNode
(
'
float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
'
);
export
const
average
=
new
FunctionNode
(
`float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }`
);
export
const
average
=
new
FunctionNode
(
'
float average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }
'
);
export
const
max3
=
new
FunctionNode
(
`float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }`
);
export
const
max3
=
new
FunctionNode
(
'
float max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }
'
);
// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.
// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/
...
...
@@ -44,4 +44,4 @@ highp float rand( const in vec2 uv ) {
}`
).
setIncludes
(
[
PI
]
);
export
const
precisionSafeLength
=
new
FunctionNode
(
`float precisionSafeLength( vec3 v ) { return length( v ); }`
);
export
const
precisionSafeLength
=
new
FunctionNode
(
'
float precisionSafeLength( vec3 v ) { return length( v ); }
'
);
examples/jsm/renderers/nodes/lights/LightContextNode.js
浏览文件 @
4edc1a05
...
...
@@ -38,8 +38,8 @@ class LightContextNode extends ContextNode {
}
const
resetTotalLight
=
`Irradiance = vec3( 0.0 ); ReflectedLightDirectDiffuse = vec3( 0.0 ); ReflectedLightDirectSpecular = vec3( 0.0 );`
;
const
resultTotalLight
=
`ReflectedLightDirectDiffuse + ReflectedLightDirectSpecular`
;
const
resetTotalLight
=
'
Irradiance = vec3( 0.0 ); ReflectedLightDirectDiffuse = vec3( 0.0 ); ReflectedLightDirectSpecular = vec3( 0.0 );
'
;
const
resultTotalLight
=
'
ReflectedLightDirectDiffuse + ReflectedLightDirectSpecular
'
;
// include keywords
...
...
examples/jsm/renderers/nodes/lights/LightNode.js
浏览文件 @
4edc1a05
...
...
@@ -44,7 +44,7 @@ class LightNode extends Node {
}
update
(
frame
)
{
update
(
/* frame */
)
{
this
.
color
.
value
.
copy
(
this
.
light
.
color
).
multiplyScalar
(
this
.
light
.
intensity
);
this
.
lightCutoffDistance
.
value
=
this
.
light
.
distance
;
...
...
examples/jsm/renderers/nodes/lights/LightsNode.js
浏览文件 @
4edc1a05
...
...
@@ -21,7 +21,7 @@ class LightsNode extends Node {
}
return
builder
.
format
(
'
vec3( 0.0 )
'
,
this
.
getType
(
builder
),
output
);
return
builder
.
format
(
'
vec3( 0.0 )
'
,
this
.
getType
(
builder
),
output
);
}
...
...
examples/webgpu_instance_uniform.html
浏览文件 @
4edc1a05
...
...
@@ -8,7 +8,7 @@
</head>
<body>
<div
id=
"info"
>
<a
href=
"https://threejs.org"
target=
"_blank"
rel=
"noopener"
>
three.js
</a>
- WebGPU Instance Uniform
<br/>
(Chrome Canary with flag: --enable-unsafe-webgpu)
<a
href=
"https://threejs.org"
target=
"_blank"
rel=
"noopener"
>
three.js
</a>
- WebGPU
-
Instance Uniform
<br/>
(Chrome Canary with flag: --enable-unsafe-webgpu)
</div>
<script
type=
"importmap"
>
...
...
examples/webgpu_lights_selective.html
浏览文件 @
4edc1a05
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
three.js
webgpu - selective l
ights
</title>
<title>
three.js
- WebGPU - Selective L
ights
</title>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
>
<link
type=
"text/css"
rel=
"stylesheet"
href=
"main.css"
>
...
...
@@ -9,7 +9,8 @@
<body>
<div
id=
"info"
>
<a
href=
"https://threejs.org"
target=
"_blank"
rel=
"noopener"
>
three.js
</a>
- selective lights WebGPU demo.
<br
/>
<a
href=
"https://threejs.org"
target=
"_blank"
rel=
"noopener"
>
three.js
</a>
- WebGPU - Selective Lights
<br
/>
(Chrome Canary with flag: --enable-unsafe-webgpu)
<br
/>
<b
style=
"color:red"
>
Left: Red lights
</b>
-
<b>
Center: All lights
</b>
-
<b
style=
"color:blue"
>
Right: blue light
</b>
</div>
...
...
@@ -102,7 +103,7 @@
leftObject
.
material
.
shininess
=
centerObject
.
material
.
shininess
=
rightObject
.
material
.
shininess
=
70
;
leftObject
.
rotation
.
y
=
centerObject
.
rotation
.
y
=
rightObject
.
rotation
.
y
=
Math
.
PI
*
-
0.5
;
leftObject
.
position
.
y
=
centerObject
.
position
.
y
=
rightObject
.
position
.
y
=
-
10
;
leftObject
.
position
.
y
=
centerObject
.
position
.
y
=
rightObject
.
position
.
y
=
-
10
;
//renderer
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录