Shader Structure and Usage

If you are more of a visual learner there’s also a video tutorial:

The shader is structured in 3 main blocks:

  1. Configuration: In this section you can decide all render settings of the material.

Changing these settings will be important to get the exact result you are looking for. This is the most technical part of the shader and will require a bit of technical understanding to always select the right configuration for each case. Hopefully with the help of the presets at the very top you won’t need to change any of the Advanced Configuration settings (read next section for more details on those) in most cases. Here’s a description and use case of each preset:

  • Transparent: The default preset. Uses regular Alpha Blending and it’s great for transparent materials that use a texture with an alpha channel.

  • Additive: Additive Alpha Blending, it adds the final result color of the Material to the frame. This means that black will be invisible. So this blending mode is good for textures with no alpha channel+black background and for bright effects. Additive blendings tend to look very bright when the background isn’t dark enough. Keep in mind that Alpha effects when Additive Configuration is toggled will affect the greyscale of the global result instead of the alpha. In a way the shader reads the black color as alpha 0. This allows the shader effects to work in the same way with all presets.

  • Soft Add (use with caution): Similar to the Additive preset but a bit softer and less bright. Here the black will also be invisible. So this blending mode is good for textures with no alpha channel+black background and that aren’t very bright effects. You may encounter problems when several bright or glowing materials are overlapping, this is caused by the blending configuration this preset uses. If this is a problem for you please use the Additive preset and lower the alpha to get a similar look. Keep in mind that Alpha effects when Additive Configuration is toggled will affect the greyscale of the global result instead of the alpha. In a way the shader reads the black color as alpha 0. This allows the shader effects to work in the same way with all presets.

  • Blend Add / Premultiply: This preset is a combination between Transparent and Additive taking the best from each configuration. This is the blending used in many games and the one mentioned in this very popular Diablo 3 talk that I 100% recommend watching: (https://www.gdcvault.com/play/1017660/Technical-Artist-Bootcamp-The-VFX). The advantage is that it has additive properties such as the black background being ignored but in this case the result won’t be as bright and also the Material can be tinted black without fading.

  • Opaque: Use this when the Material isn’t transparent. This is very performant and straight forward rendering wise but you probably won’t use this for VFX.

  1. Shapes: This is the core of the shader. The shader will calculate a shape result before applying the effects. The shape result will be formed by combining up to 3 different shapes. Each shape can have a different texture, can be scrolled, rotated, distorted and more. Shapes can be enabled and disabled at will, you’ll always have 1 Shape enabled and then you can add 2 extra ones with the button that you’ll find on the bottom of the shape block (and that you can see in the following image [“Use Shape 2?”]).

The workflow will consist on individually setting up each Shape you’ll need using all it’s properties and effects (you can see a full breakdown on the Effects and Properties Breakdown section) and then combine them to fit your needs. To choose how they combine you’ll need to have more than 1 shape enabled and this button will appear:

If you press it you will have access to these options:

You can see the shape combination operation that is taking place on the bottom in bold letters. By default shapes are multiplied together, but you can set the Add Shape Results toggle if you prefer to add them instead. With the weight sliders you can then fine tune how much influence each shape has. If you want to see all the potential behind this combination options please take a look at this Gdc Diablo 3 talk that I also recommended watching when talking about the Presets above:

https://www.gdcvault.com/play/1017660/Technical-Artist-Bootcamp-The-VFX

  1. Effects: Effects are applied after the shapes have been combined. The shape result is modified by the effects (to see how all effects work and what properties they have please read Effects and Properties Breakdown). There are 3 kinds of effects:

    • Color effects: They affect the color (rgb) of the global shape result

    • Alpha effects: They affect the alpha of the global shape result

    • Uv and Vertex effects: They affect the texture coordinates of all textures (included shapes) and also there’s 1 effect that will displace the target mesh vertices over time

Last updated