Skip to main content
GameDev.net gamedev.net
🔒 Locked

2 Rendering Pipelines!

Started by eSam Jan 14, 2007 at 11:16 PM 0 replies 900+ views
Original Post
eSam
eSam
I was wondering what the best strategy to implement 2 rendering pipelines as 2 separate modules, one for Direct3D and the other for OpenGL? I have come to 2 approaches. First, each module provides rendering fucntionality per entity/object. For example, DrawTextureBox, DrawStairs, DrawSkinnedMehs, EnablePerPixelBumpMapping, ...etc. Second, each module provides a set of basic functionality for drawing primitives, based on pushing or buffering vertices. Something like DrawTextutredTriangleStrip, DrawColoredQuadLists, CreateGeoemtryBuffer... EnableBlending, EnableDepthTest... What would be more appropriate?
Digitalfragment
Digitalfragment
Well, if you follow the route of
"DrawTextutredTriangleStrip, DrawColoredQuadLists, CreateGeoemtryBuffer...
EnableBlending, EnableDepthTest" generalize it out so you dont have so many functions.

Also, try to batch together enable states into structures etc. it helps simplify everything (and can typically be made faster through display lists and also resolve render-state headaches in large projects too) for example:

struct StateBatch
{
bool bDepthWrite;
unsigned char iDepthTestFunc;
bool bRedMask, bGreenMask, bBlueMask, bAlphaMask;
unsigned char iBlendFuncSrc, iBlendFuncDst;
};
void SetState ( const StateBatch &batch );

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.