Create OpenGL fragment and vertex shaders
Qt supports integration with OpenGL 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 shaders:
- Select File > New File > GLSL.
- Select the type of the shader to create, and then select Choose.
- Follow the instructions of the wizard to create the shader file.
- Open the shader file in the code editor, and write the shader code in GLSL or GLSL/ES. The code editor offers syntax highlighting and code completion for the files.
See also Create files and Use project wizards.