Camera.depthTextureMode 深度纹理模式
var depthTextureMode : DepthTextureMode
Description描述
How and if camera generates a depth texture.
相机生成怎样的一个深度纹理。
A camera can build a screen-space depth texture. This is mostly useful for image post-processing effects. Note that generating the texture incurs a performance cost.
相机可以建立一个屏幕空间深度纹理。这个主意用于图像后期处理效果。注意,生成纹理导致性能的花费。
参见: DepthTextureMode.
C#
JavaScript
using UnityEngine;using System.Collections;public class example : MonoBehaviour {public void Awake() {camera.depthTextureMode = DepthTextureMode.DepthNormals;}}
// Generate a depth + normals texture//生成一个深度+法线纹理camera.depthTextureMode = DepthTextureMode.DepthNormals;