Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
6b7dc5df
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,发现更多精彩内容 >>
提交
6b7dc5df
编写于
12月 23, 2015
作者:
S
SUNAG
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
renamed Shortcuts to addShortcuts and simplification
上级
0fe5f5e4
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
34 addition
and
30 deletion
+34
-30
examples/js/nodes/NodeMaterial.js
examples/js/nodes/NodeMaterial.js
+25
-21
examples/js/nodes/inputs/ColorNode.js
examples/js/nodes/inputs/ColorNode.js
+1
-1
examples/js/nodes/inputs/Vector2Node.js
examples/js/nodes/inputs/Vector2Node.js
+1
-1
examples/js/nodes/inputs/Vector3Node.js
examples/js/nodes/inputs/Vector3Node.js
+1
-1
examples/js/nodes/inputs/Vector4Node.js
examples/js/nodes/inputs/Vector4Node.js
+1
-1
examples/js/nodes/materials/PhongNodeMaterial.js
examples/js/nodes/materials/PhongNodeMaterial.js
+1
-1
examples/js/nodes/materials/StandardNodeMaterial.js
examples/js/nodes/materials/StandardNodeMaterial.js
+1
-1
examples/js/nodes/postprocessing/NodePass.js
examples/js/nodes/postprocessing/NodePass.js
+3
-3
未找到文件。
examples/js/nodes/NodeMaterial.js
浏览文件 @
6b7dc5df
...
...
@@ -11,10 +11,7 @@ THREE.NodeMaterial = function( vertex, fragment ) {
};
THREE
.
NodeMaterial
.
prototype
=
Object
.
create
(
THREE
.
ShaderMaterial
.
prototype
);
THREE
.
NodeMaterial
.
prototype
.
constructor
=
THREE
.
NodeMaterial
;
THREE
.
NodeMaterial
.
Type
=
{
THREE
.
NodeMaterial
.
types
=
{
t
:
'
sampler2D
'
,
tc
:
'
samplerCube
'
,
bv1
:
'
bool
'
,
...
...
@@ -26,39 +23,46 @@ THREE.NodeMaterial.Type = {
v4
:
'
vec4
'
};
THREE
.
NodeMaterial
.
GetShortcuts
=
function
(
prop
,
name
)
{
THREE
.
NodeMaterial
.
addShortcuts
=
function
(
proto
,
prop
,
list
)
{
return
{
get
:
function
()
{
function
applyShortcut
(
prop
,
name
)
{
return
this
[
prop
][
name
];
return
{
get
:
function
()
{
},
set
:
function
(
val
)
{
return
this
[
prop
][
name
];
this
[
prop
][
name
]
=
val
;
},
set
:
function
(
val
)
{
this
[
prop
][
name
]
=
val
;
}
};
}
};
};
return
(
function
()
{
THREE
.
NodeMaterial
.
Shortcuts
=
function
(
proto
,
prop
,
list
)
{
var
shortcuts
=
{};
var
shortcuts
=
{};
for
(
var
i
=
0
;
i
<
list
.
length
;
++
i
)
{
for
(
var
i
=
0
;
i
<
list
.
length
;
++
i
)
{
var
name
=
list
[
i
];
var
name
=
list
[
i
]
;
shortcuts
[
name
]
=
applyShortcut
(
prop
,
name
)
;
shortcuts
[
name
]
=
this
.
GetShortcuts
(
prop
,
name
);
}
}
Object
.
defineProperties
(
proto
,
shortcuts
);
Object
.
defineProperties
(
proto
,
shortcuts
);
})(
);
};
THREE
.
NodeMaterial
.
prototype
=
Object
.
create
(
THREE
.
ShaderMaterial
.
prototype
);
THREE
.
NodeMaterial
.
prototype
.
constructor
=
THREE
.
NodeMaterial
;
THREE
.
NodeMaterial
.
prototype
.
updateAnimation
=
function
(
delta
)
{
for
(
var
i
=
0
;
i
<
this
.
requestUpdate
.
length
;
++
i
)
{
...
...
@@ -388,7 +392,7 @@ THREE.NodeMaterial.prototype.getCodePars = function( pars, prefix ) {
if
(
parsType
==
'
t
'
&&
parsValue
instanceof
THREE
.
CubeTexture
)
parsType
=
'
tc
'
;
var
type
=
THREE
.
NodeMaterial
.
Type
[
parsType
];
var
type
=
THREE
.
NodeMaterial
.
types
[
parsType
];
if
(
type
==
undefined
)
throw
new
Error
(
"
Node pars
"
+
parsType
+
"
not found.
"
);
...
...
examples/js/nodes/inputs/ColorNode.js
浏览文件 @
6b7dc5df
...
...
@@ -13,4 +13,4 @@ THREE.ColorNode = function( color ) {
THREE
.
ColorNode
.
prototype
=
Object
.
create
(
THREE
.
InputNode
.
prototype
);
THREE
.
ColorNode
.
prototype
.
constructor
=
THREE
.
ColorNode
;
THREE
.
NodeMaterial
.
Shortcuts
(
THREE
.
ColorNode
.
prototype
,
'
value
'
,
[
'
r
'
,
'
g
'
,
'
b
'
]
);
THREE
.
NodeMaterial
.
add
Shortcuts
(
THREE
.
ColorNode
.
prototype
,
'
value
'
,
[
'
r
'
,
'
g
'
,
'
b
'
]
);
examples/js/nodes/inputs/Vector2Node.js
浏览文件 @
6b7dc5df
...
...
@@ -13,4 +13,4 @@ THREE.Vector2Node = function( x, y ) {
THREE
.
Vector2Node
.
prototype
=
Object
.
create
(
THREE
.
InputNode
.
prototype
);
THREE
.
Vector2Node
.
prototype
.
constructor
=
THREE
.
Vector2Node
;
THREE
.
NodeMaterial
.
Shortcuts
(
THREE
.
Vector2Node
.
prototype
,
'
value
'
,
[
'
x
'
,
'
y
'
]
);
THREE
.
NodeMaterial
.
add
Shortcuts
(
THREE
.
Vector2Node
.
prototype
,
'
value
'
,
[
'
x
'
,
'
y
'
]
);
examples/js/nodes/inputs/Vector3Node.js
浏览文件 @
6b7dc5df
...
...
@@ -14,4 +14,4 @@ THREE.Vector3Node = function( x, y, z ) {
THREE
.
Vector3Node
.
prototype
=
Object
.
create
(
THREE
.
InputNode
.
prototype
);
THREE
.
Vector3Node
.
prototype
.
constructor
=
THREE
.
Vector3Node
;
THREE
.
NodeMaterial
.
Shortcuts
(
THREE
.
Vector3Node
.
prototype
,
'
value
'
,
[
'
x
'
,
'
y
'
,
'
z
'
]
);
THREE
.
NodeMaterial
.
add
Shortcuts
(
THREE
.
Vector3Node
.
prototype
,
'
value
'
,
[
'
x
'
,
'
y
'
,
'
z
'
]
);
examples/js/nodes/inputs/Vector4Node.js
浏览文件 @
6b7dc5df
...
...
@@ -13,4 +13,4 @@ THREE.Vector4Node = function( x, y, z, w ) {
THREE
.
Vector4Node
.
prototype
=
Object
.
create
(
THREE
.
InputNode
.
prototype
);
THREE
.
Vector4Node
.
prototype
.
constructor
=
THREE
.
Vector4Node
;
THREE
.
NodeMaterial
.
Shortcuts
(
THREE
.
Vector4Node
.
prototype
,
'
value
'
,
[
'
x
'
,
'
y
'
,
'
z
'
,
'
w
'
]
);
THREE
.
NodeMaterial
.
add
Shortcuts
(
THREE
.
Vector4Node
.
prototype
,
'
value
'
,
[
'
x
'
,
'
y
'
,
'
z
'
,
'
w
'
]
);
examples/js/nodes/materials/PhongNodeMaterial.js
浏览文件 @
6b7dc5df
...
...
@@ -13,5 +13,5 @@ THREE.PhongNodeMaterial = function() {
THREE
.
PhongNodeMaterial
.
prototype
=
Object
.
create
(
THREE
.
NodeMaterial
.
prototype
);
THREE
.
PhongNodeMaterial
.
prototype
.
constructor
=
THREE
.
PhongNodeMaterial
;
THREE
.
NodeMaterial
.
Shortcuts
(
THREE
.
PhongNodeMaterial
.
prototype
,
'
node
'
,
THREE
.
NodeMaterial
.
add
Shortcuts
(
THREE
.
PhongNodeMaterial
.
prototype
,
'
node
'
,
[
'
color
'
,
'
alpha
'
,
'
specular
'
,
'
shininess
'
,
'
normal
'
,
'
normalScale
'
,
'
emissive
'
,
'
ambient
'
,
'
shadow
'
,
'
ao
'
,
'
environment
'
,
'
environmentIntensity
'
,
'
transform
'
]
);
examples/js/nodes/materials/StandardNodeMaterial.js
浏览文件 @
6b7dc5df
...
...
@@ -13,5 +13,5 @@ THREE.StandardNodeMaterial = function() {
THREE
.
StandardNodeMaterial
.
prototype
=
Object
.
create
(
THREE
.
NodeMaterial
.
prototype
);
THREE
.
StandardNodeMaterial
.
prototype
.
constructor
=
THREE
.
StandardNodeMaterial
;
THREE
.
NodeMaterial
.
Shortcuts
(
THREE
.
StandardNodeMaterial
.
prototype
,
'
node
'
,
THREE
.
NodeMaterial
.
add
Shortcuts
(
THREE
.
StandardNodeMaterial
.
prototype
,
'
node
'
,
[
'
color
'
,
'
alpha
'
,
'
roughness
'
,
'
metalness
'
,
'
normal
'
,
'
normalScale
'
,
'
emissive
'
,
'
ambient
'
,
'
shadow
'
,
'
ao
'
,
'
environment
'
,
'
environmentIntensity
'
,
'
transform
'
]
);
examples/js/nodes/postprocessing/NodePass.js
浏览文件 @
6b7dc5df
...
...
@@ -20,6 +20,9 @@ THREE.NodePass = function() {
THREE
.
NodePass
.
prototype
=
Object
.
create
(
THREE
.
ShaderPass
.
prototype
);
THREE
.
NodePass
.
prototype
.
constructor
=
THREE
.
NodePass
;
THREE
.
NodeMaterial
.
addShortcuts
(
THREE
.
NodePass
.
prototype
,
'
fragment
'
,
[
'
value
'
]
);
THREE
.
NodePass
.
prototype
.
build
=
function
()
{
this
.
node
.
build
();
...
...
@@ -28,6 +31,3 @@ THREE.NodePass.prototype.build = function() {
this
.
material
=
this
.
node
;
};
THREE
.
NodeMaterial
.
Shortcuts
(
THREE
.
NodePass
.
prototype
,
'
fragment
'
,
[
'
value
'
]
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录