- Qt Creator Documentation
- Create OpenGL and Vulkan shaders
- Qt Creator 20.0.0

Create C++ classes ◦ Create resource files

# Create OpenGL and Vulkan shaders

Qt supports integration with OpenGL and Vulkan implementations on all platforms, so you can display hardware accelerated 3D graphics alongside a more conventional user interface. For more information, see Qt GUI.

You can use the QOpenGLShader class to compile OpenGL shaders written in the OpenGL Shading Language (GLSL) and in the OpenGL/ES Shading Language (GLSL/ES). QOpenGLShader and QOpenGLShaderProgram shelter you from the details of compiling and linking vertex and fragment shaders.

To create OpenGL or Vulkan shaders:

1. Select File > New File > GLSL.

2. Select the type of the shader to create, and then select Choose.
3. Follow the instructions of the wizard to create the shader file.
4. Open the shader file in the code editor, and write the shader code in GLSL, GLSL/ES, or Vulkan-compatible GLSL. The code editor offers syntax highlighting and code completion for the files.

See also Adding files and Use project wizards.