35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.Serialization;
|
|
|
|
/**
|
|
* https://www.febucci.com/2022/05/custom-post-processing-in-urp/
|
|
*/
|
|
|
|
namespace Shaders
|
|
{
|
|
[System.Serializable,
|
|
CreateAssetMenu(fileName = "CustomPostProcessingMaterials", menuName = "CustomMaterial/CustomPostProcessingMaterials")]
|
|
public class CustomPostProcessingMaterials : UnityEngine.ScriptableObject
|
|
{
|
|
//---Your Materials---
|
|
public Material crtEffect;
|
|
|
|
//---Accessing the data from the Pass---
|
|
static CustomPostProcessingMaterials _instance;
|
|
|
|
public static CustomPostProcessingMaterials Instance
|
|
{
|
|
get
|
|
{
|
|
if (_instance != null) return _instance;
|
|
// TODO check if application is quitting
|
|
// and avoid loading if that is the case
|
|
|
|
_instance =
|
|
UnityEngine.Resources.Load("Shaders/CustomPostProcessingMaterials") as CustomPostProcessingMaterials;
|
|
return _instance;
|
|
}
|
|
}
|
|
}
|
|
} |