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.
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. |
In the following example, the code forces Google PixelThe 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 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);
}
}