Author Topic: shared VBO ?  (Read 2189 times)

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
shared VBO ?
« 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: shared VBO ?
« Reply #1 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)

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

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
Re: shared VBO ?
« Reply #2 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: shared VBO ?
« Reply #3 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... ???

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
Re: shared VBO ?
« Reply #4 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.