Advertisement Jump to content
Sign in to follow this  

[DX11] Managing shaders/effects?

This topic is 2632 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

I wrote my own effect framework for DX11 but now i'm not sure how to handle the increasing number of effects my application needs.

Just now i have:

Models that are textured/untextured
Models that are static/skinned
No lighting, directional lighting and point lighting
Shadow mapping

That's like a gazillion combination and i have no idea how to manage them?

On the shader side:
1) Should i use uber-shaders? If so, what's the difference between dynamic/static branching?
2) If i go with the uber-shader, how do i handle lighting? If i define a maximum of 3 lights per model, do i pass the light type to the shader and apply it using an if-statement?

for example:
for (int i = 0; i < MAX_LIGHTS; i++)
if (LightType == DIRECTIONAL)
else if (LightType == POINT)

On the application side:
1) Assuming i'm using an uber-shader, i'm guessing i have to build a set of flags required by every model and compile the shaders accordingly?
2) How do i precompile shaders?
3) What about effects that require more than one pass, for example a first pass to build a shadow map and a second one to apply it? (That is what a pass means right?)

Lots of questions... :(

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!