17 hours ago, haegarr said:
There are many ways to write a graphic rendering engine. If we move away from "how to solve this particular problem" to "how to design a graphic engine" ... My personal solution currently supports two high level rendering APIs that are distinct in the way how graphic is described ... The sorting then happens on the jobs in the queue, considering the said tags as criteria. So scene description (i.e. how the game objects are organized w.r.t. the scene) and render related sorting are two totally separate things ... The both high level rendering APIs mentioned above are in so far separate as they work on different kinds of scenes, so to say
After reading this and then thinking about
On 11/1/2017 at 1:15 PM, Kylotan said:
If you need to render each of these objects in a different way, there's not much point having them all in the same container, which in turn brings into question whether it's worthwhile having them derive from Renderable at all
It really does make me question what I'm really trying to do
Originally I was looking to solve the problem of how a Renderable should call its renderer, but this really doesn't work with my overall problem which is to create a render system. Where this render system has the ability to render X types of Renderables and do it effectively. Which means sorting at some capacity to reduce state changes
And this is where things start to fall a part. Highlighting what @Kylotan says about Renderables. Because I'm looking to sort, which also ties into how they should be rendered, having everything derive from Renderable starts to make less and less sense. Let alone having them all in one container.
If I do have everything in one container, how can I possibly sort all these things properly? I simply can't. My container could have RendereableTypeA which has properties a,b,c and RendererableTypeB which has properties x,y,z. These two things can't be compared because they have totally different properties. But if I separate them into their own containers they can be compared. I can compare RenderableTypeA with another RenderableTypeA, just like I can compare RenderableTypeB with another RenderableTypeB. This in turn will allow me to sort correctly. Also since each Renderable has its own container, the renderer to use is explicitly known and can be used directly. Instead of having to pass a set of Renders to a Renderable and then picking the best option
This thread has a ton of great information and has been extremely helpful, but I think I might have to go back to the drawing board on this one