Sign in to follow this  

Lot of shaders possibilities which ends to lot of shader compilation needed

Recommended Posts

Posted (edited)

Hi,
Using NormalMap, RoughnessMap, MetalnessMap, TwoSided, Self-IllumMap, OpacityMap ... and also IBL used or not.
And also if a map is not used but a value, you also end to a new shader compilation to not sample but use the value instead.
You end with lot of shader compilation to avoid to use one of them or them combined, at least I only see this solution actually.
Actually I simply send a 1x1 white or black texture but that means one sample for each type in case of used or not.
Actually I simply check for the normal map to avoid to compute the TBN.
Lot of shader mode using defines is the only way ?
Thanks

Edited by Alundra

Share this post


Link to post
Share on other sites

if it depends on a coherent flag (e.g. a constant for the whole draw call), you can use dynamic branching nowadays, there won't be a big performance impact, might be even faster as you don't need to switch shaders that many times.

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