M3D / M3D / Render / GPUObjects
Class: GPUObjects
Memberof
M3D.Render
Description
Buffer管理类
Author
ss
Table of contents
Constructors
Methods
- addProtoInstanceVBO
- addVertexBuffer
- clear
- clearSectionLineVBOMap
- createOrUpdateGpuObject
- getBufferInfo
- getFBO
- getGridBufferInfo
- getIBOWithNode
- getIndexBuffer
- getProtoInstanceVBOS
- getProtoVBO
- getRenderContext
- getRenderContexts
- getScene
- getSectionLineVBO
- getSectionLineVBOMap
- getVBOWithNode
- getVertexBuffer
- getVertexSets
- processGPUObject
- removeGpuObject
- removeInstanceGpuObject
- setBufferInfo
- setGridBufferInfo
- setIndexBuffer
- setProtoVBO
- setRenderContext
- setVertexBuffer
- setVertexSets
- sortWithMaterial
Constructors
constructor
• new GPUObjects(scene?
): GPUObjects
Parameters
Name | Type |
---|---|
scene? | Scene |
Returns
Description
构造函数
Methods
addProtoInstanceVBO
▸ addProtoInstanceVBO(proto
, vertexBuffer
): void
Parameters
Name | Type |
---|---|
proto | any |
vertexBuffer | VertexBuffer |
Returns
void
Description
添加原型对应实例VBO
addVertexBuffer
▸ addVertexBuffer(node
, vertexBuffer
): void
Parameters
Name | Type |
---|---|
node | RenderTreeNode |
vertexBuffer | VertexBuffer |
Returns
void
Description
添加VBO
clear
▸ clear(): void
Returns
void
Description
数据清空
clearSectionLineVBOMap
▸ clearSectionLineVBOMap(plane
): void
Parameters
Name | Type |
---|---|
plane | SectionPlane |
Returns
void
Description
清空剖切面对应轮廓线VBO数据
createOrUpdateGpuObject
▸ createOrUpdateGpuObject(viewport
, renderTree
): any
Parameters
Name | Type |
---|---|
viewport | Viewport |
renderTree | RenderTree |
Returns
any
Description
生成或更新GPU数据
▸ createOrUpdateGpuObject(node
): any
Parameters
Name | Type |
---|---|
node | RenderTreeNode |
Returns
any
Description
生成或更新GPU数据
getBufferInfo
▸ getBufferInfo(shape
): number
[]
Parameters
Name | Type |
---|---|
shape | Shape |
Returns
number
[]
Description
获取buffer信息
▸ getBufferInfo(node
): number
[]
Parameters
Name | Type |
---|---|
node | RenderTreeNode |
Returns
number
[]
Description
获取buffer信息
getFBO
▸ getFBO(name
): GPUObject
Parameters
Name | Type |
---|---|
name | string | number |
Returns
Description
获取FBO
getGridBufferInfo
▸ getGridBufferInfo(shape
): number
[]
Parameters
Name | Type |
---|---|
shape | Shape |
Returns
number
[]
Description
获取三角网格Buffer信息
▸ getGridBufferInfo(node
): number
[]
Parameters
Name | Type |
---|---|
node | RenderTreeNode |
Returns
number
[]
Description
获取三角网格Buffer信息
getIBOWithNode
▸ getIBOWithNode(node
): GPUObject
Parameters
Name | Type |
---|---|
node | RenderTreeNode |
Returns
Description
通过节点获取IBO
▸ getIBOWithNode(face
): GPUObject
Parameters
Name | Type |
---|---|
face | Face |
Returns
Description
通过面对象获取IBO
▸ getIBOWithNode(face
): GPUObject
Parameters
Name | Type |
---|---|
face | Shape |
Returns
Description
通过shape对象获取IBO
getIndexBuffer
▸ getIndexBuffer(node
): any
Parameters
Name | Type |
---|---|
node | RenderTreeNode |
Returns
any
Description
获取IBO
▸ getIndexBuffer(node
, context
): any
Parameters
Name | Type |
---|---|
node | RenderTreeNode |
context | RenderContext |
Returns
any
Description
获取IBO
getProtoInstanceVBOS
▸ getProtoInstanceVBOS(proto
, renderContext
): VertexBuffer
[]
Parameters
Name | Type |
---|---|
proto | any |
renderContext | RenderContext |
Returns
Description
获取原型对应实例对象VBO
getProtoVBO
▸ getProtoVBO(proto
, renderContext
, lodLevel
): VertexBuffer
Parameters
Name | Type |
---|---|
proto | any |
renderContext | RenderContext |
lodLevel | number |
Returns
Description
获取VBO
getRenderContext
▸ getRenderContext(): RenderContext
Returns
Description
获取渲染上下文
getRenderContexts
▸ getRenderContexts(): RenderContext
[]
Returns
Description
获取渲染上下文列表
getScene
▸ getScene(): Scene
Returns
Description
获取场景
getSectionLineVBO
▸ getSectionLineVBO(line
, map
): VertexBuffer
Parameters
Name | Type |
---|---|
line | SectionLine |
map | Map <number , VertexBuffer > |
Returns
Description
获取轮廓线vbo
getSectionLineVBOMap
▸ getSectionLineVBOMap(plane
): Map
<number
, VertexBuffer
>
Parameters
Name | Type |
---|---|
plane | SectionPlane |
Returns
Map
<number
, VertexBuffer
>
Description
获取剖切面对应轮廓线vboMap
getVBOWithNode
▸ getVBOWithNode(node
): GPUObject
Parameters
Name | Type |
---|---|
node | RenderTreeNode |
Returns
Description
通过节点获取VBO
▸ getVBOWithNode(face
): GPUObject
Parameters
Name | Type |
---|---|
face | Face |
Returns
Description
通过面对象获取VBO
▸ getVBOWithNode(face
): GPUObject
Parameters
Name | Type |
---|---|
face | Shape |
Returns
Description
通过shape对象获取VBO
getVertexBuffer
▸ getVertexBuffer(node
): any
Parameters
Name | Type |
---|---|
node | RenderTreeNode |
Returns
any
Description
获取VBO
▸ getVertexBuffer(node
, context
): VertexBuffer
[]
Parameters
Name | Type |
---|---|
node | RenderTreeNode |
context | RenderContext |
Returns
Description
获取VBO
getVertexSets
▸ getVertexSets(): VertexSets
Returns
Description
获取顶点集管理类
processGPUObject
▸ processGPUObject(...paras
): void
Parameters
Name | Type |
---|---|
...paras | any [] |
Returns
void
Description
处理GPU数据
removeGpuObject
▸ removeGpuObject(id
): void
Parameters
Name | Type |
---|---|
id | number |
Returns
void
Description
vbo、ibo资源释放
removeInstanceGpuObject
▸ removeInstanceGpuObject(protoId
): void
Parameters
Name | Type |
---|---|
protoId | number |
Returns
void
Description
通过原型id进行多实例合批后的GPU资源的释放
setBufferInfo
▸ setBufferInfo(shape
, offset
, length
): boolean
Parameters
Name | Type |
---|---|
shape | Shape |
offset | any |
length | any |
Returns
boolean
Description
设置buffer信息
▸ setBufferInfo(node
, offset
, length
): boolean
Parameters
Name | Type |
---|---|
node | RenderTreeNode |
offset | any |
length | any |
Returns
boolean
Description
设置buffer信息
setGridBufferInfo
▸ setGridBufferInfo(shape
, offset
, length
): boolean
Parameters
Name | Type |
---|---|
shape | Shape |
offset | any |
length | any |
Returns
boolean
Description
设置三角网格Buffer信息
▸ setGridBufferInfo(node
, offset
, length
): boolean
Parameters
Name | Type |
---|---|
node | RenderTreeNode |
offset | any |
length | any |
Returns
boolean
Description
设置三角网格Buffer信息
setIndexBuffer
▸ setIndexBuffer(node
, indexBuffer
): void
Parameters
Name | Type |
---|---|
node | RenderTreeNode |
indexBuffer | IndexBuffer |
Returns
void
Description
设置IBO
setProtoVBO
▸ setProtoVBO(proto
, renderContext
, lodLevel
, vertexBuffer
): void
Parameters
Name | Type |
---|---|
proto | any |
renderContext | RenderContext |
lodLevel | number |
vertexBuffer | VertexBuffer |
Returns
void
Description
创建原型VBO
setRenderContext
▸ setRenderContext(context
): void
Parameters
Name | Type |
---|---|
context | RenderContext |
Returns
void
Description
设置渲染上下文
setVertexBuffer
▸ setVertexBuffer(node
, vertexMap
): void
Parameters
Name | Type |
---|---|
node | RenderTreeNode |
vertexMap | Map <RenderContext , VertexBuffer []> |
Returns
void
Description
设置VBO
setVertexSets
▸ setVertexSets(vertexSets
): void
Parameters
Name | Type |
---|---|
vertexSets | VertexSets |
Returns
void
Description
设置顶点集管理类
sortWithMaterial
▸ sortWithMaterial(face1
, face2
): number
Parameters
Name | Type |
---|---|
face1 | Face |
face2 | Face |
Returns
number
Description
根据材质排序