Add RetroSuite-3D shader components

This commit is contained in:
Sweet Tini
2020-01-30 20:59:23 -05:00
parent d2d32b8490
commit afc6c879e7
31 changed files with 856 additions and 264 deletions

View File

@@ -0,0 +1,29 @@
/// <summary>
/// RetroSuite-3D by oxysoft
/// https://github.com/oxysoft/RetroSuite3D
/// </summary>
using UnityEngine;
[ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
[AddComponentMenu("Image Effects/Retro Size")]
public class RetroSize : MonoBehaviour
{
[Header("Resolution")]
public int horizontalResolution = 160;
public int verticalResolution = 144;
public void OnRenderImage(RenderTexture src, RenderTexture dest)
{
horizontalResolution = Mathf.Clamp(horizontalResolution, 1, 2048);
verticalResolution = Mathf.Clamp(verticalResolution, 1, 2048);
var scaled = RenderTexture.GetTemporary(horizontalResolution, verticalResolution);
scaled.filterMode = FilterMode.Point;
Graphics.Blit(src, scaled);
Graphics.Blit(scaled, dest);
RenderTexture.ReleaseTemporary(scaled);
}
}