mirror of
https://github.com/imperialsushi/gutterball-3.git
synced 2025-06-15 05:07:42 +00:00
New Version 1.6
New 125 balls & powerups. Improved graphics.
This commit is contained in:
parent
b35433ae45
commit
71779ef7ac
9413 changed files with 193360 additions and 264803 deletions
|
@ -0,0 +1,37 @@
|
|||
using UnityEngine;
|
||||
//using System;
|
||||
|
||||
/// A Utility class for performing various image based rendering tasks.
|
||||
[AddComponentMenu("")]
|
||||
public class ImageEffects
|
||||
{
|
||||
public static void RenderDistortion(Material material, RenderTexture source, RenderTexture destination, float angle, Vector2 center, Vector2 radius)
|
||||
{
|
||||
bool invertY = source.texelSize.y < 0.0f;
|
||||
if (invertY)
|
||||
{
|
||||
center.y = 1.0f - center.y;
|
||||
angle = -angle;
|
||||
}
|
||||
|
||||
Matrix4x4 rotationMatrix = Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(0, 0, angle), Vector3.one);
|
||||
|
||||
material.SetMatrix("_RotationMatrix", rotationMatrix);
|
||||
material.SetVector("_CenterRadius", new Vector4(center.x, center.y, radius.x, radius.y));
|
||||
material.SetFloat("_Angle", angle * Mathf.Deg2Rad);
|
||||
|
||||
Graphics.Blit(source, destination, material);
|
||||
}
|
||||
|
||||
[System.Obsolete("Use Graphics.Blit(source,dest) instead")]
|
||||
public static void Blit(RenderTexture source, RenderTexture dest)
|
||||
{
|
||||
Graphics.Blit(source, dest);
|
||||
}
|
||||
|
||||
[System.Obsolete("Use Graphics.Blit(source, destination, material) instead")]
|
||||
public static void BlitWithMaterial(Material material, RenderTexture source, RenderTexture dest)
|
||||
{
|
||||
Graphics.Blit(source, dest, material);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue