Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-9718

shader created by EffectMaker does not attached after export CMake

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • QDS 4.1
    • QDS 4.0.1
    • Effect Composer
    • None
    • 94ab3edb3 (qds/dev)
    • QDS Berlin - 2023 Week 17/18

    Description

      reproduce steps:
      1. create an empty QML project
      2. create an effect using EffectMaker
      3. attach the created effect to any QML item
      4. run and confirm effect works on QDS
      5. export CMake
      6. run the exported CMake project in QC
      7. got the error

      Failed to find shader ":/Effects/Effect01/effect01.vert.qsb"
      ShaderEffect: Failed to deserialize QShader from :/Effects/Effect01/effect01.vert.qsb. Either the filename is incorrect, or it is not a valid .qsb file. In Qt 6 shaders must be preprocessed using the Qt Shader Tools infrastructure. The vertexShader and fragmentShader properties are now URLs that are expected to point to .qsb files generated by the qsb tool. See https://doc.qt.io/qt-6/qtshadertools-index.html for more information.
      ShaderEffect: shader preparation failed for qrc:/Effects/Effect01/effect01.vert.qsb
      
      Failed to find shader ":/Effects/Effect01/effect01.frag.qsb"
      ShaderEffect: Failed to deserialize QShader from :/Effects/Effect01/effect01.frag.qsb. Either the filename is incorrect, or it is not a valid .qsb file. In Qt 6 shaders must be preprocessed using the Qt Shader Tools infrastructure. The vertexShader and fragmentShader properties are now URLs that are expected to point to .qsb files generated by the qsb tool. See https://doc.qt.io/qt-6/qtshadertools-index.html for more information.
      ShaderEffect: shader preparation failed for qrc:/Effects/Effect01/effect01.frag.qsb
      

      identified the error caused CMake exporter does not add the binary shader as the resource. can be fixed by following

      qt6_add_qml_module(Effects_Effect01
          URI "Effects.Effect01"
          VERSION 1.0
          QML_FILES
              Effect01.qml
          RESOURCES
              fog.png
              effect01.vert.qsb
              effect01.frag.qsb
      )
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            jiu shanheng jiu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes