OpenGL Core 是可支持 Windows、MacOS X 和 Linux 平台最新 OpenGL 功能的后端。这包括从 OpenGL 3.2 到 OpenGL 4.5,具体取决于 OpenGL 驱动程序支持情况。
要将 OpenGL Core 设置为 Editor 或独立平台播放器中的默认图形 API,请选择 Player 设置(菜单:__Edit > Project Settings__,然后选择 Player 类别),并导航到 Other Settings。禁用 Auto Graphics API for Windows 属性,并从列表中选择 OpenGLCore。有关更多详细信息,请参阅[图形 API 支持](Graphics APIs)。
OpenGL Core 的最低要求如下:
Mac OS X 10.8 (OpenGL 3.2)、MacOSX 10.9(OpenGL 3.2 到 4.1)
Windows 搭载 NVIDIA 最低 2006 (GeForce 8)、AMD 最低 2006 (Radeon HD 2000)、Intel 最低 2012 (HD 4000 / IvyBridge)(OpenGL 3.2 到 OpenGL 4.5)
Linux(OpenGL 3.2 到 OpenGL 4.5)
用于 Editor 和独立平台的 macOS OpenGL 后端支持 OpenGL 3.x 和 4.x 功能,如曲面细分和几何着色器。
但是,由于 Apple 将 OS X 桌面上的 OpenGL 版本限制为最高 4.1,因此并不支持所有 DirectX 11 功能(例如无序访问视图或计算着色器)。这意味着,以着色器级别 5.0 为目标(包含 #pragma 目标 50)的所有着色器将无法在 OS X 上加载。
因此引入了新的着色器目标级别:#pragma 目标 gl4.1。此目标级别至少需要 OpenGL 4.1 或 DirectX 11.0 着色器级别 5(桌面端)或 OpenGL ES 3.1 + Android 扩展包(移动端)。
新的 OpenGL 后端引入了许多新功能(以前主要是 DX11/GLES3):
使用现有 #pragma 目标时,它们会映射到以下 GL 级别:
要让着色器平台使用或不使用特定着色器,可使用以下 #pragma only_renderers / exclude_renderers 目标:
可使用命令行参数通过 OpenGL 启动 Editor 或播放器:
OpenGL ES 图形 API 适用于配备了 Intel 或 NVIDIA GPU 且驱动程序支持 OpenGL ES 的 Windows 机器。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.