Version: 2018.2 (switch to 2018.1 or 2017.4)
Level of Detail (LOD)
OpenGL Core Details
Other Versions

DirectX 11 and OpenGL Core

Unity supports DirectX 11 (DX11) and OpenGL CoreThe back-end Unity uses to support the latest OpenGL features on Windows, MacOS X and Linux. More info
See in Glossary
graphics APIs. This page details how to use them.

Enabling DirectX 11

DirectX 11 is enabled by default on Windows. Your games and the Unity Editor use DX11, and fall back to DX9 when DX11 is not available.

To enable or disable DirectX 11 for your game builds and the Editor, go to Edit > Project SettingsA broad collection of settings which allow you to configure how Physics, Audio, Networking, Graphics, Input and many other areas of your project behave. More info
See in Glossary
> Player to open the Player SettingsA settings manager that lets you set various player-specific options for the final game built by Unity. More info
See in Glossary
. Navigate to Other Settings and un-check Auto Graphics API for Windows. In the panel that appears, select Direct3D11 and click the minus (-) button to remove it, or click the plus (+) button and choose Direct3D11 from the list to add it.

Adding Direct3D11 to the Graphics APIs for Windows list
Adding Direct3D11 to the Graphics APIs for Windows list

When you have added Direct3D11 to the list, you can change the priority it has over other graphics APIs. To do this, click and drag the list item up and down using your mouse. The Unity Editor and Player uses the item at the top of the list as the default. The Editor and Player use the others in the list as a fallback, in list order.

NOTE: DX11 requires Windows Vista or later, and at least a DX10-level GPU (preferably DX11-level). The Unity Editor window title has <DX11> at the end when it is running in DX11 mode.

Enabling Metal

Metal is enabled by default on Mac when you use the supported Mac OS X release. Unsupported releases use OpenGL Core. Metal for Mac first appeared in Mac OS X 10.11.0, however early versions had some issues. Therefore, make sure you disable Metal support for these versions. To ensure you do not face issues, update to the latest OS possible:

  • Mac OS X 10.11.6 (last release for Mac OS X 10.11 El Capitan)
  • Mac OS X 10.12 or later (improved compute and tessellation support)

Enabling OpenGL Core

OpenGL Core is enabled by default on Mac and Linux. Your games and the Unity Editor use OpenGL Core on these platforms.

To enable OpenGL Core on Windows and make it the default, go to Edit > Project Settings > Player to open the Player Settings. Navigate to Other Settings and un-check Auto Graphics API for Windows. In the panel that appears, click the plus (+) button and choose OpenGLCore from the list to add it.

Adding OpenGLCore to the Graphics APIs for Windows list
Adding OpenGLCore to the Graphics APIs for Windows list

OpenGL Core has the following minimum requirements:

  • Mac OS X 10.8 (OpenGL 3.2), MacOSX 10.9 (OpenGL 3.2 to 4.1)
  • Windows with NVIDIA since 2006 (GeForce 8), AMD since 2006 (Radeon HD 2000), Intel since 2012 (HD 4000 / IvyBridge) (OpenGL 3.2 to OpenGL 4.5)
  • Linux (OpenGL 3.2 to OpenGL 4.5)

Compute Shaders

Compute ShadersA small script that contains the mathematical calculations and algorithms for calculating the Color of each pixel rendered, based on the lighting input and the Material configuration. More info
See in Glossary
allow you to use the GPU as a parallel processor. See documentation on Compute Shaders for more information.

Tessellation & Geometry Shaders

Surface Shaders have support for simple tessellation and displacement. See documentation on Surface Shader Tessellation for more information.

When you manually write a Shader program, you can use the full set of DX11 Shader model 5.0 features- including Geometry, Hull and Domain Shaders.

Surface Shaders and DX11

Some parts of the Surface ShaderUnity’s code generation approach that makes it much easier to write lit shaders than using low level vertex/pixel shader programs. More info
See in Glossary
compilation pipeline do not understand DX11-specific HLSL syntax, so if you’re using HLSL features like StructuredBuffers, RWTextures and other non-DX9 syntax, you need to wrap it into a DX11-only preprocessor macro. See documentation on Platform-specific differences for more information.

Examples

The following screenshots show examples of what you can achieve with DirectX 11 and OpenGL Core.

The volumetric explosion in the above shots is rendered using raymarching, which becomes plausible with Shader Model 5.0. Moreover, as it generates and updates depth values, it becomes fully compatible with depth-based Image Effects such as Depth of Field or Motion BlurA common post-processing effect that simulates the blurring of an image when objects filmed by a camera are moving faster than the camera’s exposure time. More info
See in Glossary
.

The hair in the above shot is implemented via tessellation and geometry Shaders to dynamically generate and animate individual strands of hair. Shading is based on a model proposed by Kajiya-Kai that enables a more believable diffuse and specular behaviour.

Similar to the hair technique shown in the previous image, the fur on this pair of slippers is also based on generating geometry emitted from a simple base slippers MeshThe main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info
See in Glossary
.

The blur effect in the image above (known as Bokeh) is based on stamping a Texture on top of very bright pixelsThe smallest unit in a computer image. Pixel size depends on your screen resolution. Pixel lighting is calculated at every screen pixel. More info
See in Glossary
. This creates very believable cameraA component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
See in Glossary
lens blurs, especially when used in conjunction with HDRhigh dymanic range
See in Glossary
renderingThe process of drawing graphics to the screen (or to a render texture). By default, the main camera in Unity renders its view to the screen. More info
See in Glossary
.

This image shows an exaggerated lens blur. This is a possible result of using the Depth of FieldA post-processing effect that simulates the focus properties of a camera lens. More info
See in Glossary
effect.


Did you find this page useful? Please give it a rating:

Level of Detail (LOD)
OpenGL Core Details