Skip to content
/ VolFx Public

⚪ VFX Core ☄ Selective Post Processing and FX System

License

Notifications You must be signed in to change notification settings

NullTale/VolFx

Repository files navigation

VolFx

Dev by NullTale
Itch Twitter Discord Asset Store Forum

FOR NON COMMERCIAL USE ONLY - version is no longer supported and cannot be used in commercial purposes
read the license, official release only on the AssetStore

VolFx Modular Vfx Post-Processing with selective applivation for Unity Urp
designed for visual effects creation ✧

Tested with 2022.2, 2023.2 Web (2021 not supported) (Unity 6 RenderGraph implemented in asset store version)

  • framework is only a part of the overall effects system its applicability is realised through the ScreenFx
  • the effects are loaded into the system separately and stored in it as render passees PostArt

Features

  • Custom passes - expandable, has minimal set of custom effects and generic blit feature
  • Selective post processing - can be applied to scene objects by layer mask
  • Downlodable art effects - all effects from PostArt projects can be added as passes to VolFx without cluttering RenderFeature list
  • Volume control - all build in effects controlled via volume profile and linked to a layer mask, so scene processing can be easily made dynamic
  • Buffer system - can render object to a buffer texture to provide additional textures(like light maps, pattern animations, height etc) then process and use them later through a shader
  • Configurable pipeline - each effect can be reordered and configured depending on the application

----------------------------------------- - - - - - - -

Selective post processing

Visual novel example, post processing applyed to scene objects by LayerMask to blur the background and fade character sprite
Thus you can make the appearance effect or apply graphical changes separately to scene objects

_Cover

Work with 3D

Selective application to a 3D object with depth buffer support

_cover

Custom texture processing

There is an example of light texture post processing generated by GiLight2D
Volume control allows to tweack texture at runtime to achive desiared light visualization

_Light

Extended AssetStore store version

Additional custom passets and option to support the project

_cover

Fx creation via timeline using ScreenFx

Timeline clip editing using post processing effects

_ScreenFxCover

Editor workflow

Selective application and customizable effects sequence

_cover

Install and usage

Install via Unity PackageManager

https://github.com/NullTale/VolFx.git

Add VolFxProc feature to UrpRenderer add post-process passes to it, control via volume profile

_Urp
* optionally configure the render event, source with output and volume mask

If use LayerMask as a source you need to exclude objects redering by filtering option in UrpRenderer asset to prevent twice rendering
(objects will be rendered by VolFx)

VolFxBuffers feature can be used to collect specific object to a texture to provide some texture source
that can be post processed at runtime and used later throug a shader as a texture or screen space mask for selective application

image

Example of global texture accessed via shader graph (name match, no exposed checkbox)

image

Build in Effects

VolFx was built to be highly configurable and most of the effects are powerful in their combination
There can be a number of custom Blit passes controlled via material for easy effect implementation.

Extended Color Adjustments

With the curve you can adjust the range on which part of the image to apply Color Adjustement
Other option are classic exept the alpha channel that used to adjust alpha chennel to blend images properly

Adjustments

Bloom

Threshold controlled by curve, color made with gradient(support blending)
Also has some advanved options in effect pass like flickering, samples count and scuttering curve.
Basically extended remplementation of moust popular effect to process the images

Bloom

Blur

Blur with radial and distortion options

Blur

Mask

Post processing mask from scene objects with alpha support

_mask

Custom Effect

There is an example of simple grayscale effect that can be found in Project Samples

_cover

All effect must be inherated from VolFxProc.Pass and then added to a VolFxRenderFeature
Material creates automatically using ShaderName attribute, VolumeSettings implemented using Unity API

[ShaderName("Hidden/VolFx/Grayscale")] // shader name for pass material
public class GrayscalePass : VolFxProc.Pass
{
    // =======================================================================
    public override bool Validate(Material mat)
    {
        // use stack from feature settings, feature use custom VolumeStack with its own LayerMask
        var settings = Stack.GetComponent<GrayscaleVol>();
        
        // return false if we don't want to execute pass, standart check
        if (settings.IsActive() == false)
            return false;
        
        // setup material before drawing
        mat.SetFloat("_Weight", settings.m_Weight.value);
        return true;
    }
}

Grayscale shader

Shader "Hidden/VolFx/Grayscale" // name of the shader for ShaderNameAttribute
...

half luma(half3 rgb)
{
    return dot(rgb, half3(0.299, 0.587, 0.114));
}

frag_in vert(const vert_in v)
{
    frag_in o;
    o.vertex = v.vertex;
    o.uv = v.uv;
    return o;
}

half4 frag(const frag_in i) : SV_Target
{
    half4 main = tex2D(_MainTex, i.uv);
    half4 col  = luma(main.rgb);
    
    return half4(lerp(main.rgb, luma(col.rgb), _Weight), main.a);
}

Feature work as a wrapper but can be extended by override low level methods, to gain access to a CommandBuffer and other rendering API stuff

/// called to perform rendering
public virtual void Invoke(CommandBuffer cmd, RTHandle source, RTHandle dest,
                           ScriptableRenderContext context, ref RenderingData renderingData)
{
    Utils.Blit(cmd, source, dest, _material, 0, Invert);
}

PostArt

More effects can be downloaded separately for use in combination
If VolFx is installed they will work as part of the framework and will not appear in the RenderFeature list

Effects applied sequentially to a 3D object

_cover