Sign in to follow this  
Waterlimon

Any reading on renderer design (or just on how to design systems)?

Recommended Posts

Waterlimon    4398
Hey, im soon going to need to write a renderer class for my really slowly advancing skill enhancing project (openGL), do you have any online tutorials or threads that talk about renderer design/architecture, or just overall how to design good classes and systems (i can convert knowledge from either to the other one so it doesnt really matter)?

This is what i would currently do:

1.Have openGL resources that the renderer creates and gives a id/pointer to (that is, buffer, texture, shader and any metadata about them)

2.You put the data to a mesh/material and register that and you get a pointer to that too

3.You mark it to be rendered each frame

4.You tell the renderer to render everything

That would allow a scene manager or something to upload the data of stuff, mark them to be rendered or not based on visibility, and then tell the renderer to draw everything. Or in other words, first you call SceneManager.DetermineVisibleObjects() and then Renderer.DrawFrame() to draw the scene (or something similiar)


What i dont like in that is the id's/pointers being passed around. It would be nice if they were objects of some sort. Also im unsure about the renderer and scenemanager being kind of tied together, i might want something inbetween to ask scenemanager for visible objects and then figure out their corresponding renderable objects.


So instead it would be:

DrawVisibleObjects()
{
for each currently visible renderable
{
ask if the corresponding thing in scenemanager is visible and if not mark as not visible
}
for each scene manager object that became visible this frame
{
mark corresponging renderer object as visible
}
}


So now the scenemanager doesnt need to care if its objects are rendered or not, and the renderer doesnt need to know about scenemanager.

So, post related threads, tutorials or articles or just comment these systems i considered and tell me how to improve them :3

Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this