Material templates define inputs, constants, textures, shader states and the techniques that are being used by your materials. Material templates are quite dynamic and can be written in such a way that they are able to support multiple different but similar shaders. That means that you do not have to create a seperate template for each new shader you write if you have a well written template.
Remember that scrolling hud element shader we created within the introduction? The template we used was very basic and only supports 1 texture and uses a hard-coded techset. What if we want to use a second texture within a shader?
Example of a more dynamic template that can use 2 different techsets depending on your material settings in AssetManager:
The template will choose a fitting techset for your material settings set within Asset Manager.
Materials using only a single colorMap will be using the techset 2d_scroll_c0 while materials that use a second texture will use 2d_scroll_c0c1.
You obv. have to create 2 techsets now, each calling their own technique and each technique its own shaders.
Including other templates
Using the custom-string field below the template field
Using constants
Not using any texture at all
Quick links to articles related to material templates