I was asked about how to create lightsabers with Post-processing v2 and Unity 2018, so here it is as add-on:
Preview
Here’s a preview video of what this is about:
Quick Setup
Here are the quick setup steps:
-
create a new project “Weapon Tutorial” using “3D” Template in Unity 2019.1.5f1 (or use 2018+)
-
set Color Space to “Linear” in the project settings
-
add the Post Processing package (current version is 2.1.7)
-
import the source code from github
-
open Scenes > SampleScene
-
hit play
-
press space to toggle the weapon on and off
Additional Info
- the shader graph is the one I posted in the [Amplify Shader Editor thread]( [Best Tool Asset Store Award] Amplify Shader Editor - Node-based Shader Creation Tool page-32#post-3147421)
(Credits to “K Re” who did the glow effect graph tutorial for the unreal engine)
-
you might want to add audio for the weapon on / off / loop / swing sound in the Weapon script settings; unfortunately I’m not allowed to provide them
-
the glow effect very much depends on your shader settings and the bloom post processing settings, adjust to your own preferences
How it works
Please see the HDRP version above about how it works. The setup and the scripts are the same.
A difference is in the settings though. The HDRP version works e. g. with lumen, that’s not available in the Standard version. We need to adjust the light settings accordingly. So the Blade Color Intensity and the Light Intensity settings of the Weapon script got a value of 1.
Have fun