Home
Softono
Godot-God-Rays-Plugin

Godot-God-Rays-Plugin

Open source MIT GDScript
162
Stars
12
Forks
5
Issues
5
Watchers
5 years
Last Commit

About Godot-God-Rays-Plugin

Godot God Rays Plugin is a post-processing effect for Godot 3.2 that creates real-time volumetric god rays in video games. It works with DirectionalLight, OmniLight, and SpotLight nodes by adding a GodRays node as a child of the light source. Key customizable properties include Exposure for controlling ray brightness, Attenuation for shaping the rays, and Light Size for defining the visible size of the light source. Setting Exposure to 0 disables the effect entirely to save performance. Project Settings under Rendering/Quality offer additional options: Sample Number controls rendering accuracy versus CPU cost, Dither Amount adds noise to reduce aliasing artifacts, and a PCF5 toggle enables smoother depth filtering (though it does not smooth dithering noise). The plugin also integrates with Lexpartizan's Godot Sky Shader, allowing clouds to influence the god rays when the GodRays node is added as a child of the Sky.tscn node. Performance impact depends on screen or viewport size. Installation requires copying

Platforms

Web Self-hosted

Languages

GDScript

Links

Godot God Rays Plugin

Donate

Screenshot

This is a plugin made for Godot 3.2. It contains a node to create a real-time volumetric effect for video games. This is a post-processing effect, so the performance hit depends on the size of the screen/viewport.

Installation

First you download it (duh :P). Then to get the plug-in into your Godot game project, just copy the addons/SIsilicon.vfx.godrays folder and paste it into your project's own addons folder. If you don't have such a folder, make one. Then open up your project, go into ProjectSettings -> Plugins tab. The plug-in should appear there. All that's left to do now is to just set its status to Active and you should be good to go. You need to set it to active in this demo project too.

Usage

The GodRays node creates a, you guessed it, god rays post-processing effect. It's made to be used with either a DirectionalLight or an OmniLight, but nothing's stopping you from using it on a SpotLight(It won't take the shape of its cone though). Just create a node as a child of your light and you're all set!

Properties

This node has minimal properties and is easy to customize.

  • Exposure: How bright the god rays are. Setting it to 0 will turn off the effect to save on performance.
  • Attenuation: The "shape" of the god rays. You'll have to play with this a bit to know what it does.
  • Light Size: The visual size of the light source. For DirectionalLights a value of 1 will lead to the light covering half the screen, while OmniLights multiply this by their range and are attenuated with distance.

Project Settings

There'll also be new parameters in the Project Settings under Rendering/Quality.

  • Sample Number: The number of samples used to render the god rays. More samples lead to a more accurate result, but also is more CPU heavy.
  • Dither Amount: The amount of noise to use on the effect. This can help counter aliasing artifacts caused by a low sample count.
  • Use PCF5: Whether to use more depth samples in the effect for filtering. This can make it look smoother. Disclaimer: it doesn't smooth noise from dithering.

Sky Shader

This plugin also works with Lexpartizan's Godot Sky Shader. All you have to do is add the GodRays node as a child of the Sky.tscn node. The clouds in the sky will then affect the god rays.