Version: 2023.1
LanguageEnglish
  • C#

Graphics

class in UnityEngine

/

Implemented in:UnityEngine.CoreModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Raw interface to Unity's drawing functions.

This is the high-level shortcut into the optimized mesh drawing functionality of Unity.

Static Properties

activeColorBufferCurrently active color buffer (Read Only).
activeColorGamutReturns the currently active color gamut.
activeDepthBufferCurrently active depth/stencil buffer (Read Only).
activeTierThe GraphicsTier for the current device.
minOpenGLESVersionThe minimum OpenGL ES version. The value is specified in PlayerSettings.
preserveFramebufferAlphaTrue when rendering over native UI is enabled in Player Settings (readonly).

Static Methods

BlitUses a shader to copy the pixel data from a texture into a render texture.
BlitMultiTapCopies source texture into destination, for multi-tap shader.
ClearRandomWriteTargetsClear random write targets for Shader Model 4.5 level pixel shaders.
ConvertTextureCopies the pixel data from one texture, converts the data into a different format, and copies it into another texture.
CopyBufferCopies the contents of one GraphicsBuffer into another.
CopyTextureCopies pixel data from one texture to another.
CreateAsyncGraphicsFenceShortcut for calling Graphics.CreateGraphicsFence with GraphicsFenceType.AsyncQueueSynchronisation as the first parameter.
CreateGraphicsFenceCreates a GraphicsFence.
DrawMeshDraw a mesh.
DrawMeshInstancedDraws the same mesh multiple times using GPU instancing.
DrawMeshInstancedIndirectThis function is now obsolete. Use Graphics.RenderMeshIndirect instead. Draws the same mesh multiple times using GPU instancing.
DrawMeshInstancedProceduralThis function is now obsolete. Use Graphics.RenderMeshPrimitives instead. Draws the same mesh multiple times using GPU instancing. This is similar to Graphics.DrawMeshInstancedIndirect, except that when the instance count is known from script, it can be supplied directly using this method, rather than via a ComputeBuffer.
DrawMeshNowDraw a mesh immediately.
DrawProceduralThis function is now obsolete. For non-indexed rendering, use Graphics.RenderPrimitives instead. For indexed rendering, use Graphics.RenderPrimitivesIndexed. Draws procedural geometry on the GPU.
DrawProceduralIndirectDraws procedural geometry on the GPU.
DrawProceduralIndirectNowDraws procedural geometry on the GPU.
DrawProceduralNowDraws procedural geometry on the GPU.
DrawTextureDraw a texture in screen coordinates.
ExecuteCommandBufferExecute a command buffer.
ExecuteCommandBufferAsyncExecutes a command buffer on an async compute queue with the queue selected based on the ComputeQueueType parameter passed.
RenderMeshRenders a mesh with given rendering parameters.
RenderMeshIndirectRenders multiple instances of a mesh using GPU instancing and rendering command arguments from commandBuffer.
RenderMeshInstancedRenders multiple instances of a mesh using GPU instancing.
RenderMeshPrimitivesRenders multiple instances of a Mesh using GPU instancing and a custom shader.
RenderPrimitivesRenders non-indexed primitives with GPU instancing and a custom shader.
RenderPrimitivesIndexedRenders indexed primitives with GPU instancing and a custom shader.
RenderPrimitivesIndexedIndirectRenders indexed primitives with GPU instancing and a custom shader with rendering command arguments from commandBuffer.
RenderPrimitivesIndirectRenders primitives with GPU instancing and a custom shader using rendering command arguments from commandBuffer.
SetRandomWriteTargetSet random write target for Shader Model 4.5 level pixel shaders.
SetRenderTargetSets current render target.
WaitOnAsyncGraphicsFenceInstructs the GPU to pause processing of the queue until it passes through the GraphicsFence fence.