docs.unity3d.com
  • Manual
  • Scripting API
  • Changelog
  • License
Show / Hide Table of Contents
    • AddCollectorMenuAttribute
    • CameraGrab_Editor
    • CaptureCollector
    • JpegEncoder
    • JpegEncoder.Flags
    • JpegEncoder.PixelFormat
    • JpegEncoder.SubSample
    • PngEncoder
    • PngEncoder.ColorType
    • PngEncoder.PngParam
  • Unity.Simulation
    • AggregatedSample
    • AggregationEvent
    • ArrayCast
    • ArrayUtilities
    • AsyncRequest
    • AsyncRequest.ExecutionContext
    • AsyncRequest.Result
    • AsyncRequest.State
    • AsyncRequest<T>
    • BaseDataConsumer<T>
    • BaseDataConsumer<T>.Uploadable
    • BaseLogger
    • BatchReadback
    • CameraGrab
    • CaptureCamera
    • CaptureCamera.CaptureState
    • CaptureCamera.Channel
    • CaptureCamera.ReadbackCompletionDelegate
    • CaptureCamera.RequestCompletionDelegate
    • CaptureGPUBuffer
    • CaptureImageEncoder
    • CaptureImageEncoder.ImageFormat
    • CaptureOptions
    • CaptureRenderTexture
    • Category
    • ChannelGrab
    • ChunkedStream
    • CollectorBase
    • CollectorBase.ConsumeCollectorReport
    • CollectorElement
    • CollectorsBaseEditor
    • CollectorsList
    • ContentType
    • ContinuousEvents
    • ContinuousEvents.EventCollectionDelegate
    • ContinuousEvents.EventDispatchDelegate
    • CoreProfilerUtils
    • CounterEvent
    • CounterEventData
    • DXChunkedStream
    • DXFile
    • DXFormat
    • DXManager
    • DXTimeLogger
    • DataCapturePaths
    • DepthGrab
    • DirectoryNameComponent
    • Dispatcher
    • EventBase
    • ExecUtility
    • ExitPlaymode
    • ExtensionNameComponent
    • FileNameComponent
    • FileProducer
    • ForceFlip
    • Format
    • FrameCountCondition
    • FrameLimit
    • FrameNumberNameComponent
    • GeneralUtilities
    • GraphicsUtilities
    • ICondition
    • IDataProduced
    • IGlobalProfilerDataDispatcher
    • IgnoreCollectorAttribute
    • LabelNameComponent
    • LambdaJob
    • LambdaJob.DelegateType
    • Log
    • Log.Level
    • Logger
    • LoggerSuffixOption
    • Manager
    • Manager.NotificationDelegate
    • Manager.TickDelegate
    • NameComponent
    • NameGenerator
    • Options
    • PackageImportTests
    • PathUtility
    • PerfStatsManager
    • PlayerResolution
    • PlayerResolutionSettings
    • ProfilerManager
    • ProfilerProperties
    • ProfilerReport
    • ProfilerSamplingEvent
    • ReadbackRequest
    • RenderPassCallbackDelegate
    • RenderingPipelineType
    • ReportingUtils
    • SRPSupport
    • Sample
    • SampleProfilerCollector
    • ScreenCapture
    • SequenceNameComponent
    • SequencedPathName
    • SimSecondsCondition
    • SimulationProfiler
    • SimulationProfilerBase
    • SimulationProfilerEditor
    • TestUtility
    • ThreadUtility
    • TimeLimit
    • TimeLogger
    • TimeScale
    • TimeScaleEditor
    • TimeUtility
    • Timer
    • TimerSource
    • TimestampNameComponent
    • URPCallbackPass
    • URPCaptureRendererFeature
    • UnityVersion
    • WallSecondsCondition

Class GraphicsUtilities

Inheritance
object
GraphicsUtilities
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Unity.Simulation
Assembly: Unity.Simulation.Capture.dll
Syntax
public static class GraphicsUtilities

Methods

DepthFormatForDepth(int)

Get the GraphicsFormat for the input number of depth bits per pixel.

Declaration
public static GraphicsFormat DepthFormatForDepth(int depthBpp)
Parameters
Type Name Description
int depthBpp

Depth: Number of bits per pixel.

Returns
Type Description
GraphicsFormat

Graphics format for the corresponding number of depth bits per pixel.

Exceptions
Type Condition
NotSupportedException

GetBlockSize(GraphicsFormat)

Get the size of a pixel in bytes for a given format.

Declaration
public static int GetBlockSize(GraphicsFormat format)
Parameters
Type Name Description
GraphicsFormat format

Graphics format you are using.

Returns
Type Description
int

Returns the size of the pixel in bytes.

GetComponentCount(GraphicsFormat)

Get the number of components for a given format.

Declaration
public static int GetComponentCount(GraphicsFormat format)
Parameters
Type Name Description
GraphicsFormat format

Graphics format you are using.

Returns
Type Description
int

Returns the number of components.

GetPixelsSlow(RenderTexture)

Perform the readback from the provided Render texture using ReadPixels API.

Declaration
public static byte[] GetPixelsSlow(RenderTexture renderTexture)
Parameters
Type Name Description
RenderTexture renderTexture

Input source Render texture for the readback.

Returns
Type Description
byte[]

Returns a byte array of the RGB data retrieved from the readback.

Exceptions
Type Condition
NotSupportedException

SupportsAsyncReadback()

Check if the AsyncReadback is supported by the current Graphics API.

Declaration
public static bool SupportsAsyncReadback()
Returns
Type Description
bool

Returns a bool indicating if the asyncreadback is supported.

SupportsRenderTextureFormat(GraphicsFormat)

Check if the given GraphicsFormat is supported by the current platform.

Declaration
public static bool SupportsRenderTextureFormat(GraphicsFormat format)
Parameters
Type Name Description
GraphicsFormat format

Input Graphics format.

Returns
Type Description
bool

Boolean indicating if the graphics format is supported.

In This Article
Back to top
Copyright © 2026 Unity Technologies — Trademarks and terms of use
  • Legal
  • Privacy Policy
  • Cookie Policy
  • Do Not Sell or Share My Personal Information