Sign in to follow this  
eDuDe

Switching Shaders: Expensive?

Recommended Posts

Been working on a graphics engine (Direct X) for a game project that I'll be working on sometime in the future, and just got everything up and running. Can do the basics. Working on a 3D Drawable component, and it was fairly basic, but it contained a pointer to the shader and had a "draw self" function. The problem is that by organizing it this way is that I'll be constantly switching shaders as I draw all my objects (so far they're not sorted by shader). I heard through the grape vine that switching shaders was pretty expensive, and it would be best to render everything that uses one shader, then switch to the next. Any truth to this? Is it worth keeping a draw list sorted by shader?

Share this post


Link to post
Share on other sites
I've heard the same thing, even with other objects like textures and vertex buffers. It's kind of an irritating phenomenon since most games used a lot of different materials and having to program certain aspects around slow 'switching' of objects must add a bit salt to the equation.

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