[Interest] Is it possible to compile a shader in runtime using qsb?

Laszlo Agocs laszlo.agocs at qt.io
Wed May 8 17:42:00 CEST 2024


Hi,

>From Qt 6.6 on you can pull in the Qt Shader Tools module into the project and try using https://doc.qt.io/qt-6/qshaderbaker.html

If this is actually suitable for your use case, cannot say without more details, because doing the heavyweight compilation and transpilation at runtime is one thing, being able to do something with the resulting QShader object is another.

For instance, when working with custom scenegraph materials, a QShader can be used instead of .qsb filenames via https://doc.qt.io/qt-6/qsgmaterialshader.html#setShader
If however the intention would be to do something similar in a ShaderEffect declared in QML, there is no API to achieve that since its vertexShader and fragmentShader properties only consume (.qsb) file URLs.

Best regards,
Laszlo

________________________________
From: Interest <interest-bounces at qt-project.org> on behalf of Nuno Santos via Interest <interest at qt-project.org>
Sent: Tuesday, May 7, 2024 11:28 AM
To: interestqt-project. org <interest at qt-project.org>
Subject: [Interest] Is it possible to compile a shader in runtime using qsb?

Hi,

I’m wondering if it is possible to run qsb to compile a shader in run time on iOS.

I’m using QProcess to call qbs in order to compile in run time but since QProcess does not exist on iOS, I wonder how can I achieve the same result?

Thanks!

Regards,

Nuno
_______________________________________________
Interest mailing list
Interest at qt-project.org
https://lists.qt-project.org/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240508/d4d6f2e8/attachment-0001.htm>


More information about the Interest mailing list