Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualAshaman73

Posted 18 April 2013 - 01:53 AM

There's no general rule. On one hand, a specialist shader is often faster than a more general uber-shader with a lot of branches. But if you need to subdivide a shader into mutliple passes, you could get in trouble with bandwidth or with state changes if you over-do the number of shaders (e.g. each object get its own shader, so that batching is impossible).

 

An other option is, to write an uber shader, but to use pre-processor statements instead of dynamic conditions to generate the shader you need on-the-fly.


#1Ashaman73

Posted 18 April 2013 - 01:53 AM

There's no general rule. On one hand, a specialist shader is often faster than a more general uber-shader which lot of branches. But if you need to subdivide a shader into mutliple passes, you could get in trouble with bandwidth or with state changes if you over-do the number of shaders (e.g. each object get its own shader, so that batching is impossible).

 

An other option is, to write an uber shader, but to use pre-processor statements instead of dynamic conditions to generate the shader you need on-the-fly.


PARTNERS