Archived

This topic is now archived and is closed to further replies.

Draigan

Vertex Shaders

Recommended Posts

What is the best way to design a system around their use? Should I have one vertex shader for each item that requires one and set it''s textures/matrices from that object. Or if I have 4 or 5 things that use that shader but use different textures, should I use the same shader and change it''s texture depending on the object thereby sharing the shaders? THanks a lot.

Share this post


Link to post
Share on other sites
You should minimize shader changes as much as possible. Therefore, don''t have the spaceship shader, the alien shader, etc.

Instead, have the EverythingThatsToonRendered shader, the EverythingThatsBumpMappedShader, etc. (As much as it makes sense to).

Shaders and textures are mostly mechanically independent, meaning that you might have several bump map textures for different objects, but that doesn''t really mean that you have to have different shaders. In general, you want to mininize texture changes as well.

Share this post


Link to post
Share on other sites