You are viewing a potentially older version of this package. View all versions.
IntegrityChaos-CustomPostProcessingAPI-1.0.0 icon

CustomPostProcessingAPI

Made this tool for Diversity.

Date uploaded 2 years ago
Version 1.0.0
Download link IntegrityChaos-CustomPostProcessingAPI-1.0.0.zip
Downloads 594
Dependency string IntegrityChaos-CustomPostProcessingAPI-1.0.0

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100

README

CustomPostProcessingAPI

Made this tool for Diversity.

Usage:

  • Create A full screen shader and apply it to a material for later use. Note: It is VERY important to use the custom color buffer of HDRP in order to to see the original post process of Lethal Company!
  • In your script make sure to include CustomPostProcessingAPI and Unity's rendering namespaces!
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.Rendering;
using CustomPostProcessingAPI;
  • Create a new PostProcess and give it a name and assign your previously created material. A PostProcess will define et set up both "Custom Pass Volume" and the "Full Screen Pass".
PostProcess myNewPass = new PostProcess("PassName", material);

Note: You can't have 2 PostProcess of the same name!

  • Simply add the newly created PostProcess into the CustomPostProcessingManager!
CustomPostProcessingManager.Instance.AddPostProcess(myNewPass);

Note: This method returns a FullScreenCustomPass.

Example:

using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.Rendering;
using System.Collections;
using CustomPostProcessingAPI;
using GameNetcodeStuff;

namespace SuperAwesomeMod
{
    public class AddPostProcessing : MonoBehaviour
    {
        private FullScreenCustomPass vignetteFSPass;

        public PlayerControllerB player;

        public Material myFullscreenMaterial;

        void Start()
        {
            // Creating the PostProcess.

            PostProcess vignettePass = new PostProcess("VignettePass", myFullscreenMaterial)
            {
                InjectionType = InjectionType.AfterPostProcess, // You can predefine the PostProcess on creation.
                Enabled = false // Disabling it on creation for example.
            };

            // Adding the PostProcess and assigning it to 'vignetteFSPass'.

            vignetteFSPass = CustomPostProcessingManager.Instance.AddPostProcess(vignettePass);

            // Note that you can't 'remove' a pass. You can simply disable it.
        }

        void Update()
        {
            // Simple if statement to enable/disable the pass according to the dead value of the player.

            if (player.isPlayerDead && vignetteFSPass.enabled)
            {
                vignetteFSPass.enabled = false;
            }
            else if (!vignetteFSPass.enabled)
            {
                vignetteFSPass.enabled = true;
            }
        }
    }
}

CHANGELOG

1.0.0 Initial Release

  • Initial release of CustomPostProcessingAPI.

1.0.1 Rework

  • Reworked the API to be simply better.

1.0.2 Optimization

  • Optimized the post processing system.