ドキュメント

Unity Engine

Unity Engine

invertCulling

Select whether to invert the backface culling (true) or not (false).
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static bool invertCulling { get; set; }

Remarks

This flag can "flip" the culling mode of all rendered objects. Major use case: rendering reflections for mirrors, water etc. Since virtual camera for rendering the reflection is mirrored, the culling order has to be inverted. You can see how the Water script in Effects standard package does that.

Examples

// When attached to the camera, this script// will make all rendering be flipped "inside out",// i.e. back faces of objects will be rendered instead// of front faces.using UnityEngine;[ExecuteInEditMode]public class ExampleScript : MonoBehaviour{ private bool oldCulling; public void OnPreRender() { oldCulling = GL.invertCulling; GL.invertCulling = true; } public void OnPostRender() { GL.invertCulling = oldCulling; }}