0
\$\begingroup\$

I'm planning to use a component based architecture for a new 3D game engine I plan to work on, however I don't know how to approach the rendering side of things.

I can see two options here:

  • Every renderable game object has a RenderComponent, which stores a mesh and OpenGL-specific stuff like VBOs and VAOs. When the time comes to have update() called, it will use OpenGL to render itself.
  • Every renderable game object has a MeshComponent. When it's time to render, the Renderer would go through a list of all MeshComponents, extract vertex and material information, and render it.

Which option would be most flexible if I want to implement things like post-processing (bloom, motion blur), skyboxes, LOD, blending/transparency or implementing a deferred renderer?

\$\endgroup\$
3
  • \$\begingroup\$ Might interest you: gamedev.stackexchange.com/questions/47117/… \$\endgroup\$
    – Luke B.
    May 26, 2013 at 20:23
  • 1
    \$\begingroup\$ @LukeB. That's a fantastic post, and it solved my question. If you're allowed to post that link as an answer, I'll mark it as solved. :) \$\endgroup\$
    – toficofi
    May 26, 2013 at 23:13
  • 1
    \$\begingroup\$ Maybe you could explain your solution in an answer and accept that, I would love to see your interpretation of that answer :) \$\endgroup\$
    – Luke B.
    May 27, 2013 at 1:09

0

Browse other questions tagged .