shared VBO ?

Started by MichaelJPCT, June 29, 2017, 09:43:30 AM

Previous topic - Next topic

MichaelJPCT

say i have several objects which have the same vertex positions and normals and UVs, but the primitives are different. in GL or DX, these objects can use the same VBO.
in JPCT, is it possible?

another question, if in a vertex list, some vertices are not pointed by any primitive, does JPCT remove these vertices?

EgonOlsen

Quote from: MichaelJPCT on June 29, 2017, 09:43:30 AM
in JPCT, is it possible?
Yes, you can use: http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Object3D.html#shareCompiledData(com.threed.jpct.Object3D)

Quote
if in a vertex list, some vertices are not pointed by any primitive, does JPCT remove these vertices?
Yes, it should.

MichaelJPCT

i read the doc about shareCompiledData. it says the objects must have the same Mesh instance, then how can i define different primitives for the objects?

EgonOlsen

I'm confused now. The idea of reusing a VBO (or any other GL data structure for that matter) is that you render the same object multiple times based on the same definition. There's no point in reusing a VBO for different objects... ???

MichaelJPCT

it's not very necessary. i just wanted to know.
sometimes, it can be used to save memory, such as different LODs of an object use the same VBO.