• entries
135
130
• views
52602

# Getting back on track...

78 views

Ok, so I mentioned that my 3D woes deserved a post of their own, so here it is. SGE uses a deferred rendering architecture. For those unfamiliar with the term, what this means is that I put everything that is to be rendered in a list, once the list is generated, I iterate through the list and render each element of said list. This works pretty good, and it's really fast and also very easy to program. Getting something to render is as easy as:

sgRenderUnit* pRenderUnit = sgRenderer::GetNewRenderUnit(sgRenderer::RU_DEFAULT);pRenderUnit->SetMesh(pMesh);pRenderUnit->SetMaterial(pMaterial);pRenderUnit->SetBaseTransform(sgMatrix4::IDENTITY);

pMesh is a simple class with a vertex and index buffer, material has the textures and shaders.

Anyway, this all worked great until I reached the point where I wanted to make my particle and font systems. The reason this became a problem comes from the use of dynamic buffers.

The problem is, if a dynamic buffer gets full, I need to create a render unit, this gets added into the list. But what happens if I have more geometry that needs to use that buffer? if this was not a deferred renderer, I would simple render whatever was in the buffer, flush the buffer and start using it again. Since this IS a deferred renderer, I need the buffer to be flushed on the next frame, AFTER the list has been rendered. This caused stuff to flicker...

I have tried quite a few more things than this, with pretty bad results... unfortunately, I have not found information on deferred renderers and how they handle dynamic rendering.

So, today I started looking into the possibility of switching to a non-deferred architecture. It seems that it will be a lot of work, but if it solves this problem it would be worth it.

There are no comments to display.

## Create an account

Register a new account