Archived

This topic is now archived and is closed to further replies.

Render Lists, the way to go?

This topic is 5584 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello ppl, I have been rendering my scene using dx (objects only for now) this way: HRESULT CModel::Render() { Lot of code stripped out . . . . m_pMesh->DrawSubset(0); return S_OK; } As you can see, I´m rendering each model from its own vertex buffer, this was easy at first, but now that I´m redesigning things, it is a pain to mantain. Now I have some classes encapsulating Object properties, for example CRenderable. I´m building a CMD2Loader and a Font class, and both are be based on triangles, so, the D3DXMesh is not the best way to render this. At first, I thought about inheriting from CRenderable and create a CTriangleList, a CMesh, etc... this classes would render things using different primitives (Trialge List a list of triangles, CMesh indexed trinagles, etc...), but this will not be good because I will need to create an inherited class for each object using different primitives. So, I decided to base all my rendering on triangles. So I was thinking about changing the rendering methods (in the classes inheriting from CRenderable) to only add triangles to a render list (would be a good thing to place it in the renderer? or in the scene mgr?), and then build the scene from this list. This way I can sort by texture, etc... what I heard is important to get it fast. Do you think it is a good idea? do people do things this way?. In resume: OBJECTS.render -> send triangles to the rendering list-> Render scene using the rendering list. Sorry for the long story . Hope it was undertood. Thanks in advance. HexDump.

Share this post


Link to post
Share on other sites