Cpp-Horri fold v1.0.0-beta.3: A port of Horri-Fi shader to Defold

icon
Latest Release: v1.0.0-beta.3

This release includes improvements to the message api.

Source code(tar.gz)
Source code(zip)

Horri-Fold

A port of Horri-Fi shader to Defold. Horri-Fold is a Lo-Fi Horror Shader with support for seven different effects:

-Scanlines -Noise -VHS distortion -Bloom -Vignette -Chromatic aberration -CRT TV curve

Installation

You can use Horri-Fold in your own project by adding this project as a Defold library dependency. Open your game.project file and in the dependencies field under project add:

https://github.com/TheKing0x9/horri-fold/archive/master.zip

Or point to the ZIP file of a specific release.

Quick Start

Getting started with Horri-Fold is easy:

  1. Add quad.go to your game.
  2. Open game.project and make sure to reference horri-fold/postprocess.render in the Render field in the Bootstrap section.
  3. Also in the Dependencies field in the Project section, add Defold Orthographic as a dependency.

Documentation

Horri-Fold Script

The following properties are exposed via the Horri-Fold script.

  • Enable Bloom : Enables the bloom effect.

  • Bloom Radius : The Radius of bloom effect.

  • Bloom Intensity : The Brightness of the bloom effect. Should be between 0 and 1.

  • Bloom Threshold : Provies a cutoff value for the Bloom Radius property. Should be between 0 and 1.

  • Enable Chromatic Aberration : Enables the chromatic aberration effect.

  • Chromatic Strength : Controls the strength of chromatic aberration. Should be between 0 and 1.

  • Enable Vignette : Enables the vignette effect

  • Vignette Strength : Controls the brightness of non-vignetted areas. Should be between 0 and 1.

  • Vignette Intensity : The curvature of vignette effect. Should be between 0 and 1.

  • Enable Noise : Enables a noise-effect, like those seen in old TVs.

  • Noise Strength : Controls the strength of noise effect. Should be between 0 and 1.

  • Enable VHS Distortion : Enables VHS Distortion effect.

  • Distortion Strength : Controls the strength of Distortion effect. Should be between 0 and 1.

  • Enable Scanlines : Enables scanlines.

  • Scanlines Strength : The density of scanlines. Should be between 0 and 1.

  • Enable CRT : Enables the CRT TV curve effect.

  • CRT Curve : The screen curvature. Should be between 0 and 5.

Messages

All of the seven effects can be at runtime via the following messages.

bloom

Configures the bloom parameters. Supports the following keys:

  • enabled : boolean Enables or disables the effect
  • radius : number The Radius of bloom effect
  • intensity : number The Brightness of the bloom effect. Should be between 0 and 1.
  • threshold : number Provies a cutoff value for the Bloom Radius property. Should be between 0 and 1.

chromatic_aberration

Configues the Chromatic Aberration. Supports the following keys:

  • enabled : boolean Enables or disables the effect.
  • strength : number The strength of the effect. Should be between 0 and 1.

vignette

Configues the Vignette. Supports the following keys:

  • enabled : boolean Enables or disables the effect.
  • strength : number The strength of the effect. Should be between 0 and 1.
  • intensity : number The intensity of vignette. Should be between 0 and 1.

noise

Configues the Noise effect. Supports the following keys:

  • enabled : boolean Enables or disables the effect.
  • strength : number The strength of the effect. Should be between 0 and 1.

vhs

Configues the VHS Distortion effect. Supports the following keys:

  • enabled : boolean Enables or disables the effect.
  • strength : number The strength of the effect. Should be between 0 and 1.

scanlines

Configues Scanlines. Supports the following keys:

  • enabled : boolean Enables or disables the effect.
  • strength : number The strength of the effect. Should be between 0 and 1.

crt

Configues the CRT curve. Supports the following keys:

  • enabled : boolean Enables or disables the effect.
  • curve : number The curvature of the screen. Should be between 0 and 5.

Custom Render Script/Camera Integration

While the in-built render script depends on Defold Orthographic to work, Horri-Fold can be customized to be used alongside any render script.

More Documentation on this coming soon.

Known Bugs

Due to my limited GLSL knowledge, Bloom has not yet been implemented in the shader.

License

Both Horri-Fold and Horri-Fi shaders are licensed under the MIT license. The demo assets are licensed under CC0 license.

Credits


Comments

  • Get Bloom Working
    Get Bloom Working

    Jan 8, 2022

    Describe the problem The bloom code in Horri-Fi shader uses something called a texel. Research on what it is, and how it can be updated in the shader.

    bug help wanted 
    Reply
  • feat: updated script to respond to messages
    feat: updated script to respond to messages

    Jan 8, 2022

    Closes #1

                                                                                                                                                                                                           
    Reply
  • feat: updated the crt code with a warp effect
    feat: updated the crt code with a warp effect

    Jan 8, 2022

    Closes #3

                                                                                                                                                                                                           
    Reply
  • Improve CRT Effect
    Improve CRT Effect

    Jan 8, 2022

    Describe the Problem In its current state, the CRT just warps the objects inside it. Without a proper curve to supplement it, it becomes difficult for the player to understand what's going on.

    Proposed Solution Implement a screen warping effect around the CRT effect.

    enhancement 
    Reply
  • Add ability to customize properties at runtime via messages
    Add ability to customize properties at runtime via messages

    Jan 8, 2022

    Describe the problem Currently, there is no way to configure the shader parameters at runtime without referencing the quad itself and setting them manually. This might be a blocker in games where these things might need to changed on a per-scene/user configuration basis.

    Possible Solutions Make the horri-fold script react to messages and set the shader parameter accordingly.

    Alternatives considered Maintain the current system in which the user has to manually reference the quad and set the shader parameters. This might not be optimal as the user has to read the source to understand which parameter does what.

    enhancement 
    Reply