Shader VFX

The three shaders above were created in a couple of hours to demonstrate a few basic shader techniques. The VFX on the left demonstrates texture masking, transparency and a basic particle effect. The center VFX displays a shader which takes hit points and produces a wave effect using vertex displacement. The VFX on the right demonstrates a geometry shader which disintegrates the mesh.

Left Bust

The left bust is a standard dissolve effect with a custom generated texture. These two textures are used to create the dissolve effect:

Dissolve Mask

Color Ramp

The disintegration mask uses the red channel to determine what pixel should be sampled from the color ramp, and whether to clip the pixel altogether. This red channel is offset by an overall dissolve value which is slowly increased to dissolve the whole mesh. Since the texture modes are set to point filtering, this occurs in stages, creating a pixelated effect. The maze like disintegration pattern is generated from a custom script designed specifically for this use case. It works by creating a maze from random points on the texture, darkening by distance from the original point. Then the space between the maze is flood filled , again darkening by distance from the flood point. The flood fill uses a darker color than the maze, resulting in the flood fill disappearing first then the maze dissolving out.

The particle effects are completely uninteresting, and the lighting glow is created with a point light.

Center Bust

The shader for the center bust take in an array of points and initial hit times. For each point, we calculate how much time has passed, and multiply this by a speed variable to get the current hit effect radius. Each vertex and fragment then compares its distance to the hit point with this radius, and runs the difference through a function that produces the effect factor. This effect factor is used as a scalar multiplier to offset the vertex position along the vertex normal, and to lerp the fragment color to red. 

This basic effect concept can be used for all sorts of things, for example, procedurally applying tumor like mutations to a creature by lerping the affected fragments to a tumor texture.

Again, the particle effects are fairly standard hit effects, inspired by the particles in Overwatch when you shoot a wall.

Right Bust

The right hand bust runs a geometry shader that reconstructs each input triangle with 3 new vertices. These vertices are translated along the triangle’s normal and rotated. Both the translation and rotation are scaled by a disintegration scalar. The disintegration scalar is determined by the difference between the Y position of the triangle, and an input variable h. By sliding up and down, we get the effect seen in the video.

The triangles are also recolored using HDR colors to get the glow, with the color determined by the disintegration scalar.