www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: MichaelJPCT on June 29, 2017, 09:43:30 am

Title: shared VBO ?
Post by: MichaelJPCT on June 29, 2017, 09:43:30 am
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?
Title: Re: shared VBO ?
Post by: EgonOlsen on June 29, 2017, 01:01:43 pm
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) (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.
Title: Re: shared VBO ?
Post by: MichaelJPCT on June 30, 2017, 02:39:00 am
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?
Title: Re: shared VBO ?
Post by: EgonOlsen on June 30, 2017, 10:02:22 am
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... ???
Title: Re: shared VBO ?
Post by: MichaelJPCT on June 30, 2017, 02:28:38 pm
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.