Back
Featured image of post Qbie Vfx Kit

Qbie Vfx Kit

Intro

Hello fellow artists!

I have embarked on the journey of learning VFX art since some months now. During these times I have created a lot of different shaders that i then used to make some of my effects. As the time went on, I started to spot more and more similarities between the different shaders. A few days ago, I have converged on a single shader that has allowed me to create this explosion effect.

Together with the kit, I have included a number of meshes with different types of UV unwrapping and pivots, which allowed me to create the different particle systems with the same spatial shader.

Download the kit here

The shader

This master shader works for a variety of different particle types, from fully 3D particles with heightmaps and meshes, to billboard flipbooks. Most parameters are not meant to be used all together, for example panning the texture over the particle life doesn’t make much sense if particle animation is enabled.

Get the shader here

Textures

This shader supports two separate textures for particles and different ways of mixing them. Additionally, the textures can be made to pan on different directions in the UV space.

  • mix mode mix strategy for the textures. 0 means multiply, 1 means add.
  • texture1 first color texture
  • texture1 offset offset for the first texture
  • texture1 scale scale for the first texture
  • texture1 pan direction direction in which the first texture should pan, in UV space
  • texture1 pan speed speed of the panning for the first texture
  • texture2 second color texture
  • texture2 offset offset for the second texture
  • texture2 scale scale for the second texture
  • texture2 pan direction direction in which the second texture should pan, in UV space
  • texture2 pan speed speed of the panning for the second texture

In the following image, from left to right

  1. Two textures, one panning, one static acting as a mask. Mix mode 0
  2. Same textures as the previous one, but with mix mode 1
  3. Two different panning textures, mix mode 0
  4. Two different panning textures, mix mode 1

different_mixes

Emission

One of the biggest features that I missed in the spatial material was the ability to animate the emission value over the life of the particle. The shader introduces two parameters to control emission.

  • emission energy : the overall emission energy of the particles
  • emission over life: a curve that describes how the emission behaves over the lifetime of the particle.

emission

Alpha control

Fading alpha is cool but have you heard of alpha erosion? There are multiple ways of doing it, and I tried to include the most common in the shader. The behaviour of the shader is different depending wheter or not you have enabled the alpha erosion property, which is on by default. The behaviour of the alpha is driven by the COLOR variable, which is assigned through the process shader with either a single color, or using a color gradient texture.

  • alpha is the main alpha value of the shader to which another value is subtracted (or multiplied when alpha erosion is off. The particle cannot get more opaque than alpha
  • dissolve texture is the texture used as a mask to dissolve the particles. Won’t work well if the particle is animated.
  • erosion smoothness defines the value used later in the smoothstep. Should be 1 if alpha erosion isn’u used to avoid strange behaviour

From left to right, alpha erosion with low smoothness, alpha erossion with high smoothness, no alpha erosion.

different_mixes

Proximity fade

Proximity fade is used to avoid quads visibly clipping with opaque geometry in the scene.

  • use proximity fade enable proximity fade
  • proximity fade distance distance in world space to the object before the fading starts

Camera fade

Sometimes particles can look rather nasty if they are too close to the camera. Camera fade causes the particle to fade out when too close to the camera.

  • camera fade enable fading based on camera distance
  • distance fade min closes point where the particle is still marginally visible
  • distance fade max distance above which the particle will be fully visible

Height amount

For effects such as smoke and other non-quad particles, sometimes a height map is required.

  • use heightmap enable height and normalmap
  • height texture heightmap of the particle
  • normal texture normal map of the particle

Billboarding and rotation

The term “billboard” is used to refer to objects that always face the camera. In this shader it is a float instead of a boolean, so that the particle can be not billboard, full billboard, and a bit inbetween.

  • particle billboard blend when set to 0, the particle rotation is fully substituted with the billboard rotation
  • rotate y workaround to rotate_y being hard to control in the process shader.

Particle animation

While there are very cool effects based on dissolve maps, sometimes they just don’t cut it (wink wink). These settings enable the usage of flipbook style animation.

  • use particle animation enables the particle animation
  • particle anim h frames the number of horizontal frames in the flipbook
  • particle anim v frames the numger of vertical frames in the flipbook
  • particles anim loop should the particle animation loop
  • particle animation resize should the mesh be divided on the xy axis by the number of h and v frames.

On the left, a flipbook with particle animation resize enabled. On the right it is disabled, note the stretch of the image.

emission

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy