MORE VFX Shader Techniques ft. Godot

MORE VFX Shader Techniques ft. Godot

Shader Techniques for VFX in Godot 4.2

Introduction to Shader Techniques

  • The video introduces common shader techniques used for visual effects (VFX), specifically implemented in Godot 4.2 Beta 5.
  • The presenter aims to share more than three techniques, building on previous content.

Camera Offset Technique

  • Camera offset is explained as a method to adjust the vertices of an effect relative to the camera rather than moving the camera itself.
  • Without this technique, effects may clip through geometry, leading to undesirable visual outcomes, such as light flares clipping through objects.
  • To implement camera offset, set transform align to Z-Billboard and optionally adjust Draw Order to View Depth for rendering issues.
  • The vertex stage of the shader uses world coordinates by adding world_vertex_coords in render mode; direction from the camera is calculated and normalized.
  • Care must be taken with depth adjustments since improper offsets can lead to unwanted clipping through other geometries.

Vertex Offset Technique

  • This technique genuinely offsets vertices without relying on camera positioning, allowing for various creative effects based on user preference.
  • A texture sample value is added to the vertex position multiplied by its normal; this method allows flexibility in achieving different visual styles.
  • It's important not to overdo vertex offsets as they depend on mesh density; excessive displacement can lead to disconnections between vertices.

Backface Colors Technique

  • Backface colors allow distinct coloring for backfaces of effects, enhancing visual complexity and appeal in shaders.
  • Implementation begins with defining front and back face colors but requires determining if a pixel is a front or back face using mathematical calculations instead of traditional if-statements due to performance concerns in shaders.

Texture Packing Technique

  • Texture packing reduces space usage by sampling multiple textures efficiently within shaders, which is crucial for optimizing performance and resource management.

Texture Packing Techniques for VFX

Introduction to Texture Packing

  • The speaker discusses the importance of reducing texture size by packing textures into different R, G, and B channels. They utilize Substance Designer for creating VFX textures, highlighting its RGBA merge node feature that simplifies texture packing.

Channel Separation and Usage

  • Each channel can be separated: the main texture is placed in the red channel, a mask in the green channel, and a panning trail in the blue channel. These channels are combined within shaders to create packed effects, demonstrating significant disk space savings (notably 2MB).

Balance in Texture Management

  • The speaker emphasizes maintaining balance when reusing textures. For instance, using a circular mask as a separate texture across multiple effects is acceptable and sometimes necessary to avoid overcomplication.

Conclusion and Resources

  • The speaker expresses hope that viewers found the information helpful and encourages questions or suggestions in the comments. They mention that all project samples are available on their Patreon page linked in the description.
Video description

More shaders that I use (or want to use more) when I make VFX :) A project containing all my samples is available over at my patreon for free :D First Shader Video: https://youtu.be/N9ilhL8JFes?si=AoFg4sGd0telsWcA Patreon: https://www.patreon.com/onetupthree 00:00 - 00:31 Intro 00:31 - 03:22 Camera Offset 03:22 - 04:40 Vertex Offset 04:40 - 06:40 Backface Colors 06:40 - 08:08 Texture Packing 08:08 - 08:43 Outro #godot #godot4 #vfx #shaders #gamedev #realtimevfx #gaming #visualeffects #tutorial #indie BGM Artist: KevinMacleod (Incompetech) Tracks: - Too Cool - Jazz Brunch - Crinoline Dreams - Awesome Call