Sign in to follow this  
stringa

How to manage Lot's O'Shaders ... ?

Recommended Posts

Hello... I'm wondering about managing shaders. What If I wanna use upwards of 20 different shaders in a given game loop. I know that D3D gives you a D3DXCompile application so you can compile pre-game and then just load and delete shaders as needed. What can I do ? What are my options? thanks, stringa

Share this post


Link to post
Share on other sites
nvidia: use cgc.exe to compile to asm
ati: stick with glsl, that requires recompilation of shaders on each game-boot.

Share this post


Link to post
Share on other sites
The ARB was too retarded to include binary blobs in GL3 (ignoring the overwhelming demand from developers, as usual), so realistically, you'll have to live with compiling the shaders at startup.

Or switch to D3D.

Share this post


Link to post
Share on other sites
Quote:
Original post by stringa
I'm wondering about managing shaders. What If I wanna use upwards of 20 different shaders in a given game loop. I know that D3D gives you a D3DXCompile application so you can compile pre-game and then just load and delete shaders as needed.
Load all your shaders at load time (when the application starts, or right before a level), and just use them as necessary. OpenGL will take care of loading them in and out of the GPU when you call glUseProgram().

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