You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
471 B
C#
18 lines
471 B
C#
2 months ago
|
// 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);
|
||
|
}
|
||
|
}
|