Begin(int)
Begin drawing 3D primitives.
Read time 1 minuteLast updated 2 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public static void Begin(int mode)
Parameters
Remarks
In OpenGL this matches ; on other graphics APIs the same functionality is emulated. Between GL.Begin and GL.End it is valid to call GL.Vertex, GL.Color, GL.TexCoord and other immediate mode drawing functions.
glBeginYou should be careful about culling when drawing primitives yourself. The culling rules may be different depending on which graphics API the game is running. In most cases the safest way is to use command in the shader.
Cull OffTo draw geometry, use Graphics.RenderPrimitives, Graphics.RenderMesh, or a CommandBuffer instead. These APIs are more efficient than immediate mode drawing. For an example, refer to GL.
Additional Resources: GL.End.