Please disclose if your mod was created primarily using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
This package has been marked as deprecated, and it's suggested another
alternative is used.
| Last updated | 2 years ago |
| Total downloads | 126807 |
| Total rating | 4 |
| Categories | Mods Libraries BepInEx Client-side |
| Dependency string | IntegrityChaos-CustomPostProcessingAPI-1.0.2 |
| Dependants | 114 other packages depend on this package |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2100README
CustomPostProcessingAPI
Made this tool for Diversity.
Usage:
- Create A full screen shader and apply it to a material for later use. Note: We're back at using the custom color buffer. Please use it in your shaders from now on!
- In your script make sure to include
CustomPostProcessingAPIand Unity's rendering namespaces!
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.Rendering;
using CustomPostProcessingAPI;
Create a new PostProcess
- Create a new
PostProcessand give it a name and assign your previously created material. APostProcesswill define and 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!
Apply the new PostProcess
- Simply add the newly created
PostProcessinto theCustomPostProcessingManager!
CustomPostProcessingManager.Instance.AddPostProcess(myNewPass);
Note: This method returns a FullScreenCustomPass.
Enable / Disable
- If you wish to enable or disable a pass you can simply use
.EnablePass(pass);or.DisablePass(pass);to do so!
CustomPostProcessingManager.Instance.EnablePass(myPass);
- Or you can get a pass from its name:
FullScreenCustomPass myPass = CustomPostProcessingManager.Instance.GetPass("MyPass");
CustomPostProcessingManager.Instance.EnablePass(myPass);
Example 1:
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;
}
}
}
}
Example 2:
using UnityEngine;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.Rendering;
using System.Collections;
using CustomPostProcessingAPI;
using GameNetcodeStuff;
using BepInEx;
namespace SuperAwesomeMod
{
[BepInPlugin(modGUID, modName, modVersion)]
public class Plugin : BaseUnityPlugin
{
public const string modGUID = "Chaos.SuperAwesomeMod";
public const string modName = "SuperAwesomeMod";
public const string modVersion = "1.0.0";
public FullScreenCustomPass myFsPass;
public PlayerControllerB player;
void Awake()
{
// Subscribing to the OnLoad event.
CustomPostProcessingManager.OnLoad += OnLoad;
}
private void OnLoad(object sender, System.EventArgs e)
{
// The sender will always be 'CustomPostProcessingManager'.
CustomPostProcessingManager manager = (CustomPostProcessingManager)sender;
Material myFullscreenMaterial = manager.dither; // Using a premade fullscreen material that comes with the API.
PostProcess myPostProcess = new PostProcess("MyFsPass", myFullscreenMaterial)
{
InjectionType = InjectionType.AfterPostProcess // You can predefine the PostProcess on creation.
};
// Adding the PostProcess and assigning it to 'myFsPass'.
myFsPass = CustomPostProcessingManager.Instance.AddPostProcess(myPostProcess);
}
}
}