gutterball-3/Gutterball 3/Assets/Standard Assets/Image Effects (Pro Only)/EdgeDetectEffect.cs
SkunkStudios 71779ef7ac New Version 1.6
New 125 balls & powerups.
Improved graphics.
2025-05-07 06:18:40 +07:00

17 lines
471 B
C#

// Implements Edge Detection using a Roberts cross filter.
using UnityEngine;
[ExecuteInEditMode]
[AddComponentMenu("Image Effects/Edge Detection (Color)")]
public class EdgeDetectEffect : ImageEffectBase
{
public float threshold = 0.2F;
// Called by camera to apply image effect
void OnRenderImage (RenderTexture source, RenderTexture destination)
{
material.SetFloat ("_Treshold", threshold * threshold);
Graphics.Blit (source, destination, material);
}
}