Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
5365a11b
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,发现更多精彩内容 >>
提交
5365a11b
编写于
2月 03, 2011
作者:
A
alteredq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Small refactoring in handling of "dirty" buffers in WebGLRenderer.
上级
8227d9f1
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
430 addition
and
410 deletion
+430
-410
build/Three.js
build/Three.js
+125
-124
build/ThreeDebug.js
build/ThreeDebug.js
+126
-125
build/ThreeExtras.js
build/ThreeExtras.js
+151
-149
src/objects/ParticleSystem.js
src/objects/ParticleSystem.js
+1
-0
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+27
-12
未找到文件。
build/Three.js
浏览文件 @
5365a11b
此差异已折叠。
点击以展开。
build/ThreeDebug.js
浏览文件 @
5365a11b
此差异已折叠。
点击以展开。
build/ThreeExtras.js
浏览文件 @
5365a11b
此差异已折叠。
点击以展开。
src/objects/ParticleSystem.js
浏览文件 @
5365a11b
...
...
@@ -8,6 +8,7 @@ THREE.ParticleSystem = function ( geometry, materials ) {
this
.
geometry
=
geometry
;
this
.
materials
=
materials
instanceof
Array
?
materials
:
[
materials
];
this
.
colors
=
[];
this
.
sortParticles
=
false
;
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
5365a11b
...
...
@@ -158,6 +158,7 @@ THREE.WebGLRenderer = function ( parameters ) {
geometry
.
__webGLVertexBuffer
=
_gl
.
createBuffer
();
geometry
.
__webGLParticleBuffer
=
_gl
.
createBuffer
();
geometry
.
__webGLColorBuffer
=
_gl
.
createBuffer
();
};
...
...
@@ -249,7 +250,7 @@ THREE.WebGLRenderer = function ( parameters ) {
};
this
.
setMeshBuffers
=
function
(
geometryChunk
,
object
,
hint
,
dirtyVertices
,
dirtyElements
,
dirtyUvs
,
dirtyNormals
,
dirtyTangents
)
{
this
.
setMeshBuffers
=
function
(
geometryChunk
,
object
,
hint
)
{
var
f
,
fl
,
fi
,
face
,
vertexNormals
,
faceNormal
,
normal
,
uv
,
uv2
,
v1
,
v2
,
v3
,
v4
,
t1
,
t2
,
t3
,
t4
,
m
,
ml
,
i
,
vn
,
uvi
,
uv2i
,
...
...
@@ -274,8 +275,15 @@ THREE.WebGLRenderer = function ( parameters ) {
lineArray
=
geometryChunk
.
__lineArray
,
needsSmoothNormals
=
geometryChunk
.
__needsSmoothNormals
,
geometry
=
object
.
geometry
,
// this is shared for all chunks
dirtyVertices
=
geometry
.
__dirtyVertices
,
dirtyElements
=
geometry
.
__dirtyElements
,
dirtyUvs
=
geometry
.
__dirtyUvs
,
dirtyNormals
=
geometry
.
__dirtyNormals
,
dirtyTangents
=
geometry
.
__dirtyTangents
,
geometry
=
object
.
geometry
,
vertices
=
geometry
.
vertices
,
chunk_faces
=
geometryChunk
.
faces
,
obj_faces
=
geometry
.
faces
,
...
...
@@ -631,14 +639,17 @@ THREE.WebGLRenderer = function ( parameters ) {
};
this
.
setLineBuffers
=
function
(
geometry
,
hint
,
dirtyVertices
,
dirtyElements
)
{
this
.
setLineBuffers
=
function
(
geometry
,
hint
)
{
var
v
,
vertex
,
offset
,
vertices
=
geometry
.
vertices
,
vl
=
vertices
.
length
,
vertexArray
=
geometry
.
__vertexArray
,
lineArray
=
geometry
.
__lineArray
;
lineArray
=
geometry
.
__lineArray
,
dirtyVertices
=
geometry
.
__dirtyVertices
,
dirtyElements
=
geometry
.
__dirtyElements
;
if
(
dirtyVertices
)
{
...
...
@@ -677,7 +688,7 @@ THREE.WebGLRenderer = function ( parameters ) {
};
this
.
setParticleBuffers
=
function
(
geometry
,
hint
,
dirtyVertices
,
dirtyElements
,
object
,
camera
)
{
this
.
setParticleBuffers
=
function
(
geometry
,
hint
,
object
,
camera
)
{
var
v
,
vertex
,
offset
,
vertices
=
geometry
.
vertices
,
...
...
@@ -686,7 +697,11 @@ THREE.WebGLRenderer = function ( parameters ) {
vertexArray
=
geometry
.
__vertexArray
,
particleArray
=
geometry
.
__particleArray
,
sortArray
=
geometry
.
__sortArray
;
sortArray
=
geometry
.
__sortArray
,
dirtyVertices
=
geometry
.
__dirtyVertices
,
dirtyElements
=
geometry
.
__dirtyElements
,
dirtyColors
=
geometry
.
__dirtyColors
;
if
(
object
.
sortParticles
)
{
...
...
@@ -1317,9 +1332,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if
(
geometry
.
__dirtyVertices
||
geometry
.
__dirtyElements
||
geometry
.
__dirtyUvs
)
{
this
.
setMeshBuffers
(
geometryChunk
,
object
,
_gl
.
DYNAMIC_DRAW
,
geometry
.
__dirtyVertices
,
geometry
.
__dirtyElements
,
geometry
.
__dirtyUvs
,
geometry
.
__dirtyNormals
,
geometry
.
__dirtyTangents
);
this
.
setMeshBuffers
(
geometryChunk
,
object
,
_gl
.
DYNAMIC_DRAW
);
}
...
...
@@ -1351,7 +1364,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if
(
geometry
.
__dirtyVertices
)
{
this
.
setLineBuffers
(
geometry
,
_gl
.
DYNAMIC_DRAW
,
geometry
.
__dirtyVertices
,
geometry
.
__dirtyElements
);
this
.
setLineBuffers
(
geometry
,
_gl
.
DYNAMIC_DRAW
);
}
...
...
@@ -1368,19 +1381,21 @@ THREE.WebGLRenderer = function ( parameters ) {
this
.
initParticleBuffers
(
geometry
);
geometry
.
__dirtyVertices
=
true
;
geometry
.
__dirtyColors
=
true
;
geometry
.
__dirtyElements
=
true
;
}
if
(
geometry
.
__dirtyVertices
||
object
.
sortParticles
)
{
if
(
geometry
.
__dirtyVertices
||
geometry
.
__dirtyColors
||
object
.
sortParticles
)
{
this
.
setParticleBuffers
(
geometry
,
_gl
.
DYNAMIC_DRAW
,
geometry
.
__dirtyVertices
,
geometry
.
__dirtyElements
,
object
,
camera
);
this
.
setParticleBuffers
(
geometry
,
_gl
.
DYNAMIC_DRAW
,
object
,
camera
);
}
add_buffer
(
objmap
,
0
,
geometry
,
object
);
geometry
.
__dirtyVertices
=
false
;
geometry
.
__dirtyColors
=
false
;
geometry
.
__dirtyElements
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录