You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
796 B
30 lines
796 B
1 year ago
|
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.Rendering;
|
||
|
using UnityEngine.Rendering.Universal;
|
||
|
|
||
|
public class PixelizeFeature : ScriptableRendererFeature
|
||
|
{
|
||
|
[System.Serializable]
|
||
|
public class CustomPassSettings
|
||
|
{
|
||
|
public RenderPassEvent renderPassEvent = RenderPassEvent.BeforeRenderingPostProcessing;
|
||
|
public int screenHeight = 144;
|
||
|
}
|
||
|
|
||
|
[SerializeField] private CustomPassSettings settings;
|
||
|
private PixelizePass customPass;
|
||
|
|
||
|
public override void Create()
|
||
|
{
|
||
|
customPass = new PixelizePass(settings);
|
||
|
}
|
||
|
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
|
||
|
{
|
||
|
|
||
|
#if UNITY_EDITOR
|
||
|
if (renderingData.cameraData.isSceneViewCamera) return;
|
||
|
#endif
|
||
|
renderer.EnqueuePass(customPass);
|
||
|
}
|
||
|
}
|