Graphics API hardware profile settings
Choose which Graphics API the application needs to run on for specified devices.
Read time 1 minuteLast updated 13 days ago
Use graphics API settings to control whether matching devices run your application with Vulkan, OpenGL ES, or the project default.
Configure these settings in a hardware profile to override Unity’s default API selection for specific devices or groups of devices.
Choose your preferred Graphics API
Use the following properties to make a device use a specific or general graphics API to support your application:
Value | Description |
|---|---|
| Default | Use the application’s default graphics API. |
| UseVulkan | Force a device to use Vulkan graphics API. |
| UseOpenGles | Force a device to use OpenGL ES graphics API. |
Create a device filter and edit that device’s graphics API
In the following example, the code forces Google Pixel 6 phones to fallback on OpenGL ES, while other devices use Vulkan:
public class DefineProfilesScript : AndroidHardwareProfiles{ public override void DefineHardwareProfile(ProfileDatabase database) { DefaultDeviceFilter myDefault = database.GetDefaultFilter(); myDefault.SetGraphicsAPI(GraphicsAPI.UseVulkan); //Filter for Google Pixel 6 devices var pixel6 = database.CreateFilter( "", "", "((G|g)oogle)", "(oriole|raven|bluejay)"); pixel6.SetGraphicsAPI(GraphicsAPI.UseOpenGles); }}