41 lines
1.4 KiB
C#
41 lines
1.4 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace UnityStandardAssets.ImageEffects
|
|
{
|
|
// Token: 0x02000074 RID: 116
|
|
[AddComponentMenu("")]
|
|
public class ImageEffects
|
|
{
|
|
// Token: 0x06000146 RID: 326 RVA: 0x0000E7B0 File Offset: 0x0000CBB0
|
|
public static void RenderDistortion(Material material, RenderTexture source, RenderTexture destination, float angle, Vector2 center, Vector2 radius)
|
|
{
|
|
bool flag = source.texelSize.y < 0f;
|
|
if (flag)
|
|
{
|
|
center.y = 1f - center.y;
|
|
angle = -angle;
|
|
}
|
|
Matrix4x4 matrix4x = Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(0f, 0f, angle), Vector3.one);
|
|
material.SetMatrix("_RotationMatrix", matrix4x);
|
|
material.SetVector("_CenterRadius", new Vector4(center.x, center.y, radius.x, radius.y));
|
|
material.SetFloat("_Angle", angle * 0.017453292f);
|
|
Graphics.Blit(source, destination, material);
|
|
}
|
|
|
|
// Token: 0x06000147 RID: 327 RVA: 0x0000E863 File Offset: 0x0000CC63
|
|
[Obsolete("Use Graphics.Blit(source,dest) instead")]
|
|
public static void Blit(RenderTexture source, RenderTexture dest)
|
|
{
|
|
Graphics.Blit(source, dest);
|
|
}
|
|
|
|
// Token: 0x06000148 RID: 328 RVA: 0x0000E86C File Offset: 0x0000CC6C
|
|
[Obsolete("Use Graphics.Blit(source, destination, material) instead")]
|
|
public static void BlitWithMaterial(Material material, RenderTexture source, RenderTexture dest)
|
|
{
|
|
Graphics.Blit(source, dest, material);
|
|
}
|
|
}
|
|
}
|