Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualKaiserJohan

Posted 26 December 2012 - 06:34 PM

I am unsure how to structure my meshes without getting them tightly coupled with the underlying rendering API.
Say I have a class Mesh I intend to add to my scene object. My first instinct is to immediately buffer the mesh vertex data in its constructor using for example glBuffer objects in OpenGL, so I dont have to keep it all in my applications memory.

I am also puzzled what to expose to the renderer when I send a batch of meshes to be rendered. The way I imagine it is to simply expose a Render() method from the mesh which internally binds the VAO and draws the primitives... but then again it couples it with the graphics api.

From what I've read a good solution is to send it all in batch jobs to a dedicated rendering class that encapsulates the graphics api, which sounds good but how to structure the vertex data without touching the graphics api is abit unclear to me.

#2KaiserJohan

Posted 26 December 2012 - 06:33 PM

I am unsure how to structure my meshes without getting them tightly coupled with the underlying rendering API.
Say I have a class Mesh I intend to add to my scene object. My first instinct is to immediately buffer the mesh vertex data in its constructor using for example glBuffer objects in OpenGL, so I dont have to keep it all in my applications memory.

I am also puzzled what to expose to the renderer when I send a batch of meshes to be rendered. The way I imagine it is to simply expose a Render() method from the mesh which internally binds the VAO and draws the primitives... but then again it couples it with the graphics api.

From what I've read a good solution is to send it all in batch jobs to a dedicated rendering class that encapsulates the graphics api, which sounds good but how to structure it is abit unclear to me.

#1KaiserJohan

Posted 26 December 2012 - 06:31 PM

I am unsure how to structure my meshes without getting them tightly coupled with the underlying rendering API.

Say I have a class Mesh I intend to add to my scene object. My first instinct is to immediately buffer the mesh vertex data in its constructor using for example glBuffer objects in OpenGL, so I dont have to keep it all in my applications memory. 

 

I am also puzzled what to expose to the renderer when I send a batch of meshes to be rendered. The way I imagine it is to simply expose a Render() method from the mesh which ïnternally binds the VAO and draws the primitives. 

 

 


PARTNERS