Created
June 17, 2019 15:13
-
-
Save sneha-belkhale/eb7be42060321df3cef9c838e10369b5 to your computer and use it in GitHub Desktop.
Camera component that goes with the post-processing outline shader for Unity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class PostEffect : MonoBehaviour | |
{ | |
Camera AttachedCamera; | |
public Shader PostOutline; | |
public Material PostMat; | |
void Start() | |
{ | |
AttachedCamera = GetComponent<Camera>(); | |
AttachedCamera.depthTextureMode = DepthTextureMode.Depth; | |
PostMat = new Material(PostOutline); | |
} | |
void OnRenderImage(RenderTexture source, RenderTexture destination) | |
{ | |
Graphics.Blit(source, destination, PostMat); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment