Important: Please read the Qt Code of Conduct -

quick 3d shader and custom geometry

  • [this topic is also post at QML and Qt Quick subcategory:]

    Hi, I am using custom shaders and custom geometry in Quick3d of Qt6. I now have 2 questions:

    1. How to pass a VARYING variable of int type from vertex shader to fragment shader. I need it to be "flat", which is not interpolated.
      When I using int type as the above image, I have this shader compiling errors:
      I have also tried to add "flat" or "flat in" to the declaration of the "VARYING int patten" and I just couldn't get it right. Can you please give a example of how to use a "VARYING variable" of int type?

    2.When I use custom geometry, it seems that I can add custom Semantic to the vertex data, is this right? While I can use "VERTEX" in vertex shader to access the PositionSemantic vetex data, if I can add custom Semantic, then how can I access the custom Semantic data in vertex shader?
    If we can't add custom Semantic now, will it be possible to do so in the future version of Qt6?


Log in to reply