You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
// Attach this script to your camera in order to use depth nodes in forward rendering
|
|
|
|
using UnityEngine;
|
|
|
|
[RequireComponent(typeof(Camera))]
|
|
public class EnableCameraDepthInForward : MonoBehaviour {
|
|
#if UNITY_EDITOR
|
|
void OnDrawGizmos(){
|
|
Set();
|
|
}
|
|
#endif
|
|
void Start () {
|
|
Set();
|
|
}
|
|
void Set(){
|
|
if(GetComponent<Camera>().depthTextureMode == DepthTextureMode.None)
|
|
GetComponent<Camera>().depthTextureMode = DepthTextureMode.Depth;
|
|
}
|
|
}
|