Vytváření shaderů pro OpenGL a Vulkan
Qt podporuje integraci s implementacemi OpenGL a Vulkan na všech platformách, takže můžete zobrazovat hardwarově akcelerovanou 3D grafiku společně s konvenčnějším uživatelským rozhraním. Další informace najdete v Qt GUI.
Třídu QOpenGLShader můžete použít ke kompilaci shaderů OpenGL napsaných v jazyce OpenGL Shading Language (GLSL) a v jazyce OpenGL/ES Shading Language (GLSL/ES). Třídy QOpenGLShader a QOpenGLShaderProgram vás zbavují nutnosti zabývat se detaily kompilace a propojování vertexových a fragmentových shaderů.
Chcete-li vytvořit shadery OpenGL nebo Vulkan:
- Vyberte „ File “ > „ New File “ > „ GLSL “.

- Vyberte typ stínovače, který chcete vytvořit, a poté vyberte možnost „ Choose “.
- Postupujte podle pokynů průvodce a vytvořte soubor shaderu.
- Otevřete soubor shaderu v editoru kódu a napište kód shaderu v jazyce GLSL, GLSL/ES nebo GLSL kompatibilním s Vulkanem. Editor kódu nabízí pro tyto soubory zvýraznění syntaxe a doplňování kódu.
Viz také Přidávání souborů a Použití průvodců projektem.
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.