I've been working on my component-entity engine for about 3 months now, and have managed to get nearly every constituent system working with little effort or compromise. My system has the following attributes:
- Components are mostly comprised of data.
- Services (physics, networking, rendering, etc) operate on these components' data in a type-agnostic manner.
- Components register themselves with their respective service provider on start-up.
One of the services I've been struggling to implement is rendering. I want a rendering service that keeps a list of my drawn components in an ordered list depending on what kind of drawing operations they require from the graphics device (i.e. different shaders, textures, draw order, etc) and then every frame iterates over the the list, grabs the indexed vertex arrays from the component and renders them using the settings specified in the "DrawContext."
In my research, I've stumbled upon the Nuclex.Graphics package which seems to solve a great deal of my concerns. It has an excellent implementation of vertex buffer object batching, queuing and such but it is not necessarily tailored towards a component-entity system. With Nuclex's design, all that is required is for my components to "queue" vertex buffer objects with the service which then batches them according to their "DrawContext."
My question is, how I can hide all of these vertex objects from the user? How can I enable my rendering service to draw both simple textured quads and complex stencil shadows while remaining type-agnostic? If you've worked on a component-entity system, how did you tackle complex rendering schemes?