sincerely
Singaporean
If you have not done so, read this full tutorial on how to use SGEXTN to build an application.
This tutorial is about compiling shaders and including compiled shaders in the built application. For information about how to write shaders, see this tutorial instead.
GLSL vertex and fragment shaders must be built using QSB, the Qt Shader Binary compiler, before they can be used with QRhi which is used by SGEXTN's SG - RI ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ module.
Note that although you only write the shaders in GLSL, they are automatically translated to other shader languages by Qt for best performance across a wide range of hardware.
Firstly, make sure you have QSB installed. You can check by opening the Qt Maintenance Tool and looking for "Qt Shader Tools" under "Additional Libraries" of your Qt version. If you do not have it installed yet, you need to install it.
After that, you just have to put the shaders inside the shaders folder and BuildLah ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ will do the rest. For more information pls see this link.
If you are not using BuildLah ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾, you can use the CMake command qt6_add_shaders to add shaders also, but that is more complicated and you will have to specify each file manually.
©2025 05524F.sg (Singapore)