Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetGraphicsFormat(DefaultFormat)

Returns the platform-specific GraphicsFormat that is associated with the DefaultFormat.
Read time 1 minuteLast updated 5 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static GraphicsFormat GetGraphicsFormat(DefaultFormat format)

Parameters

The DefaultFormat format to look up.

Returns

Type

Description

GraphicsFormat

Remarks

You can create a RenderTexture with DefaultFormat.DepthStencil by setting the resulting GraphicsFormat to RenderTexture.depthStencilFormat, RenderTextureDescriptor.depthStencilFormat or by using one of the constructors.
To create a RenderTexture that you can use as a shadow map, set the ShadowSamplingMode using RenderTextureDescriptor.shadowSamplingMode. If you only set the depth or stencil format and not the ShadowSamplingMode then you will not have a valid shadow map.
Additional Resources: GraphicsFormat enum and DefaultFormat.