Qt 5 on Windows ANGLE and OpenGL: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
(Add to category 3D)
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
===tl;dr;===
{{LangSwitch}}
[[Category:3D]]
=== tl;dr; ===
Qt 5 on Windows can be configured to use either OpenGL drivers, or DirectX drivers through the ANGLE library. What you want depends on your use case. The Qt project offers binary installers for both variants.


Qt 5 on Windows can be configured to use either OpenGL drivers, or DirectX drivers through the <span class="caps">ANGLE</span> library. What you want depends on your use case. The Qt project offers binary installers for both variants.
=== OpenGL ===


===OpenGL===
OpenGL (Open Graphics Library) is a wide spread industry [http://www.opengl.org/ standard] for rendering 2D and 3D computer graphics. It's the de-facto standard for hardware-accelerated graphics operations on Mac OS X, Linux, and most embedded platforms.
 
OpenGL (Open Graphics Library) is a wide spread industry [http://www.opengl.org/ standard] ''[opengl.org]'' for rendering 2D and 3D computer graphics. It’s the de-facto standard for hardware-accelerated graphics operations on Mac OS X, Linux, and most embedded platforms.


OpenGL ES 2.0 (Open Graphics Library for Embedded Systems) is a stripped-down version of OpenGL for use on embedded systems, which is missing some functions.
OpenGL ES 2.0 (Open Graphics Library for Embedded Systems) is a stripped-down version of OpenGL for use on embedded systems, which is missing some functions.


The Qt Quick 2 stack in Qt 5 is based on OpenGL, and requires OpenGL 3.0 (alternatively OpenGL 2.x with the framebuffer_object extension) or higher or OpenGL ES 2.0. The [http://doc.qt.io/qt-5.0/qtopengl/qtopengl-index.html Qt OpenGL module] ''[qt.io]'' requires OpenGL 1.3 or later.
The Qt Quick 2 stack in Qt 5 is based on OpenGL, and requires OpenGL 3.0 (alternatively OpenGL 2.x with the framebuffer_object extension) or higher or OpenGL ES 2.0. The [http://doc.qt.io/qt-5/examples-widgets-opengl.html Qt OpenGL module] requires OpenGL 1.3 or later.


===OpenGL on Windows===
=== OpenGL on Windows ===


Although Microsoft Windows has native support for OpenGL since quite some time, the supported standard version (version 1 without any drivers installed) is too limited for Qt . Newer versions are generally available through custom graphics drivers, but require users to install them. Also, the quality of the OpenGL support by some drivers is lacking.
Although Microsoft Windows has native support for OpenGL since quite some time, the supported standard version (version 1 without any drivers installed) is too limited for Qt . Newer versions are generally available through custom graphics drivers, but require users to install them. Also, the quality of the OpenGL support by some drivers is lacking.


===<span class="caps">ANGLE</span> Project===
=== ANGLE Project ===
 
<span class="caps">ANGLE</span> (Almost Native Graphics Layer Engine) is an [http://code.google.com/p/angleproject/ open source project] ''[code.google.com]'' by Google. Its aim is to map OpenGL ES 2.0 <span class="caps">API</span> calls to DirectX 9 <span class="caps">API</span>. A regularly updated version of it is [https://qt.gitorious.org/qt/qtbase/trees/stable/src/3rdparty/angle part of qtbase] ''[qt.gitorious.org]'' .


To compile Qt with <span class="caps">ANGLE</span> you have to have a [http://msdn.microsoft.com/en-us/directx/default.aspx Direct X <span class="caps">SDK</span>] ''[msdn.microsoft.com]'' installed. Starting from Windows Kit 8, this is included in the Windows <span class="caps">SDK</span>.
ANGLE (Almost Native Graphics Layer Engine) is an [http://code.google.com/p/angleproject/ open source project] by Google. Its aim is to map OpenGL ES 2.0 API calls to DirectX 9 API. A regularly updated version of it is [http://code.qt.io/cgit/qt/qtbase.git/tree/src/3rdparty/angle part of qtbase] .


If <span class="caps">ANGLE</span> is used in your application, you should normally ship d3dcompiler_XX.dll along with the Qt libraries, although on recent Windows versions it comes with the operating system. <span class="caps">ANGLE</span> will automatically try to load the newest version it can find, or you can override loading by setting the environment variable '''QT_D3DCOMPILER_DLL''' to the name of the compiler <span class="caps">DLL</span> you want to use (e.g. “d3dcompiler_47.dll”).
To compile Qt with ANGLE you have to have a [http://msdn.microsoft.com/en-us/directx/default.aspx Direct X SDK] installed. Starting from Windows Kit 8, this is included in the Windows SDK.


Additionally, <span class="caps">ANGLE</span> supports multiple renderers or “platforms” based on the Direct3D version used. Qt, by default, lets <span class="caps">ANGLE</span> choose the best platform supported by the machine. If you experience problems, you can override this with the '''QT_ANGLE_PLATFORM''' environment variable. Supported values are:
If ANGLE is used in your application, you should normally ship d3dcompiler_XX.dll along with the Qt libraries, although on recent Windows versions it comes with the operating system. ANGLE will automatically try to load the newest version it can find, or you can override loading by setting the environment variable '''QT_D3DCOMPILER_DLL''' to the name of the compiler DLL you want to use (e.g. "d3dcompiler_47.dll").


Additionally, ANGLE supports multiple renderers or "platforms" based on the Direct3D version used. Qt, by default, lets ANGLE choose the best platform supported by the machine. If you experience problems, you can override this with the '''QT_ANGLE_PLATFORM''' environment variable. Supported values are:
* '''d3d11''': Use Direct3D 11
* '''d3d11''': Use Direct3D 11
* '''d3d9''': Use Direct3D 9
* '''d3d9''': Use Direct3D 9
* '''warp''': Use the [http://msdn.microsoft.com/en-us/library/windows/desktop/gg615082.aspx Direct3D 11 software rasterizer] ''[msdn.microsoft.com]''
* '''warp''': Use the [http://msdn.microsoft.com/en-us/library/windows/desktop/gg615082.aspx Direct3D 11 software rasterizer]


===Recommendations===
=== Recommendations ===


* Use Desktop OpenGL if
* Use Desktop OpenGL if
** Your application uses OpenGL calls not part of OpenGL ES 2.0
** Your application uses OpenGL calls not part of OpenGL ES 2.0
** Your application does not use OpenGL at all (since <span class="caps">ANGLE</span> implies additional deployment dependencies which are then not needed).
** Your application does not use OpenGL at all (since ANGLE implies additional deployment dependencies which are then not needed).
** Your application needs to run on Windows XP. Although it is tempting to use <span class="caps">ANGLE</span> as a replacement for missing graphics drivers on this platform, it does not fully work and may lead to crashes, for example, when the security dialog is opened.
** Your application needs to run on Windows XP. Although it is tempting to use ANGLE as a replacement for missing graphics drivers on this platform, it does not fully work and may lead to crashes, for example, when the security dialog is opened.


* Use <span class="caps">ANGLE</span> if
* Use ANGLE if
** You need OpenGL ES features, but not full OpenGL
** You need OpenGL ES features, but not full OpenGL
** You have a heterogeneous user base with different Windows versions &amp; graphics cards
** You have a heterogeneous user base with different Windows versions & graphics cards
** You do not want your user to have to install a recent graphics card driver
** You do not want your user to have to install a recent graphics card driver
** You want to use the video playback functionality of QtMultimedia (see [https://bugreports.qt.io/browse/QTBUG-31800 <span class="caps">QTBUG</span>-31800] ''[bugreports.qt.io]'' )
** You want to use the video playback functionality of QtMultimedia (see [https://bugreports.qt.io/browse/QTBUG-31800 QTBUG-31800] )
** Your application needs to run over Windows Remote Desktop Protocol (see [http://social.technet.microsoft.com/Forums/windowsserver/en-US/c8295ef8-3711-4576-9293-2c4965280165/opengl-and-remote-desktop OpenGL and Remote Desktop] ''[social.technet.microsoft.com]'')
** Your application needs to run over Windows Remote Desktop Protocol (see [http://social.technet.microsoft.com/Forums/windowsserver/en-US/c8295ef8-3711-4576-9293-2c4965280165/opengl-and-remote-desktop OpenGL and Remote Desktop])


===Further Reading===
=== Further Reading ===


http://doc.qt.io/qt-5.1/qtdoc/windows-requirements.html<br />http://doc.qt.io/qt-5.1/qtopengl/qtopengl-index.html<br />http://blog.qt.io/blog/2012/10/24/graphics-on-windows-from-a-different-angle/<br />http://blogs.msdn.com/b/chuckw/archive/2012/05/07/hlsl-fxc-and-d3dcompile.aspx
http://doc.qt.io/qt-5/windows-requirements.html <br>
http://doc.qt.io/qt-5/qtopengl-index.html <br>
http://blog.qt.io/blog/2012/10/24/graphics-on-windows-from-a-different-angle/

Latest revision as of 15:43, 23 November 2016

En Ar Bg De El Es Fa Fi Fr Hi Hu It Ja Kn Ko Ms Nl Pl Pt Ru Sq Th Tr Uk Zh

tl;dr;

Qt 5 on Windows can be configured to use either OpenGL drivers, or DirectX drivers through the ANGLE library. What you want depends on your use case. The Qt project offers binary installers for both variants.

OpenGL

OpenGL (Open Graphics Library) is a wide spread industry standard for rendering 2D and 3D computer graphics. It's the de-facto standard for hardware-accelerated graphics operations on Mac OS X, Linux, and most embedded platforms.

OpenGL ES 2.0 (Open Graphics Library for Embedded Systems) is a stripped-down version of OpenGL for use on embedded systems, which is missing some functions.

The Qt Quick 2 stack in Qt 5 is based on OpenGL, and requires OpenGL 3.0 (alternatively OpenGL 2.x with the framebuffer_object extension) or higher or OpenGL ES 2.0. The Qt OpenGL module requires OpenGL 1.3 or later.

OpenGL on Windows

Although Microsoft Windows has native support for OpenGL since quite some time, the supported standard version (version 1 without any drivers installed) is too limited for Qt . Newer versions are generally available through custom graphics drivers, but require users to install them. Also, the quality of the OpenGL support by some drivers is lacking.

ANGLE Project

ANGLE (Almost Native Graphics Layer Engine) is an open source project by Google. Its aim is to map OpenGL ES 2.0 API calls to DirectX 9 API. A regularly updated version of it is part of qtbase .

To compile Qt with ANGLE you have to have a Direct X SDK installed. Starting from Windows Kit 8, this is included in the Windows SDK.

If ANGLE is used in your application, you should normally ship d3dcompiler_XX.dll along with the Qt libraries, although on recent Windows versions it comes with the operating system. ANGLE will automatically try to load the newest version it can find, or you can override loading by setting the environment variable QT_D3DCOMPILER_DLL to the name of the compiler DLL you want to use (e.g. "d3dcompiler_47.dll").

Additionally, ANGLE supports multiple renderers or "platforms" based on the Direct3D version used. Qt, by default, lets ANGLE choose the best platform supported by the machine. If you experience problems, you can override this with the QT_ANGLE_PLATFORM environment variable. Supported values are:

Recommendations

  • Use Desktop OpenGL if
    • Your application uses OpenGL calls not part of OpenGL ES 2.0
    • Your application does not use OpenGL at all (since ANGLE implies additional deployment dependencies which are then not needed).
    • Your application needs to run on Windows XP. Although it is tempting to use ANGLE as a replacement for missing graphics drivers on this platform, it does not fully work and may lead to crashes, for example, when the security dialog is opened.
  • Use ANGLE if
    • You need OpenGL ES features, but not full OpenGL
    • You have a heterogeneous user base with different Windows versions & graphics cards
    • You do not want your user to have to install a recent graphics card driver
    • You want to use the video playback functionality of QtMultimedia (see QTBUG-31800 )
    • Your application needs to run over Windows Remote Desktop Protocol (see OpenGL and Remote Desktop)

Further Reading

http://doc.qt.io/qt-5/windows-requirements.html
http://doc.qt.io/qt-5/qtopengl-index.html
http://blog.qt.io/blog/2012/10/24/graphics-on-windows-from-a-different-angle/