Home Technical Talk

Are "Mega shaders" recommended?

polycounter lvl 7
Offline / Send Message
Ravenok polycounter lvl 7
Yo

I'm currently planning my usage of shaders in a game project.
I'm trying to map out what shaders I may need for various objects, I'm finding that there are lots of small "requirements" for many different shaders, and I'm thinking what the best way to approach the entire process of shader making would be.

I'm thinking of making a handful of "mega" shaders, each focuses on an object type (characters, environments, effects, etc), and each will contain the cast majority of what I'll need in order to render every object in the game. For specific cases I'll make small shaders, and that's about it.

Alternatively, I know there's the possibility of making a specific, small, compact shader for each use case, and use those. And lastly, there's the possibility of making one GIGANTIC shader which contains EVERYTHING, but that sounds completely nuts.

None of the above really answer the question of what happens in the case of highly specialized shaders which are based on the "general" shaders, but have some unique behavior such as, for example, noise dissolves or vertex offsets, etc.

I'm really not sure what the most commonly used approach and what's the smartest thing to do if I want to stay efficient when making them and having the game run smoothly, without shaders causing unnecessary lag.

Would love some help on this, and any good links on the subject would be awesome!

Replies

Sign In or Register to comment.