Vertex Shaders

Started by
0 comments, last by Draigan 22 years, 1 month ago
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.
Advertisement
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.
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials

This topic is closed to new replies.

Advertisement