Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
15db34ad
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,发现更多精彩内容 >>
提交
15db34ad
编写于
10月 26, 2011
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactored custom attributes for particles.
More moving ifs out of inner loops.
上级
363ce622
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
263 addition
and
203 deletion
+263
-203
build/Three.js
build/Three.js
+85
-84
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+66
-65
examples/webgl_custom_attributes_lines.html
examples/webgl_custom_attributes_lines.html
+11
-6
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+101
-48
未找到文件。
build/Three.js
浏览文件 @
15db34ad
此差异已折叠。
点击以展开。
build/custom/ThreeWebGL.js
浏览文件 @
15db34ad
此差异已折叠。
点击以展开。
examples/webgl_custom_attributes_lines.html
浏览文件 @
15db34ad
...
...
@@ -90,11 +90,11 @@
size
=
50
,
curveSegments
=
10
,
steps
=
2
0
,
steps
=
4
0
,
bevelThickness
=
5
,
bevelSize
=
1.5
,
bevelSegments
=
3
,
bevelSegments
=
10
,
bevelEnabled
=
true
,
bend
=
false
,
...
...
@@ -159,6 +159,7 @@
bevelThickness
:
bevelThickness
,
bevelSize
:
bevelSize
,
bevelEnabled
:
bevelEnabled
,
bevelSegments
:
bevelSegments
,
bend
:
bend
,
...
...
@@ -221,15 +222,19 @@
uniforms
.
amplitude
.
value
=
0.5
*
Math
.
sin
(
0.5
*
time
);
THREE
.
ColorUtils
.
adjustHSV
(
uniforms
.
color
.
value
,
0.0005
,
0
,
0
);
for
(
var
i
=
0
;
i
<
attributes
.
displacement
.
value
.
length
;
i
++
)
{
var
nx
,
ny
,
nz
,
value
;
for
(
var
i
=
0
,
il
=
attributes
.
displacement
.
value
.
length
;
i
<
il
;
i
++
)
{
nx
=
0.3
*
(
0.5
-
Math
.
random
()
);
ny
=
0.3
*
(
0.5
-
Math
.
random
()
);
nz
=
0.3
*
(
0.5
-
Math
.
random
()
);
attributes
.
displacement
.
value
[
i
].
x
+=
nx
;
attributes
.
displacement
.
value
[
i
].
y
+=
ny
;
attributes
.
displacement
.
value
[
i
].
z
+=
nz
;
value
=
attributes
.
displacement
.
value
[
i
];
value
.
x
+=
nx
;
value
.
y
+=
ny
;
value
.
z
+=
nz
;
}
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
15db34ad
...
...
@@ -2715,51 +2715,83 @@ THREE.WebGLRenderer = function ( parameters ) {
cal
=
customAttribute
.
value
.
length
;
for
(
ca
=
0
;
ca
<
cal
;
ca
++
)
{
if
(
customAttribute
.
size
===
1
)
{
index
=
sortArray
[
ca
][
1
];
for
(
ca
=
0
;
ca
<
cal
;
ca
++
)
{
if
(
customAttribute
.
size
===
1
)
{
index
=
sortArray
[
ca
][
1
];
customAttribute
.
array
[
offset
]
=
customAttribute
.
value
[
index
];
customAttribute
.
array
[
ca
]
=
customAttribute
.
value
[
index
];
}
else
{
}
}
else
if
(
customAttribute
.
size
===
2
)
{
for
(
ca
=
0
;
ca
<
cal
;
ca
++
)
{
index
=
sortArray
[
ca
][
1
];
value
=
customAttribute
.
value
[
index
];
if
(
customAttribute
.
size
===
2
)
{
customAttribute
.
array
[
offset
]
=
value
.
x
;
customAttribute
.
array
[
offset
+
1
]
=
value
.
y
;
customAttribute
.
array
[
offset
]
=
value
.
x
;
customAttribute
.
array
[
offset
+
1
]
=
value
.
y
;
offset
+=
2
;
}
else
if
(
customAttribute
.
size
===
3
)
{
}
if
(
customAttribute
.
type
===
"
c
"
)
{
}
else
if
(
customAttribute
.
size
===
3
)
{
customAttribute
.
array
[
offset
]
=
value
.
r
;
customAttribute
.
array
[
offset
+
1
]
=
value
.
g
;
customAttribute
.
array
[
offset
+
2
]
=
value
.
b
;
if
(
customAttribute
.
type
===
"
c
"
)
{
}
else
{
for
(
ca
=
0
;
ca
<
cal
;
ca
++
)
{
customAttribute
.
array
[
offset
]
=
value
.
x
;
customAttribute
.
array
[
offset
+
1
]
=
value
.
y
;
customAttribute
.
array
[
offset
+
2
]
=
value
.
z
;
index
=
sortArray
[
ca
][
1
];
}
value
=
customAttribute
.
value
[
index
];
}
else
{
customAttribute
.
array
[
offset
]
=
value
.
r
;
customAttribute
.
array
[
offset
+
1
]
=
value
.
g
;
customAttribute
.
array
[
offset
+
2
]
=
value
.
b
;
customAttribute
.
array
[
offset
]
=
value
.
x
;
customAttribute
.
array
[
offset
+
1
]
=
value
.
y
;
customAttribute
.
array
[
offset
+
2
]
=
value
.
z
;
customAttribute
.
array
[
offset
+
3
]
=
value
.
w
;
offset
+=
3
;
}
}
else
{
for
(
ca
=
0
;
ca
<
cal
;
ca
++
)
{
index
=
sortArray
[
ca
][
1
];
value
=
customAttribute
.
value
[
index
];
customAttribute
.
array
[
offset
]
=
value
.
x
;
customAttribute
.
array
[
offset
+
1
]
=
value
.
y
;
customAttribute
.
array
[
offset
+
2
]
=
value
.
z
;
offset
+=
3
;
}
}
offset
+=
customAttribute
.
size
;
}
else
if
(
customAttribute
.
size
===
4
)
{
for
(
ca
=
0
;
ca
<
cal
;
ca
++
)
{
index
=
sortArray
[
ca
][
1
];
value
=
customAttribute
.
value
[
index
];
customAttribute
.
array
[
offset
]
=
value
.
x
;
customAttribute
.
array
[
offset
+
1
]
=
value
.
y
;
customAttribute
.
array
[
offset
+
2
]
=
value
.
z
;
customAttribute
.
array
[
offset
+
3
]
=
value
.
w
;
offset
+=
4
;
}
}
...
...
@@ -2815,52 +2847,73 @@ THREE.WebGLRenderer = function ( parameters ) {
offset
=
0
;
for
(
ca
=
0
;
ca
<
cal
;
ca
++
)
{
if
(
customAttribute
.
size
===
1
)
{
offset_custom
=
customAttribute
.
offset
;
for
(
ca
=
0
;
ca
<
cal
;
ca
++
)
{
if
(
customAttribute
.
size
===
1
)
{
customAttribute
.
array
[
ca
]
=
customAttribute
.
value
[
ca
];
customAttribute
.
array
[
offset
]
=
customAttribute
.
value
[
ca
];
}
}
else
{
}
else
if
(
customAttribute
.
size
===
2
)
{
for
(
ca
=
0
;
ca
<
cal
;
ca
++
)
{
value
=
customAttribute
.
value
[
ca
];
if
(
customAttribute
.
size
===
2
)
{
customAttribute
.
array
[
offset
]
=
value
.
x
;
customAttribute
.
array
[
offset
+
1
]
=
value
.
y
;
customAttribute
.
array
[
offset
]
=
value
.
x
;
customAttribute
.
array
[
offset
+
1
]
=
value
.
y
;
offset
+=
2
;
}
else
if
(
customAttribute
.
size
===
3
)
{
}
}
else
if
(
customAttribute
.
size
===
3
)
{
if
(
customAttribute
.
type
===
"
c
"
)
{
if
(
customAttribute
.
type
===
"
c
"
)
{
for
(
ca
=
0
;
ca
<
cal
;
ca
++
)
{
value
=
customAttribute
.
value
[
ca
];
customAttribute
.
array
[
offset
]
=
value
.
r
;
customAttribute
.
array
[
offset
+
1
]
=
value
.
g
;
customAttribute
.
array
[
offset
+
2
]
=
value
.
b
;
customAttribute
.
array
[
offset
]
=
value
.
r
;
customAttribute
.
array
[
offset
+
1
]
=
value
.
g
;
customAttribute
.
array
[
offset
+
2
]
=
value
.
b
;
offset
+=
3
;
}
}
else
{
}
else
{
customAttribute
.
array
[
offset
]
=
value
.
x
;
customAttribute
.
array
[
offset
+
1
]
=
value
.
y
;
customAttribute
.
array
[
offset
+
2
]
=
value
.
z
;
for
(
ca
=
0
;
ca
<
cal
;
ca
++
)
{
}
value
=
customAttribute
.
value
[
ca
];
}
else
{
customAttribute
.
array
[
offset
]
=
value
.
x
;
customAttribute
.
array
[
offset
+
1
]
=
value
.
y
;
customAttribute
.
array
[
offset
+
2
]
=
value
.
z
;
customAttribute
.
array
[
offset
]
=
value
.
x
;
customAttribute
.
array
[
offset
+
1
]
=
value
.
y
;
customAttribute
.
array
[
offset
+
2
]
=
value
.
z
;
customAttribute
.
array
[
offset
+
3
]
=
value
.
w
;
offset
+=
3
;
}
}
offset
+=
customAttribute
.
size
;
}
else
if
(
customAttribute
.
size
===
4
)
{
for
(
ca
=
0
;
ca
<
cal
;
ca
++
)
{
value
=
customAttribute
.
value
[
ca
];
customAttribute
.
array
[
offset
]
=
value
.
x
;
customAttribute
.
array
[
offset
+
1
]
=
value
.
y
;
customAttribute
.
array
[
offset
+
2
]
=
value
.
z
;
customAttribute
.
array
[
offset
+
3
]
=
value
.
w
;
offset
+=
4
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录