Initial Commit
This commit is contained in:
commit
ee5c2f922d
2255 changed files with 547750 additions and 0 deletions
30
Assets/Scripts/ImageEffects/PixelBoy.cs
Normal file
30
Assets/Scripts/ImageEffects/PixelBoy.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using UnityEngine;
|
||||
|
||||
[ExecuteInEditMode, AddComponentMenu("Image Effects/PixelBoy")]
|
||||
public class PixelBoy : MonoBehaviour
|
||||
{
|
||||
public Camera cam;
|
||||
public int w = 720;
|
||||
private int h;
|
||||
|
||||
protected void Start()
|
||||
{
|
||||
cam = GetComponent<Camera>();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
var ratio = cam.pixelHeight / (float)cam.pixelWidth;
|
||||
h = Mathf.RoundToInt(w * ratio);
|
||||
}
|
||||
|
||||
private void OnRenderImage(RenderTexture source, RenderTexture destination)
|
||||
{
|
||||
source.filterMode = FilterMode.Point;
|
||||
var buffer = RenderTexture.GetTemporary(w, h, -1);
|
||||
buffer.filterMode = FilterMode.Point;
|
||||
Graphics.Blit(source, buffer);
|
||||
Graphics.Blit(buffer, destination);
|
||||
RenderTexture.ReleaseTemporary(buffer);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/ImageEffects/PixelBoy.cs.meta
Normal file
11
Assets/Scripts/ImageEffects/PixelBoy.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e5a372f50b492bf4092181269c626770
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Add table
Add a link
Reference in a new issue