Hi,
I try to make particle system manager which holds particle pool and handles multiple emitter instances and particle system types. Hovewer, right now they are still bound to one datablock. I may make texture atlas, but different particle systems requires different blendblocks.
I can make multiple renderables, each associated with different datablock. I can't use the same vao, as primitive range can be different. Can I make one big enough immutable IndexBuffer (for quads) and share it among those renderable's Vao's? Will this be just one buffer on GPU side? I already get rid of VertexBuffer so it is IndexBuffer only.
Or maybe there is some alternative solution like sending multiple datablocks with one renderable?
[2.3] Sharing immutable index buffer. Topic is solved
-
- Halfling
- Posts: 68
- Joined: Sun May 11, 2014 7:55 pm
- Location: Poland
- x 21
-
- OGRE Team Member
- Posts: 5446
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1348
Re: [2.3] Sharing immutable index buffer.
You can create two VertexArrayObjects that point to the same vertex and/or index buffers without problem. This is allowed and it is how we handle LODs.
Just be careful when you destroy your vertex/index buffers that all VAOs using them have been destroyed first; and that you don't leak these vertex/index buffers once all your VAOs are destroyed.
Just be careful when you destroy your vertex/index buffers that all VAOs using them have been destroyed first; and that you don't leak these vertex/index buffers once all your VAOs are destroyed.
-
- Halfling
- Posts: 68
- Joined: Sun May 11, 2014 7:55 pm
- Location: Poland
- x 21
Re: [2.3] Sharing immutable index buffer.
Thanks for clearing this up.