├── .cmake.conf ├── .gitreview ├── .tag ├── CMakeLists.txt ├── LICENSES ├── BSD-3-Clause.txt ├── GFDL-1.3-no-invariants-only.txt ├── GPL-3.0-only.txt ├── LicenseRef-Qt-Commercial.txt └── OFL-1.1.txt ├── REUSE.toml ├── coin └── module_config.yaml ├── dependencies.yaml ├── examples ├── CMakeLists.txt ├── examples.pro └── quickeffectmaker │ ├── CMakeLists.txt │ ├── quickeffectmaker.pro │ └── wiggly │ ├── CMakeLists.txt │ ├── WigglyEffect │ ├── WigglyEffect.qep │ ├── WigglyEffect.qml │ ├── wigglyeffect.frag.qsb │ └── wigglyeffect.vert.qsb │ ├── doc │ ├── images │ │ ├── wiggly-example.png │ │ ├── wiggly-ledscreen.png │ │ ├── wiggly-qqem.png │ │ ├── wiggly-settings.png │ │ └── wiggly-sourceitem.png │ └── src │ │ └── wiggly.qdoc │ ├── injekuta_bl.otf │ ├── main.cpp │ ├── main.qml │ ├── qml.qrc │ └── wiggly.pro ├── licenseRule.json ├── nodes ├── CMakeLists.txt ├── basic │ ├── brightness_contrast.qen │ ├── colorize.qen │ ├── coloroverlay.qen │ ├── desaturate.qen │ ├── displace.qen │ ├── dropshadow.qen │ ├── fastblur.qen │ ├── gamma_adjust.qen │ ├── glow.qen │ ├── innershadow.qen │ ├── leveladjust.qen │ ├── mipmapblur.qen │ ├── mipmapdropshadow.qen │ ├── multieffect.qen │ ├── noise.qen │ ├── opacitymask.qen │ ├── thresholdmask.qen │ └── vignette.qen ├── common │ ├── 0_custom.qen │ ├── BlurHelper.qml │ ├── blurhelper.qen │ ├── bluritems.frag │ ├── bluritems.frag.qsb │ ├── bluritems.vert │ ├── bluritems.vert.qsb │ ├── mathhelper.qen │ └── noisehelper.qen ├── extra │ ├── bars.qen │ ├── bend.qen │ ├── circlebend.qen │ ├── colorlut.qen │ ├── ledscreen.qen │ ├── maskedblur.qen │ ├── normalmapping.qen │ ├── rectangularshadow.qen │ ├── spriteanimation.qen │ ├── sunburst.qen │ └── swirl.qen ├── images │ ├── blackcircle.png │ ├── clouds.png │ ├── fog.png │ ├── fog2.png │ ├── lava.png │ ├── lut_256_apocalypse.png │ ├── lut_256_bleach.png │ ├── lut_256_bright.png │ ├── lut_256_cinematic1.png │ ├── lut_256_cinematic2.png │ ├── lut_256_cinematic3.png │ ├── lut_256_cold.png │ ├── lut_256_drama.png │ ├── lut_256_fall.png │ ├── lut_256_horror.png │ ├── lut_256_neutral.png │ ├── lut_256_old.png │ ├── lut_256_sepia.png │ ├── lut_256_summer.png │ ├── lut_256_sunset.png │ ├── lut_256_tealorange.png │ ├── lut_256_vibrant.png │ ├── lut_256_vintage1.png │ ├── lut_256_vintage2.png │ ├── lut_256_vintage3.png │ ├── lut_256_vintagebw.png │ ├── lut_256_warm.png │ ├── lut_512_apocalypse.png │ ├── lut_512_bleach.png │ ├── lut_512_bright.png │ ├── lut_512_cinematic1.png │ ├── lut_512_cinematic2.png │ ├── lut_512_cinematic3.png │ ├── lut_512_cold.png │ ├── lut_512_drama.png │ ├── lut_512_fall.png │ ├── lut_512_horror.png │ ├── lut_512_neutral.png │ ├── lut_512_old.png │ ├── lut_512_sepia.png │ ├── lut_512_summer.png │ ├── lut_512_sunset.png │ ├── lut_512_tealorange.png │ ├── lut_512_vibrant.png │ ├── lut_512_vintage1.png │ ├── lut_512_vintage2.png │ ├── lut_512_vintage3.png │ ├── lut_512_vintagebw.png │ ├── lut_512_warm.png │ ├── mask.png │ ├── mask2.png │ ├── qt-logo-sheet.png │ ├── qt_logo_green_rgb.png │ ├── qt_logo_green_rgb_n.png │ ├── quit_logo.png │ ├── quit_logo_n.png │ ├── rain.png │ ├── scratches_n.png │ └── whitecircle.png └── nature │ ├── clouds.qen │ ├── electricclouds.qen │ ├── fog.qen │ ├── lava.qen │ ├── plasma.qen │ ├── rain.qen │ ├── seareflection.qen │ ├── snowing.qen │ ├── thunder.qen │ └── water.qen ├── src ├── CMakeLists.txt └── doc │ ├── CMakeLists.txt │ ├── images │ ├── add-custom-node.webp │ ├── blur-effect-nodes.png │ ├── blur-effect-step-1.webp │ ├── blur-effect-step-2.webp │ ├── blur-effect-step-3.webp │ ├── effect-item-borders-icon.png │ ├── effect-item-padding-dialog.png │ ├── effect-maker-export.png │ ├── qqem-online-installer.webp │ ├── qqem-start.webp │ └── vert-tab.png │ ├── qtquickeffectmaker.qdocconf │ └── src │ ├── concepts │ └── qqem-concept.qdoc │ ├── getting-started │ ├── qqem-create-effect.qdoc │ └── qqem-installing.qdoc │ ├── how-tos │ ├── qqem-creating-blur-effect.qdoc │ └── qqem-porting-shadertoy.qdoc │ ├── qtquickeffectmaker.qdoc │ └── reference │ └── qqem-troubleshooting.qdoc ├── tests ├── CMakeLists.txt └── auto │ ├── CMakeLists.txt │ └── qtquickeffectmaker │ ├── CMakeLists.txt │ └── tst_qtquickeffectmaker.cpp └── tools ├── CMakeLists.txt └── qqem ├── CMakeLists.txt ├── Info_mac.plist ├── addnodemodel.cpp ├── addnodemodel.h ├── applicationsettings.cpp ├── applicationsettings.h ├── arrowsmodel.cpp ├── arrowsmodel.h ├── codecompletionmodel.cpp ├── codecompletionmodel.h ├── codehelper.cpp ├── codehelper.h ├── effectmanager.cpp ├── effectmanager.h ├── fpshelper.cpp ├── fpshelper.h ├── main.cpp ├── nodesmodel.cpp ├── nodesmodel.h ├── nodeview.cpp ├── nodeview.h ├── propertyhandler.cpp ├── propertyhandler.h ├── qml ├── AboutDialog.qml ├── AddNodeDialog.qml ├── ApplicationSettingsDialog.qml ├── ClearNodeViewDialog.qml ├── CodeEditor.qml ├── CustomDialog.qml ├── CustomIconButton.qml ├── CustomImageSelector.qml ├── CustomModeToggle.qml ├── CustomPopup.qml ├── CustomSplitView.qml ├── CustomTextEdit.qml ├── CustomTextField.qml ├── DeleteNodeDialog.qml ├── EditorView.qml ├── EffectPreview.qml ├── EffectPreviewToolbar.qml ├── ExportEffectDialog.qml ├── FindBar.qml ├── HelpView.qml ├── MainToolbar.qml ├── MainView.qml ├── NewProjectDialog.qml ├── NodeView.qml ├── OutputView.qml ├── PlaybackTimeComponent.qml ├── ProjectSettingsDialog.qml ├── PropertiesView.qml ├── PropertyEditDialog.qml ├── QsbInspectorDialog.qml ├── RenameNodeDialog.qml ├── SaveProjectDialog.qml ├── StatusBar.qml ├── about_effect │ ├── AboutEffect1.qep │ ├── AboutEffect1.qml │ ├── abouteffect1.frag.qsb │ └── abouteffect1.vert.qsb ├── fonts │ ├── REUSE.toml │ ├── SourceCodePro-Bold.ttf │ ├── SourceCodePro-It.ttf │ ├── SourceCodePro-Regular.ttf │ └── SourceCodePro.txt ├── images │ ├── background_colorful.jpg │ ├── background_dark.jpg │ ├── background_light.jpg │ ├── button_qsb.png │ ├── button_show.png │ ├── icon_add.png │ ├── icon_api.png │ ├── icon_api_on.png │ ├── icon_arrow.png │ ├── icon_arrow_down.png │ ├── icon_arrow_up.png │ ├── icon_autoplay.png │ ├── icon_autoplay_on.png │ ├── icon_borders.png │ ├── icon_borders_on.png │ ├── icon_distribute_nodes.png │ ├── icon_edit.png │ ├── icon_error.png │ ├── icon_export.png │ ├── icon_layout_nodes.png │ ├── icon_pause.png │ ├── icon_play.png │ ├── icon_remove_shadow.png │ ├── icon_requires.png │ ├── icon_reset.png │ ├── icon_restart.png │ ├── icon_settings.png │ ├── icon_settings_on.png │ ├── icon_soften.png │ ├── icon_soften_on.png │ ├── icon_viewseparator.png │ ├── icon_visibility_off.png │ ├── icon_visibility_on.png │ ├── icon_zoom_auto.png │ ├── icon_zoom_in.png │ ├── icon_zoom_out.png │ ├── item_border.png │ ├── nodeview_background.jpg │ ├── toggle_background.png │ ├── toggle_m1.png │ └── toggle_m2.png └── main.qml ├── qqem.icns ├── qqem.ico ├── qqem_help.html ├── qsbinspectorhelper.cpp ├── qsbinspectorhelper.h ├── qtquickcontrols2.conf ├── shaderfeatures.cpp ├── shaderfeatures.h ├── syntaxhighlighter.cpp ├── syntaxhighlighter.h ├── syntaxhighlighterdata.cpp ├── syntaxhighlighterdata.h ├── uniformmodel.cpp └── uniformmodel.h /.cmake.conf: -------------------------------------------------------------------------------- 1 | set(QT_REPO_MODULE_VERSION "6.10.0") 2 | set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1") 3 | set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_FOREACH=1") 4 | list(APPEND QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_NO_CONTEXTLESS_CONNECT=1") 5 | -------------------------------------------------------------------------------- /.gitreview: -------------------------------------------------------------------------------- 1 | [gerrit] 2 | host=codereview.qt-project.org 3 | project=qt/qtquickeffectmaker 4 | defaultbranch=dev 5 | -------------------------------------------------------------------------------- /.tag: -------------------------------------------------------------------------------- 1 | 3fc8d9876d03bb919579ae2ba1113d6a7afc8b09 2 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | include(FeatureSummary) 6 | 7 | include(.cmake.conf) 8 | project(QQEffectMaker 9 | VERSION "${QT_REPO_MODULE_VERSION}" 10 | DESCRIPTION "Qt Quick Effect Maker" 11 | HOMEPAGE_URL "https://qt.io/" 12 | LANGUAGES CXX C 13 | ) 14 | 15 | find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core) 16 | find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG OPTIONAL_COMPONENTS Gui Quick ShaderTools) 17 | qt_internal_project_setup() 18 | 19 | # Quick3DGlslParserPrivate is optional 20 | find_package(Qt6 ${PROJECT_VERSION} OPTIONAL_COMPONENTS Quick3DGlslParserPrivate) 21 | set_package_properties(Qt6Quick3DGlslParserPrivate PROPERTIES 22 | TYPE OPTIONAL 23 | PURPOSE "- Enables Syntax Highlighting" 24 | ) 25 | 26 | if(NOT TARGET Qt::Quick) 27 | message(NOTICE "Skipping the build as the condition \"TARGET Qt::Quick\" is not met.") 28 | return() 29 | endif() 30 | 31 | if(NOT TARGET Qt::ShaderTools) 32 | message(NOTICE "Skipping the build as the condition \"TARGET Qt::ShaderTools\" is not met.") 33 | return() 34 | endif() 35 | 36 | if(INTEGRITY OR QNX OR VXWORKS OR WATCHOS) 37 | message(NOTICE "Skipping the build as the condition \"NOT INTEGRITY AND NOT QNX AND NOT VXWORKS AND NOT WATCHOS\" is not met.") 38 | return() 39 | endif() 40 | 41 | # Note: Temporarily build only for Windows and macOS 42 | #if(NOT WIN32 AND NOT MACOS) 43 | # message(NOTICE "Skipping the build as the condition \"WIN32 OR MACOS\" is not met.") 44 | # return() 45 | #endif() 46 | 47 | if(WASM) 48 | message(NOTICE "Skipping the build as the condition \"NOT WASM\" is not met.") 49 | return() 50 | endif() 51 | 52 | if(CMAKE_CROSSCOMPILING) 53 | message(NOTICE "Skipping the build as the condition \"NOT CMAKE_CROSSCOMPILING\" is not met.") 54 | return() 55 | endif() 56 | 57 | # Copy nodes content 58 | set(nodes_folders 59 | "nodes/basic" 60 | "nodes/common" 61 | "nodes/extra" 62 | "nodes/images" 63 | "nodes/nature" 64 | ) 65 | 66 | qt_build_repo() 67 | 68 | qt_path_join(nodes_path "${QT_INSTALL_DIR}" "${INSTALL_QMLDIR}/QtQuickEffectMaker/defaultnodes") 69 | message(NOTICE "Nodes path: ${nodes_path}") 70 | qt_copy_or_install(DIRECTORY ${nodes_folders} DESTINATION ${nodes_path}) 71 | -------------------------------------------------------------------------------- /LICENSES/BSD-3-Clause.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) . 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 7 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 8 | 9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 10 | -------------------------------------------------------------------------------- /LICENSES/LicenseRef-Qt-Commercial.txt: -------------------------------------------------------------------------------- 1 | Licensees holding valid commercial Qt licenses may use this software in 2 | accordance with the the terms contained in a written agreement between 3 | you and The Qt Company. Alternatively, the terms and conditions that were 4 | accepted by the licensee when buying and/or downloading the 5 | software do apply. 6 | 7 | For the latest licensing terms and conditions, see https://www.qt.io/terms-conditions. 8 | For further information use the contact form at https://www.qt.io/contact-us. 9 | -------------------------------------------------------------------------------- /REUSE.toml: -------------------------------------------------------------------------------- 1 | version = 1 2 | 3 | [[annotations]] 4 | path = ["tools/qqem/qml/images/*.png", 5 | "tools/qqem/qml/images/*.jpg", 6 | "tools/qqem/qqem.icns", 7 | "tools/qqem/qqem.ico", 8 | "tools/qqem/qqem_help.html", 9 | "tools/qqem/qtquickcontrols2.conf"] 10 | precedence = "closest" 11 | comment = "module and plugin" 12 | SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd." 13 | SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GPL-3.0-only" 14 | 15 | [[annotations]] 16 | path = ["**CMakeLists.txt", ".cmake.conf", "**.yaml", "**.plist", ".tag"] 17 | precedence = "closest" 18 | comment = "build system" 19 | SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd." 20 | SPDX-License-Identifier = "BSD-3-Clause" 21 | 22 | [[annotations]] 23 | path = ["**/.gitattributes", "**.gitignore", "**.gitreview"] 24 | precedence = "closest" 25 | comment = "version control system. Infrastructure" 26 | SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd." 27 | SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause" 28 | 29 | [[annotations]] 30 | path = ["examples/**", "tools/qqem/qml/about_effect/*"] 31 | comment = "this must be after the build system table because example and snippets take precedence over build system" 32 | precedence = "closest" 33 | SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd." 34 | SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause" 35 | 36 | [[annotations]] 37 | path = ["nodes/**"] 38 | precedence = "closest" 39 | comment = "examples and snippets" 40 | SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd." 41 | SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause" 42 | 43 | [[annotations]] 44 | path = ["**/doc/images/**", "**.qdocconf"] 45 | comment = "documentation" 46 | precedence = "closest" 47 | SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd." 48 | SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only" 49 | 50 | [[annotations]] 51 | path = ["**.toml", "licenseRule.json"] 52 | comment = "infrastructure" 53 | precedence = "override" 54 | SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd." 55 | SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR BSD-3-Clause" 56 | 57 | [[annotations]] 58 | path = ["**/qt_attribution.json"] 59 | comment = "documentation" 60 | precedence = "override" 61 | SPDX-FileCopyrightText = "Copyright (C) 2024 The Qt Company Ltd." 62 | SPDX-License-Identifier = "LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only" 63 | -------------------------------------------------------------------------------- /coin/module_config.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | accept_configuration: 3 | condition: property 4 | property: features 5 | not_contains_value: Disable 6 | 7 | instructions: 8 | Build: 9 | - type: EnvironmentVariable 10 | variableName: VERIFY_SOURCE_SBOM 11 | variableValue: "ON" 12 | - !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml" 13 | 14 | Test: 15 | - type: Group 16 | instructions: 17 | - !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml" 18 | - !include "{{qt/qtbase}}/coin_module_test_docs.yaml" 19 | disable_if: 20 | condition: or 21 | conditions: 22 | - condition: property 23 | property: target.osVersion 24 | equals_value: QEMU 25 | - condition: property 26 | property: target.os 27 | in_values: ["QNX", "IOS", "Android", "WebAssembly"] 28 | - condition: property 29 | property: configureArgs 30 | contains_value: "-cross-compiled" 31 | 32 | -------------------------------------------------------------------------------- /dependencies.yaml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | ../qtbase: 3 | ref: a867a16ef0a29f9b8b7196d0959e980ee17d7876 4 | required: true 5 | ../qtdeclarative: 6 | ref: fa4568622cc19e5a876238d6cfca2e95936f8bdd 7 | required: true 8 | ../qtquick3d: 9 | ref: 7a5f55f89c3c26f26987873a9fc00caa98dedc75 10 | required: false 11 | ../qtshadertools: 12 | ref: dffc7c23ffa3d5783f188f565b5f9a213c6d8b99 13 | required: true 14 | -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | qt_examples_build_begin(EXTERNAL_BUILD) 5 | 6 | add_subdirectory(quickeffectmaker) 7 | 8 | qt_examples_build_end() 9 | -------------------------------------------------------------------------------- /examples/examples.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS += quickeffectmaker 3 | -------------------------------------------------------------------------------- /examples/quickeffectmaker/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | qt_internal_add_example(wiggly) 5 | -------------------------------------------------------------------------------- /examples/quickeffectmaker/quickeffectmaker.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | SUBDIRS += wiggly 3 | -------------------------------------------------------------------------------- /examples/quickeffectmaker/wiggly/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2023 The Qt Company Ltd. 2 | # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | cmake_minimum_required(VERSION 3.16) 5 | project(wiggly LANGUAGES CXX) 6 | 7 | if(NOT DEFINED INSTALL_EXAMPLESDIR) 8 | set(INSTALL_EXAMPLESDIR "examples") 9 | endif() 10 | 11 | set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quickeffectmaker/${PROJECT_NAME}") 12 | 13 | find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) 14 | 15 | qt_standard_project_setup() 16 | 17 | qt_add_executable(${PROJECT_NAME} WIN32 MACOSX_BUNDLE 18 | main.cpp 19 | ) 20 | 21 | target_link_libraries(${PROJECT_NAME} PRIVATE 22 | Qt::Core 23 | Qt::Gui 24 | Qt::Qml 25 | Qt::Quick 26 | ) 27 | 28 | # Resources: 29 | qt_add_resources(qml qml.qrc) 30 | target_sources(${PROJECT_NAME} PRIVATE ${qml}) 31 | 32 | install(TARGETS ${PROJECT_NAME} 33 | RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" 34 | BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" 35 | LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" 36 | ) 37 | -------------------------------------------------------------------------------- /examples/quickeffectmaker/wiggly/WigglyEffect/WigglyEffect.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2023 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | // Created with Qt Quick Effect Maker (version 0.43), Fri Feb 17 09:45:06 2023 4 | 5 | import QtQuick 6 | 7 | Item { 8 | id: rootItem 9 | 10 | // This is the main source for the effect 11 | property Item source: null 12 | // Enable this to animate iTime property 13 | property bool timeRunning: false 14 | // When timeRunning is false, this can be used to control iTime manually 15 | property real animatedTime: frameAnimation.elapsedTime 16 | 17 | property real wigglyAmountX: 20 18 | property real wigglyAmountY: 50 19 | property real wigglyShadows: 0.5 20 | // The levels of details for the electic clouds. Bigger value means more detailed rending which also requires more processing power. The default value is 6 and practical range is between 1 and 10. 21 | property int electricCloudLevels: 6 22 | // The color used for the clouds. Alpha channel defines the amount of opacity this effect has. 23 | property color electricCloudColor: Qt.rgba(1, 1, 1, 1) 24 | 25 | FrameAnimation { 26 | id: frameAnimation 27 | running: rootItem.timeRunning 28 | } 29 | 30 | ShaderEffect { 31 | readonly property alias iSource: rootItem.source 32 | readonly property alias iTime: rootItem.animatedTime 33 | readonly property vector3d iResolution: Qt.vector3d(width, height, 1.0) 34 | readonly property alias wigglyAmountX: rootItem.wigglyAmountX 35 | readonly property alias wigglyAmountY: rootItem.wigglyAmountY 36 | readonly property alias wigglyShadows: rootItem.wigglyShadows 37 | readonly property alias electricCloudLevels: rootItem.electricCloudLevels 38 | readonly property alias electricCloudColor: rootItem.electricCloudColor 39 | 40 | vertexShader: 'wigglyeffect.vert.qsb' 41 | fragmentShader: 'wigglyeffect.frag.qsb' 42 | anchors.fill: parent 43 | mesh: GridMesh { 44 | resolution: Qt.size(63, 1) 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /examples/quickeffectmaker/wiggly/WigglyEffect/wigglyeffect.frag.qsb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/examples/quickeffectmaker/wiggly/WigglyEffect/wigglyeffect.frag.qsb -------------------------------------------------------------------------------- /examples/quickeffectmaker/wiggly/WigglyEffect/wigglyeffect.vert.qsb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/examples/quickeffectmaker/wiggly/WigglyEffect/wigglyeffect.vert.qsb -------------------------------------------------------------------------------- /examples/quickeffectmaker/wiggly/doc/images/wiggly-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/examples/quickeffectmaker/wiggly/doc/images/wiggly-example.png -------------------------------------------------------------------------------- /examples/quickeffectmaker/wiggly/doc/images/wiggly-ledscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/examples/quickeffectmaker/wiggly/doc/images/wiggly-ledscreen.png -------------------------------------------------------------------------------- /examples/quickeffectmaker/wiggly/doc/images/wiggly-qqem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/examples/quickeffectmaker/wiggly/doc/images/wiggly-qqem.png -------------------------------------------------------------------------------- /examples/quickeffectmaker/wiggly/doc/images/wiggly-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/examples/quickeffectmaker/wiggly/doc/images/wiggly-settings.png -------------------------------------------------------------------------------- /examples/quickeffectmaker/wiggly/doc/images/wiggly-sourceitem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/examples/quickeffectmaker/wiggly/doc/images/wiggly-sourceitem.png -------------------------------------------------------------------------------- /examples/quickeffectmaker/wiggly/injekuta_bl.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/examples/quickeffectmaker/wiggly/injekuta_bl.otf -------------------------------------------------------------------------------- /examples/quickeffectmaker/wiggly/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2023 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QGuiApplication app(argc, argv); 10 | 11 | QQmlApplicationEngine engine; 12 | const QUrl url(u"qrc:/wiggly/main.qml"_qs); 13 | QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, 14 | &app, [url](QObject *obj, const QUrl &objUrl) { 15 | if (!obj && url == objUrl) 16 | QCoreApplication::exit(-1); 17 | }, Qt::QueuedConnection); 18 | engine.load(url); 19 | 20 | return app.exec(); 21 | } 22 | -------------------------------------------------------------------------------- /examples/quickeffectmaker/wiggly/main.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2023 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | import QtQuick 5 | import QtQuick.Controls.Material 6 | import "WigglyEffect" 7 | 8 | Window { 9 | id: mainWindow 10 | 11 | // Helper for UI scalability. 12 | // Pixel multiplier which depends on the window size. 13 | readonly property real px: width / defaultWindowWidth 14 | readonly property real defaultWindowWidth: 1280 15 | readonly property real defaultWindowHeight: 720 16 | 17 | Material.theme: Material.Dark 18 | Material.accent: Material.Pink 19 | 20 | width: defaultWindowWidth 21 | height: defaultWindowHeight 22 | visible: true 23 | title: qsTr("Wiggly") 24 | color: "#2e2f30" 25 | 26 | // Custom font 27 | FontLoader { 28 | id: font1 29 | // "Injekuta Bl" font from: https://typodermicfonts.com 30 | // Creative Commons Zero license https://creativecommons.org/publicdomain/zero/1.0/ 31 | source: "injekuta_bl.otf" 32 | } 33 | 34 | //! [sourceitem] 35 | Rectangle { 36 | id: sourceItem 37 | anchors.centerIn: parent 38 | width: textItem.width + 60 * mainWindow.px 39 | height: textItem.height + 30 * mainWindow.px 40 | color: "#d0d0d0d0" 41 | border.color: "#d0ffffff" 42 | border.width: 4 * mainWindow.px 43 | radius: 20 * mainWindow.px 44 | layer.enabled: true 45 | layer.smooth: true 46 | visible: false 47 | Text { 48 | id: textItem 49 | anchors.centerIn: parent 50 | text: wigglyTextField.text 51 | font.family: font1.font.family 52 | font.pixelSize: Math.min(200 * mainWindow.px, 0.8 * mainWindow.width / text.length) 53 | } 54 | } 55 | //! [sourceitem] 56 | 57 | //! [wigglyeffect] 58 | WigglyEffect { 59 | id: wigglyEffect 60 | source: sourceItem 61 | anchors.fill: sourceItem 62 | timeRunning: true 63 | wigglyAmountX: wigglyAmountXSlider.value 64 | wigglyAmountY: wigglyAmountYSlider.value 65 | electricCloudColor.a: electricSwitch.checked ? 1.0 : 0.0 66 | wigglyShadows: 0.5 67 | } 68 | //! [wigglyeffect] 69 | 70 | // Toolbar background 71 | Rectangle { 72 | anchors.fill: toolbar 73 | anchors.leftMargin: -40 * mainWindow.px 74 | anchors.rightMargin: -20 * mainWindow.px 75 | color: "#40000000" 76 | border.width: 2 77 | border.color: "#20ffffff" 78 | radius: height * 0.5 79 | } 80 | 81 | // Toolbar with settings 82 | Row { 83 | id: toolbar 84 | height: wigglyTextField.height + 40 * mainWindow.px 85 | anchors.horizontalCenter: parent.horizontalCenter 86 | anchors.bottom: parent.bottom 87 | anchors.bottomMargin: 20 * mainWindow.px 88 | spacing: 20 * mainWindow.px 89 | //! [settings] 90 | TextField { 91 | id: wigglyTextField 92 | anchors.verticalCenter: parent.verticalCenter 93 | width: mainWindow.width * 0.3 94 | text: "Wiggly" 95 | } 96 | Slider { 97 | id: wigglyAmountYSlider 98 | anchors.verticalCenter: parent.verticalCenter 99 | width: mainWindow.width * 0.15 100 | from: 0 101 | to: 100 102 | value: 40 103 | } 104 | Slider { 105 | id: wigglyAmountXSlider 106 | anchors.verticalCenter: parent.verticalCenter 107 | width: mainWindow.width * 0.15 108 | from: 0 109 | to: 100 110 | value: 20 111 | } 112 | Switch { 113 | id: electricSwitch 114 | anchors.verticalCenter: parent.verticalCenter 115 | } 116 | //! [settings] 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /examples/quickeffectmaker/wiggly/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | injekuta_bl.otf 5 | WigglyEffect/WigglyEffect.qml 6 | WigglyEffect/wigglyeffect.vert.qsb 7 | WigglyEffect/wigglyeffect.frag.qsb 8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/quickeffectmaker/wiggly/wiggly.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | 3 | QT += quick qml 4 | SOURCES += main.cpp 5 | RESOURCES += \ 6 | qml.qrc 7 | 8 | target.path = $$[QT_INSTALL_EXAMPLES]/quickeffectmaker/wiggly 9 | INSTALLS += target 10 | -------------------------------------------------------------------------------- /nodes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | -------------------------------------------------------------------------------- /nodes/basic/brightness_contrast.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "This effect adjusts the source item colors. Brightness adjustment changes the perceived luminance of the source item. Contrast adjustment increases or decreases the color and brightness variations.", 4 | "fragmentCode": [ 5 | "@main", 6 | "{", 7 | " fragColor.rgb /= max(1.0/256.0, fragColor.a);", 8 | " float c = 1.0 + brightnessContrastContrast;", 9 | " float contrastGainFactor = 1.0 + c * c * c * c * step(0.0, brightnessContrastContrast);", 10 | " fragColor.rgb = ((fragColor.rgb - 0.5) * (contrastGainFactor * brightnessContrastContrast + 1.0)) + 0.5;", 11 | " fragColor.rgb = mix(fragColor.rgb, vec3(step(0.0, brightnessContrastBrightness)), abs(brightnessContrastBrightness));", 12 | " fragColor = vec4(fragColor.rgb * fragColor.a, fragColor.a);", 13 | "}" 14 | ], 15 | "name": "BrightnessContrast", 16 | "properties": [ 17 | { 18 | "defaultValue": "0", 19 | "description": "This property defines how much the source brightness is increased or decreased.\n\nThe value ranges from -1.0 to 1.0. By default, the property is set to 0.0 (no change).", 20 | "maxValue": "1", 21 | "minValue": "-1", 22 | "name": "brightnessContrastBrightness", 23 | "type": "float" 24 | }, 25 | { 26 | "defaultValue": "0", 27 | "description": "This property defines how much the source contrast is increased or decreased. The decrease of the contrast is linear, but the increase is applied with a non-linear curve to allow very high contrast adjustment at the high end of the value range.\n\nThe value ranges from -1.0 to 1.0. By default, the property is set to 0.0 (no change).", 28 | "maxValue": "1", 29 | "minValue": "-1", 30 | "name": "brightnessContrastContrast", 31 | "type": "float" 32 | } 33 | ], 34 | "version": 1 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /nodes/basic/coloroverlay.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "The effect is similar to what happens when a colorized glass is put on top of a grayscale image. The color for the overlay is given in the RGBA format.", 4 | "fragmentCode": [ 5 | "fragColor = vec4(mix(fragColor.rgb/max(fragColor.a, 0.00390625), colorOverlayColor.rgb/max(colorOverlayColor.a, 0.00390625), colorOverlayColor.a) * fragColor.a, fragColor.a);" 6 | ], 7 | "name": "ColorOverlay", 8 | "properties": [ 9 | { 10 | "defaultValue": "0, 0, 0, 0", 11 | "description": "This property defines the color value which is used to colorize the source.\n\nBy default, the property is set to \\c \"transparent\".", 12 | "name": "colorOverlayColor", 13 | "type": "color" 14 | } 15 | ], 16 | "version": 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /nodes/basic/desaturate.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Desaturated pixel values are calculated as averages of the original RGB component values of the source item.", 4 | "fragmentCode": [ 5 | "@main", 6 | "{", 7 | " float grayColor = (fragColor.r + fragColor.g + fragColor.b) / 3.0;", 8 | " fragColor = mix(fragColor, vec4(vec3(grayColor), fragColor.a), desaturateDesaturation);", 9 | "}" 10 | ], 11 | "name": "Desaturate", 12 | "properties": [ 13 | { 14 | "defaultValue": "0", 15 | "description": "This property defines how much the source colors are desaturated.\n\nThe value ranges from 0.0 (no change) to 1.0 (desaturated). By default, the property is set to \\c 0.0 (no change).", 16 | "maxValue": "1", 17 | "minValue": "0", 18 | "name": "desaturateDesaturation", 19 | "type": "float" 20 | } 21 | ], 22 | "version": 1 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /nodes/basic/displace.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Moves the pixels of the source item according to the given displacement map. The format for the displacement map is similar to the tangent space normal maps.", 4 | "fragmentCode": [ 5 | "float linearstep(float e0, float e1, float x)", 6 | "{", 7 | " return clamp((x - e0) / (e1 - e0), 0.0, 1.0);", 8 | "}", 9 | "@main", 10 | "{", 11 | " vec4 offset = texture(displaceDisplacementSource, texCoord);", 12 | " offset.xy -= vec2(0.5, 0.5);", 13 | " offset.xy = offset.xy * step(vec2(1.0/256.0), abs(offset.xy));", 14 | " vec2 tx = texCoord + (vec2(-offset.x, offset.y) * displaceDisplacement);", 15 | " float e1 = linearstep(0.0, texCoord.x, tx.x);", 16 | " float e2 = linearstep(0.0, texCoord.y, tx.y);", 17 | " float e3 = 1.0 - linearstep(1.0, 1.0 + texCoord.x, tx.x);", 18 | " float e4 = 1.0 - linearstep(1.0, 1.0 + texCoord.y, tx.y);", 19 | " vec4 samp = texture(iSource, tx);", 20 | " samp.rgb *= e1 * e2 * e3 * e4;", 21 | " fragColor = samp * offset.a;", 22 | "}" 23 | ], 24 | "name": "Displace", 25 | "properties": [ 26 | { 27 | "defaultValue": "", 28 | "description": "This property defines the item that is going to be used as the displacement map. The displacementSource item gets rendered into the intermediate pixel buffer. The red and green component values from the result determine the displacement of the pixels from the source item.\n\nThe format for the displacement map is similar to the tangent space normal maps, which can be created with most 3D-modeling tools. Many image processing tools include the support for generating normal maps. Alternatively, the displacement map for this effect can also be a QML element which is colored appropriately. Like any QML element, it can be animated. It is recommended that the size of the diplacement map matches the size of the \\l{Displace::source}{source}.\n\nThe displace data is interpreted in the RGBA format. For every pixel: the red channel stores the x-axis displacement, and the green channel stores the y-axis displacement. Blue and alpha channels are ignored for this effect.\n\nAssuming that red channel value 1.0 is fully red (0.0 having no red at all), this effect considers pixel component value 0.5 to cause no displacement at all. Values above 0.5 shift pixels to the left, values below 0.5 do the shift to the right. In a similar way, green channel values above 0.5 displace the pixels upwards, and values below 0.5 shift the pixels downwards. The actual amount of displacement in pixels depends on the \\l displacement property.", 29 | "name": "displaceDisplacementSource", 30 | "type": "image" 31 | }, 32 | { 33 | "defaultValue": "0", 34 | "description": "This property defines the scale for the displacement. The bigger scale, the bigger the displacement of the pixels. The value set to 0.0 causes no displacement.\n\nThe value ranges from -1.0 (inverted maximum shift, according to displacementSource) to 1.0 (maximum shift, according to displacementSource). By default, the property is set to 0.0 (no displacement).", 35 | "maxValue": "1", 36 | "minValue": "-1", 37 | "name": "displaceDisplacement", 38 | "type": "float" 39 | } 40 | ], 41 | "version": 1 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /nodes/basic/fastblur.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "The FastBlur effect softens the source content by blurring it with algorithm which uses the source content downscaling and bilinear filtering.", 4 | "fragmentCode": [ 5 | "@requires BlurHelper", 6 | "@main", 7 | "{", 8 | " vec4 blurredColor = texture(iSource, texCoord) * blurWeight1[0];", 9 | " blurredColor += texture(iSourceBlur1, texCoord) * blurWeight1[1];", 10 | "#if (BLUR_HELPER_MAX_LEVEL > 2)", 11 | " blurredColor += texture(iSourceBlur2, texCoord) * blurWeight1[2];", 12 | "#endif", 13 | "#if (BLUR_HELPER_MAX_LEVEL > 8)", 14 | " blurredColor += texture(iSourceBlur3, texCoord) * blurWeight1[3];", 15 | "#endif", 16 | "#if (BLUR_HELPER_MAX_LEVEL > 16)", 17 | " blurredColor += texture(iSourceBlur4, texCoord) * blurWeight2[0];", 18 | "#endif", 19 | "#if (BLUR_HELPER_MAX_LEVEL > 32)", 20 | " blurredColor += texture(iSourceBlur5, texCoord) * blurWeight2[1];", 21 | "#endif", 22 | "", 23 | " fragColor = blurredColor;", 24 | "}" 25 | ], 26 | "name": "FastBlur", 27 | "properties": [ 28 | { 29 | "defaultValue": "0", 30 | "description": "This value defines the softness of the shadow. A larger value causes the edges of the shadow to appear more blurry.", 31 | "maxValue": "1", 32 | "minValue": "0", 33 | "name": "fastBlurAmount", 34 | "type": "float" 35 | } 36 | ], 37 | "version": 1, 38 | "vertexCode": [ 39 | "out vec4 blurWeight1;", 40 | "out vec2 blurWeight2;", 41 | "", 42 | "float blurWeight(float v) {", 43 | " return max(0.0, min(1.0, 1.0 - v * 2.0));", 44 | "}", 45 | "", 46 | "@main", 47 | "{", 48 | " float blurLod = sqrt(fastBlurAmount * (BLUR_HELPER_MAX_LEVEL / 64.0)) * 1.2 - 0.2;", 49 | " float bw1 = blurWeight(abs(blurLod - 0.1));", 50 | " float bw2 = blurWeight(abs(blurLod - 0.3));", 51 | " float bw3 = blurWeight(abs(blurLod - 0.5));", 52 | " float bw4 = blurWeight(abs(blurLod - 0.7));", 53 | " float bw5 = blurWeight(abs(blurLod - 0.9));", 54 | " float bw6 = blurWeight(abs(blurLod - 1.1));", 55 | "", 56 | " float bsum = bw1 + bw2 + bw3 + bw4 + bw5 + bw6;", 57 | " blurWeight1 = vec4(bw1 / bsum, bw2 / bsum, bw3 / bsum, bw4 / bsum);", 58 | " blurWeight2 = vec2(bw5 / bsum, bw6 / bsum);", 59 | "}" 60 | ] 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /nodes/basic/gamma_adjust.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "GammaAdjust is applied to each pixel according to the curve which is pre-defined as a power-law expression, where the property gamma is used as the reciprocal scaling exponent.", 4 | "fragmentCode": [ 5 | "@main", 6 | "{", 7 | " fragColor.rgb = fragColor.rgb / max(1.0 / 256.0, fragColor.a);", 8 | " float realGamma = 1.0 / max(gammaAdjustAmount, 0.0001);", 9 | " vec3 adjustedColor = pow(fragColor.rgb, vec3(realGamma));", 10 | " fragColor = vec4(adjustedColor * fragColor.a, fragColor.a);", 11 | "}" 12 | ], 13 | "name": "GammaAdjust", 14 | "properties": [ 15 | { 16 | "defaultValue": "1", 17 | "description": "This property defines the change factor for how the luminance of each pixel is altered.\n\nSetting the gamma values under 1.0 makes the image darker, the values above 1.0 lighten it. The value ranges from 0.0 (darkest) to inf (lightest). By default, the property is set to 1.0 (no change).", 18 | "maxValue": "4", 19 | "minValue": "0.25", 20 | "name": "gammaAdjustAmount", 21 | "type": "float" 22 | } 23 | ], 24 | "version": 1 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /nodes/basic/mipmapblur.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "This node creates a medium quality but fast blur of the source item. Suitable when speed is more important than output quality. It uses mipmap levels and does not require BlurHelper node.", 4 | "fragmentCode": [ 5 | "@requires NoiseHelper", 6 | "@main", 7 | "{", 8 | " const float lod = sqrt(mipmapBlurAmount);", 9 | " const vec3 r = mipmapBlurScatterAmount * lod * (hash23(fragCoord) - vec3(0.5));", 10 | " const vec2 cCoord = texCoord + vec2(r.xy * 0.01);", 11 | " const float m = (1.0 + r.z);", 12 | "#if (MIPMAP_BLUR_QUALITY_LOW == 1)", 13 | " vec4 blurredTex = textureLod(iSource, cCoord + m * 0.01, lod);", 14 | "#else", 15 | " // Take textures from suitable mipmap level, with offsets", 16 | " const float o = m * mipmapBlurAmount / iResolution.x * 0.5;", 17 | " vec2 lo1 = cCoord + vec2(o, o);", 18 | " vec2 lo2 = cCoord + vec2(o, -o);", 19 | " vec2 lo3 = cCoord + vec2(-o, o);", 20 | " vec2 lo4 = cCoord + vec2(-o, -o);", 21 | "", 22 | " vec4 t = textureLod(iSource, texCoord, lod);", 23 | " vec4 t1 = textureLod(iSource, lo1, lod);", 24 | " vec4 t2 = textureLod(iSource, lo2, lod);", 25 | " vec4 t3 = textureLod(iSource, lo3, lod);", 26 | " vec4 t4 = textureLod(iSource, lo4, lod);", 27 | " vec4 blurredTex = (0.28 * t + 0.18 * t1 + 0.18 * t2 + 0.18 * t3 + 0.18 * t4);", 28 | "#endif", 29 | " fragColor = blurredTex;", 30 | "}" 31 | ], 32 | "name": "MipmapBlur", 33 | "properties": [ 34 | { 35 | "defaultValue": "0", 36 | "description": "This value defines the amount (radius) of the blur.", 37 | "maxValue": "30", 38 | "minValue": "0", 39 | "name": "mipmapBlurAmount", 40 | "type": "float" 41 | }, 42 | { 43 | "defaultValue": "0", 44 | "description": "This value defines the amount of scatter (randomness) in the blur. This creates frosty looking blur.", 45 | "maxValue": "1", 46 | "minValue": "0", 47 | "name": "mipmapBlurScatterAmount", 48 | "type": "float" 49 | }, 50 | { 51 | "defaultValue": "0", 52 | "description": "When this is set to 1, only a single texture lookup is used for the blur. With this blur is very fast but also quite low quality.", 53 | "name": "MIPMAP_BLUR_QUALITY_LOW", 54 | "type": "define" 55 | } 56 | ], 57 | "version": 1 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /nodes/basic/noise.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Adds RGB or unified noise to the source item.", 4 | "fragmentCode": [ 5 | "@requires NoiseHelper", 6 | "@main", 7 | "{", 8 | "#if (NOISE_USE_RGB == 1)", 9 | "#if (NOISE_USE_RANDOM == 1)", 10 | " uvec2 noiseCoord = uvec2(fragCoord) + HASH_BOX_SIZE * uint(iTime * 60);", 11 | " vec3 noiseColor = _hash13(noiseCoord.x + HASH_BOX_SIZE * noiseCoord.y);", 12 | "#else", 13 | " vec3 noiseColor = hash23(fragCoord);", 14 | "#endif // NOISE_USE_RANDOM", 15 | "#else", 16 | "#if (NOISE_USE_RANDOM == 1)", 17 | " uvec2 noiseCoord = uvec2(fragCoord) + HASH_BOX_SIZE * uint(iTime * 60);", 18 | " vec3 noiseColor = vec3(_hash21(noiseCoord));", 19 | "#else", 20 | " vec3 noiseColor = vec3(hash21(fragCoord));", 21 | "#endif // NOISE_USE_RANDOM", 22 | "#endif // NOISE_USE_RGB", 23 | "", 24 | " fragColor.rgb = mix(fragColor.rgb, noiseColor * fragColor.a, noiseAmount);", 25 | "}" 26 | ], 27 | "name": "Noise", 28 | "properties": [ 29 | { 30 | "defaultValue": "1", 31 | "description": "When this is set to 1, the noise affects all RGB color channels separately. When this is set to 0, noise affects all channels similarly.", 32 | "name": "NOISE_USE_RGB", 33 | "type": "define" 34 | }, 35 | { 36 | "defaultValue": "1", 37 | "description": "When set to 1, noise animates randomly. When set to 0, noise remains static.", 38 | "name": "NOISE_USE_RANDOM", 39 | "type": "define" 40 | }, 41 | { 42 | "defaultValue": "0", 43 | "description": "The amount of noise applied to the source.", 44 | "maxValue": "1", 45 | "minValue": "0", 46 | "name": "noiseAmount", 47 | "type": "float" 48 | } 49 | ], 50 | "version": 1 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /nodes/basic/opacitymask.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Masks the source item with another item.", 4 | "fragmentCode": [ 5 | "@main", 6 | "{", 7 | " float opacityMaskAmount = texture(opacityMaskSource, texCoord).a;", 8 | " opacityMaskAmount = opacityMaskInvert ? 1.0 - opacityMaskAmount : opacityMaskAmount;", 9 | " fragColor = fragColor * opacityMaskAmount;", 10 | "}" 11 | ], 12 | "name": "OpacityMask", 13 | "properties": [ 14 | { 15 | "defaultValue": "../images/mask2.png", 16 | "description": "This property defines the item that is going to be used as the mask. The mask item alpha values are used to determine the source item's pixels visibility in the display.", 17 | "name": "opacityMaskSource", 18 | "type": "image" 19 | }, 20 | { 21 | "defaultValue": "false", 22 | "description": "This property inverts the behavior of the mask source.", 23 | "name": "opacityMaskInvert", 24 | "type": "bool" 25 | } 26 | ], 27 | "version": 1 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /nodes/basic/vignette.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Applies vignette effect to the source, so adds darkening / color towards the corners.", 4 | "fragmentCode": [ 5 | "@main", 6 | "{", 7 | " float vigDist = distance(texCoord, vec2(0.5));", 8 | " vec4 vigColor = vec4(vignetteColor.rgb, smoothstep(vignetteInnerRadius, vignetteOuterRadius, vigDist));", 9 | " fragColor.rgb = mix(fragColor.rgb, vigColor.rgb * fragColor.a, vigColor.a * vignetteColor.a);", 10 | "}" 11 | ], 12 | "name": "Vignette", 13 | "properties": [ 14 | { 15 | "defaultValue": "0, 0, 0, 1", 16 | "description": "Defines the vignette color. The default value is black (0, 0, 0, 1).", 17 | "name": "vignetteColor", 18 | "type": "color" 19 | }, 20 | { 21 | "defaultValue": "0.2", 22 | "description": "Inner radius from the center where vignette effect starts from. The value should be smaller than vignetteOuterRadius. The default value is 0.2.", 23 | "maxValue": "1", 24 | "minValue": "0", 25 | "name": "vignetteInnerRadius", 26 | "type": "float" 27 | }, 28 | { 29 | "defaultValue": "0.8", 30 | "description": "Outer radius from the center where vignette effect ends to. The value should be bigger than vignetteInnerRadius. The default value is 0.8.", 31 | "maxValue": "1", 32 | "minValue": "0", 33 | "name": "vignetteOuterRadius", 34 | "type": "float" 35 | } 36 | ], 37 | "version": 1 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /nodes/common/0_custom.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "This is an empty node for creating custom effects.", 4 | "fragmentCode": [ 5 | "" 6 | ], 7 | "name": "Custom", 8 | "version": 1, 9 | "vertexCode": [ 10 | "" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /nodes/common/BlurHelper.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | import QtQuick 5 | 6 | Item { 7 | id: rootItem 8 | property alias blurSrc1: blurredItemSource1 9 | property alias blurSrc2: blurredItemSource2 10 | property alias blurSrc3: blurredItemSource3 11 | property alias blurSrc4: blurredItemSource4 12 | property alias blurSrc5: blurredItemSource5 13 | 14 | component BlurItem : ShaderEffect { 15 | property vector2d offset: Qt.vector2d((1.0 + rootItem.blurMultiplier) / width, 16 | (1.0 + rootItem.blurMultiplier) / height) 17 | visible: false 18 | layer.enabled: true 19 | layer.smooth: true 20 | vertexShader: "bluritems.vert.qsb" 21 | fragmentShader: "bluritems.frag.qsb" 22 | } 23 | 24 | QtObject { 25 | id: priv 26 | property bool useBlurItem1: true 27 | property bool useBlurItem2: rootItem.blurMax > 2 28 | property bool useBlurItem3: rootItem.blurMax > 8 29 | property bool useBlurItem4: rootItem.blurMax > 16 30 | property bool useBlurItem5: rootItem.blurMax > 32 31 | } 32 | 33 | BlurItem { 34 | id: blurredItemSource1 35 | property Item src: priv.useBlurItem1 ? source : null 36 | // Size of the first blurred item is by default half of the source. 37 | // Increase for quality and decrease for performance & more blur. 38 | readonly property int blurItemSize: 8 39 | width: src ? Math.ceil(src.width / 16) * blurItemSize : 0 40 | height: src ? Math.ceil(src.height / 16) * blurItemSize : 0 41 | } 42 | BlurItem { 43 | id: blurredItemSource2 44 | property Item src: priv.useBlurItem2 ? blurredItemSource1 : null 45 | width: blurredItemSource1.width * 0.5 46 | height: blurredItemSource1.height * 0.5 47 | } 48 | BlurItem { 49 | id: blurredItemSource3 50 | property Item src: priv.useBlurItem3 ? blurredItemSource2 : null 51 | width: blurredItemSource2.width * 0.5 52 | height: blurredItemSource2.height * 0.5 53 | } 54 | BlurItem { 55 | id: blurredItemSource4 56 | property Item src: priv.useBlurItem4 ? blurredItemSource3 : null 57 | width: blurredItemSource3.width * 0.5 58 | height: blurredItemSource3.height * 0.5 59 | } 60 | BlurItem { 61 | id: blurredItemSource5 62 | property Item src: priv.useBlurItem5 ? blurredItemSource4 : null 63 | width: blurredItemSource4.width * 0.5 64 | height: blurredItemSource4.height * 0.5 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /nodes/common/blurhelper.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "This node is required e.g. for FastBlur and DropShadow. It generates blurred iSourceBlur[1..6] samplers to be available for shaders.", 4 | "fragmentCode": [ 5 | "@blursources" 6 | ], 7 | "name": "BlurHelper", 8 | "properties": [ 9 | { 10 | "defaultValue": "64", 11 | "description": "This property defines the maximum pixel radius that blur with value 1.0 will reach.\n\nMeaningful range of this value is from 2 (subtle blur) to 64 (high blur). By default, the property is set to 32. For the most optimal performance, select as small value as you need.\n\nNote: This affects to both blur and shadow effects.", 12 | "name": "BLUR_HELPER_MAX_LEVEL", 13 | "type": "define" 14 | }, 15 | { 16 | "defaultValue": "0", 17 | "description": "This property defines a multiplier for extending the blur radius.\n\nThe value ranges from 0.0 (not multiplied) to inf. By default, the property is set to 0.0. Incresing the multiplier extends the blur radius, but decreases the blur quality. This is more performant option for a bigger blur radius than BLUR_HELPER_MAX_LEVEL as it doesn't increase the amount of texture lookups.\n\nNote: This affects to both blur and shadow effects.", 18 | "maxValue": "2", 19 | "minValue": "0", 20 | "name": "blurMultiplier", 21 | "type": "float" 22 | } 23 | ], 24 | "version": 1 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /nodes/common/bluritems.frag: -------------------------------------------------------------------------------- 1 | #version 440 2 | 3 | layout(location = 0) in vec2 texCoord0; 4 | layout(location = 1) in vec2 texCoord1; 5 | layout(location = 2) in vec2 texCoord2; 6 | layout(location = 3) in vec2 texCoord3; 7 | layout(location = 0) out vec4 fragColor; 8 | 9 | layout(std140, binding = 0) uniform buf { 10 | mat4 qt_Matrix; 11 | float qt_Opacity; 12 | vec2 offset; 13 | }; 14 | 15 | layout(binding = 1) uniform sampler2D src; 16 | 17 | void main() { 18 | vec4 sourceColor = (texture(src, texCoord0) + texture(src, texCoord1) + 19 | texture(src, texCoord2) + texture(src, texCoord3)) * 0.25; 20 | fragColor = sourceColor * qt_Opacity; 21 | } 22 | -------------------------------------------------------------------------------- /nodes/common/bluritems.frag.qsb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/common/bluritems.frag.qsb -------------------------------------------------------------------------------- /nodes/common/bluritems.vert: -------------------------------------------------------------------------------- 1 | #version 440 2 | 3 | layout(location = 0) in vec4 qt_Vertex; 4 | layout(location = 1) in vec2 qt_MultiTexCoord0; 5 | layout(location = 0) out vec2 texCoord0; 6 | layout(location = 1) out vec2 texCoord1; 7 | layout(location = 2) out vec2 texCoord2; 8 | layout(location = 3) out vec2 texCoord3; 9 | 10 | layout(std140, binding = 0) uniform buf { 11 | mat4 qt_Matrix; 12 | float qt_Opacity; 13 | vec2 offset; 14 | }; 15 | 16 | out gl_PerVertex { vec4 gl_Position; }; 17 | 18 | void main() { 19 | float dither = 0.33; 20 | texCoord0 = vec2(qt_MultiTexCoord0.x + offset.x, qt_MultiTexCoord0.y + offset.y * dither); 21 | texCoord1 = vec2(qt_MultiTexCoord0.x + offset.x * dither, qt_MultiTexCoord0.y - offset.y); 22 | texCoord2 = vec2(qt_MultiTexCoord0.x - offset.x * dither, qt_MultiTexCoord0.y + offset.y); 23 | texCoord3 = vec2(qt_MultiTexCoord0.x - offset.x, qt_MultiTexCoord0.y - offset.y * dither); 24 | gl_Position = qt_Matrix * qt_Vertex; 25 | } 26 | -------------------------------------------------------------------------------- /nodes/common/bluritems.vert.qsb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/common/bluritems.vert.qsb -------------------------------------------------------------------------------- /nodes/common/mathhelper.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "This node contains commonly used math defines and helper functions.", 4 | "fragmentCode": [ 5 | "#define PI 3.14159265359", 6 | "#define TAU 6.28318530718", 7 | "#define SQRT2 1.41421356237", 8 | "", 9 | "mat2 rotate2d(float a) {", 10 | " const float c = cos(a);", 11 | " const float s = sin(a);", 12 | " return mat2(c, -s, s, c);", 13 | "}", 14 | "@main" 15 | ], 16 | "name": "MathHelper", 17 | "version": 1 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /nodes/common/noisehelper.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "This node contains noise / hash helper functions which other nodes can utilize.", 4 | "fragmentCode": [ 5 | "#define HASH_BOX_SIZE 1920U", 6 | "#define PI 3.14159265359", 7 | "#define TAU 6.28318530718", 8 | "#define SQRT2 1.41421356237", 9 | "", 10 | "float hash21(vec2 n);", 11 | "vec3 hash23(vec2 n);", 12 | "float _hash11(uint n);", 13 | "float _hash21( uvec2 x );", 14 | "vec3 _hash13(uint n);", 15 | "", 16 | "// Hash from vec2 to float", 17 | "// Can be used directly with fragCoord", 18 | "float hash21(vec2 n)", 19 | "{", 20 | " uvec2 uin = uvec2(n);", 21 | " return _hash21(uin);", 22 | "}", 23 | "", 24 | "// Hash from vec2 to vec3", 25 | "// Can be used directly with fragCoord", 26 | "vec3 hash23(vec2 n)", 27 | "{", 28 | " uvec2 uin = uvec2(n);", 29 | " return _hash13(uin.x + HASH_BOX_SIZE * uin.y);", 30 | "}", 31 | "", 32 | "// Hash from uint to float", 33 | "float _hash11(uint n)", 34 | "{", 35 | " n = (n << 13U) ^ n;", 36 | " n = n * (n * n * 15731U + 789221U) + 1376312589U;", 37 | " return float( n & uint(0x7fffffffU))/float(0x7fffffff);", 38 | "}", 39 | "", 40 | "// Hash from uvec2 to float", 41 | "float _hash21( uvec2 x )", 42 | "{", 43 | " uvec2 q = 1103515245U * ( (x>>1U) ^ (x.yx ) );", 44 | " uint n = 1103515245U * ( (q.x ) ^ (q.y>>3U) );", 45 | " return float(n) * (1.0/float(0xffffffffU));", 46 | "}", 47 | "", 48 | "// Hash from uint to vec3", 49 | "vec3 _hash13(uint n)", 50 | "{", 51 | " n = (n << 13U) ^ n;", 52 | " n = n * (n * n * 15731U + 789221U) + 1376312589U;", 53 | " uvec3 k = n * uvec3(n,n*16807U,n*48271U);", 54 | " return vec3( k & uvec3(0x7fffffffU))/float(0x7fffffff);", 55 | "}", 56 | "", 57 | "vec2 pseudo3dNoiseLevel(vec2 intPos, float t) {", 58 | " float rand = hash21(intPos);", 59 | " float angle = TAU * rand + t * rand;", 60 | " return vec2(cos(angle), sin(angle));", 61 | "}", 62 | "", 63 | "// Generates noise which resembles 3D perlin-noise", 64 | "float pseudo3dNoise(vec3 pos) {", 65 | " const vec2 i = floor(pos.xy);", 66 | " const vec2 f = fract(pos.xy);", 67 | " const vec2 blend = f * f * (3.0 - 2.0 * f);", 68 | " float noiseVal = mix(", 69 | " mix(", 70 | " dot(pseudo3dNoiseLevel(i + vec2(0.0, 0.0), pos.z), f - vec2(0.0, 0.0)),", 71 | " dot(pseudo3dNoiseLevel(i + vec2(1.0, 0.0), pos.z), f - vec2(1.0, 0.0)),", 72 | " blend.x),", 73 | " mix(", 74 | " dot(pseudo3dNoiseLevel(i + vec2(0.0, 1.0), pos.z), f - vec2(0.0, 1.0)),", 75 | " dot(pseudo3dNoiseLevel(i + vec2(1.0, 1.0), pos.z), f - vec2(1.0, 1.0)),", 76 | " blend.x),", 77 | " blend.y);", 78 | " return noiseVal * SQRT2;", 79 | "}", 80 | "", 81 | "@main" 82 | ], 83 | "name": "NoiseHelper", 84 | "version": 1 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /nodes/extra/bars.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Animated bars effect.", 4 | "fragmentCode": [ 5 | "@main", 6 | "{", 7 | " float px = 1.0 / iResolution.x;", 8 | " float sbar = iResolution.x / barsBarWidth * 0.5;", 9 | " float movement = -iTime * px * barsAnimationSpeed;", 10 | " float p = ((fragCoord.x + fragCoord.y * barsBarAngle) * px + movement) * sbar;", 11 | " float bar = abs(2.0 * fract(p) - 1.0);", 12 | " float barSmoothness = 2.0 / barsBarWidth;", 13 | " bar = smoothstep(0.5 - barSmoothness, 0.5 + barSmoothness, bar);", 14 | " fragColor = mix(barsColor1, barsColor2, bar);", 15 | "}" 16 | ], 17 | "name": "Bars", 18 | "properties": [ 19 | { 20 | "defaultValue": "0, 0, 0, 1", 21 | "description": "First color of the bars.", 22 | "name": "barsColor1", 23 | "type": "color" 24 | }, 25 | { 26 | "defaultValue": "1, 1, 1, 1", 27 | "description": "Second color of the bars.", 28 | "name": "barsColor2", 29 | "type": "color" 30 | }, 31 | { 32 | "defaultValue": "30", 33 | "description": "Width of the bars in pixels.", 34 | "maxValue": "100", 35 | "minValue": "4", 36 | "name": "barsBarWidth", 37 | "type": "float" 38 | }, 39 | { 40 | "defaultValue": "50", 41 | "description": "How fast the bars animate in pixels per second.", 42 | "maxValue": "200", 43 | "minValue": "-200", 44 | "name": "barsAnimationSpeed", 45 | "type": "float" 46 | }, 47 | { 48 | "defaultValue": "0.5", 49 | "description": "Rotation angle of the bars.", 50 | "maxValue": "1", 51 | "minValue": "-1", 52 | "name": "barsBarAngle", 53 | "type": "float" 54 | } 55 | ], 56 | "version": 1 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /nodes/extra/bend.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Bends the source item around a ring and applies some dimming to bent parts.", 4 | "fragmentCode": [ 5 | "@main", 6 | "{", 7 | " vec4 color = mix(fragColor * bendHighlightFactor, bendDimColor * fragColor.a, dim);", 8 | " fragColor = color;", 9 | "}" 10 | ], 11 | "name": "Bend", 12 | "properties": [ 13 | { 14 | "defaultValue": "1", 15 | "description": "This property defines how much the source image is bent. 1 equals to 180 degrees (half circle)", 16 | "maxValue": "1", 17 | "minValue": "0", 18 | "name": "bendFactor", 19 | "type": "float" 20 | }, 21 | { 22 | "defaultValue": "0.5", 23 | "description": "This property defines how much perspective is applied to the source. The perspective makes the source shrink vertically the further the pixels are due to bending. 1 is infinite, i.e. the furthest sides of the source become 0 pixels high if the bendFactor is 1.", 24 | "maxValue": "1", 25 | "minValue": "0", 26 | "name": "bendPerspective", 27 | "type": "float" 28 | }, 29 | { 30 | "defaultValue": "0", 31 | "description": "This property moves the viewpoint vertically. If the value equals the bendPerspecive the viewpoint is at the bottom edge of the source and if the value is opposite to the bendPerspective the viewpoint is at the top edge of the source", 32 | "maxValue": "1", 33 | "minValue": "-1", 34 | "name": "bendOrigin", 35 | "type": "float" 36 | }, 37 | { 38 | "defaultValue": "0, 0, 0, 1", 39 | "description": "This color is used to dim the source the further it bends. The alpha value adds translucency.", 40 | "name": "bendDimColor", 41 | "type": "color" 42 | }, 43 | { 44 | "defaultValue": "0.5", 45 | "description": "This property defines how much the source is dimmed according to the distance. 1 makes the furthest edges to be fully DimColor if the bendFactor is 1.", 46 | "maxValue": "2", 47 | "minValue": "0", 48 | "name": "bendDimFactor", 49 | "type": "float" 50 | }, 51 | { 52 | "defaultValue": "1", 53 | "description": "This property defines how much the colors are highlighted before dimming by simply multiplying the sources rgb values. This can be used to make the color appear brighter and counterbalance the dimming.", 54 | "maxValue": "1.5", 55 | "minValue": "1", 56 | "name": "bendHighlightFactor", 57 | "type": "float" 58 | } 59 | ], 60 | "version": 1, 61 | "vertexCode": [ 62 | "@mesh 50,50", 63 | "", 64 | "out float dim;", 65 | "", 66 | "#define PI 3.1415926538", 67 | "", 68 | "@main", 69 | "{", 70 | " const float a = (texCoord.x + 1.) * PI;", 71 | " const float dx = 0.5 + 0.5 * cos(a);", 72 | " const float dy = -sin(a);", 73 | " const float ddy = 1. - dy;", 74 | " const float yBend = bendFactor * bendPerspective;", 75 | " vertCoord.x = iResolution.x * mix(texCoord.x, dx, bendFactor);", 76 | " vertCoord.y = iResolution.y * (texCoord.y * mix(1.0, dy, yBend) + (bendOrigin * bendFactor + yBend) * ddy * 0.5);", 77 | "", 78 | " dim = ddy * bendDimFactor * bendFactor;", 79 | "}" 80 | ] 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /nodes/extra/circlebend.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Bends the source to circle / arc in the vertex shader.", 4 | "name": "CircleBend", 5 | "properties": [ 6 | { 7 | "defaultValue": "0", 8 | "description": "Start angle for the circle bending in radians.", 9 | "maxValue": "6.283", 10 | "minValue": "0", 11 | "name": "circleBendStartAngle", 12 | "type": "float" 13 | }, 14 | { 15 | "defaultValue": "6.283", 16 | "description": "Spanning angle for the circle bending in radians.", 17 | "maxValue": "6.283", 18 | "minValue": "0", 19 | "name": "circleBendSpanAngle", 20 | "type": "float" 21 | }, 22 | { 23 | "defaultValue": "0.2", 24 | "description": "Width of the bending ring. Values are between 0.0 and 1.0 (full size of the source item).", 25 | "maxValue": "1", 26 | "minValue": "0", 27 | "name": "circleBendRingWidth", 28 | "type": "float" 29 | }, 30 | { 31 | "customValue": "Qt.point(width, height)", 32 | "defaultValue": "0, 0", 33 | "maxValue": "1, 1", 34 | "minValue": "0, 0", 35 | "name": "circleBendTexSize", 36 | "type": "vec2", 37 | "useCustomValue": true 38 | } 39 | ], 40 | "version": 1, 41 | "vertexCode": [ 42 | "@mesh 512, 1", 43 | "@main", 44 | "{", 45 | " const float PI_H = 1.5707964;", 46 | " vec2 vPos = vec2(0.5);", 47 | " float s = 0.5 - 0.5 * circleBendRingWidth + texCoord.y * 0.5 * circleBendRingWidth;", 48 | " float spanX = texCoord.x * circleBendSpanAngle;", 49 | " vPos.x += s * sin(circleBendStartAngle + spanX);", 50 | " vPos.y += s * sin(circleBendStartAngle + spanX + PI_H);", 51 | " vPos *= circleBendTexSize;", 52 | " vertCoord = vPos;", 53 | "}", 54 | "" 55 | ] 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /nodes/extra/colorlut.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Applies a color lookup table for the source item. The format of the LUT image is either 16x16x16x16 square in 256x256 (default) or 64x64x64 square in 512x512. The 256 version is more performant and requires only a single texture lookup.\n\nSeveral built-in LUTs are provided in both formats. To create a custom LUT, use the lut_*_neutral as the base.", 4 | "fragmentCode": [ 5 | "@main", 6 | "{", 7 | " const vec4 currentColor = fragColor;", 8 | "", 9 | "#if COLOR_LUT_256_MODE == 1", 10 | "", 11 | " const float lutGreenColor = currentColor.g * 255.0;", 12 | " const float cellCoord = 0.0625;", 13 | " const float lutTexSize = 256.0;", 14 | " const float lutCells = 256.0;", 15 | " const float h1 = 0.5 / lutTexSize;", 16 | " const float h2 = cellCoord - (1.0 / lutTexSize);", 17 | "", 18 | " vec2 quad;", 19 | " quad.y = floor(floor(lutGreenColor) * cellCoord) * cellCoord;", 20 | " quad.x = (floor(lutGreenColor) - (quad.y * lutCells)) * cellCoord;", 21 | " const vec2 texPos = vec2(quad.x + h1 + (h2 * currentColor.r),", 22 | " quad.y + h1 + (h2 * currentColor.b));", 23 | "", 24 | " vec4 lutColor = texture(colorLUTImage, texPos);", 25 | "", 26 | "#else", 27 | "", 28 | " const float lutBlueColor = currentColor.b * 63.0;", 29 | " const float cellCoord = 0.125;", 30 | " const float lutTexSize = 512.0;", 31 | " const float lutCells = 64.0;", 32 | " const float h1 = 0.5 / lutTexSize;", 33 | " const float h2 = cellCoord - (1.0 / lutTexSize);", 34 | "", 35 | " vec2 quad1;", 36 | " quad1.y = floor(floor(lutBlueColor) * cellCoord) * cellCoord;", 37 | " quad1.x = (floor(lutBlueColor) - (quad1.y * lutCells)) * cellCoord;", 38 | " const vec2 texPos = vec2(quad1.x + h1 + (h2 * currentColor.r),", 39 | " quad1.y + h1 + (h2 * currentColor.g));", 40 | " vec4 lutColor = texture(colorLUTImage, texPos);", 41 | "", 42 | " vec2 quad2;", 43 | " quad2.y = floor(ceil(lutBlueColor) * cellCoord) * cellCoord;", 44 | " quad2.x = (ceil(lutBlueColor) - (quad2.y * lutCells)) * cellCoord;", 45 | " const vec2 texPos2 = vec2(quad2.x + h1 + (h2 * currentColor.r),", 46 | " quad2.y + h1 + (h2 * currentColor.g));", 47 | " const vec4 lutColor2 = texture(colorLUTImage, texPos2);", 48 | "", 49 | " lutColor = mix(lutColor, lutColor2, fract(lutBlueColor));", 50 | "", 51 | "#endif", 52 | "", 53 | " fragColor = mix(fragColor, lutColor * fragColor.a, colorLUTStrength);", 54 | "}" 55 | ], 56 | "name": "ColorLUT", 57 | "properties": [ 58 | { 59 | "defaultValue": "1", 60 | "description": "Set this 1 to when using the compact 256x256 format LUT textures (lut_256_*) and 0 when using the standard 512x12 onces (lut_512_*).", 61 | "name": "COLOR_LUT_256_MODE", 62 | "type": "define" 63 | }, 64 | { 65 | "defaultValue": "../images/lut_256_bright.png", 66 | "name": "colorLUTImage", 67 | "type": "image" 68 | }, 69 | { 70 | "defaultValue": "1", 71 | "maxValue": "1", 72 | "minValue": "0", 73 | "name": "colorLUTStrength", 74 | "type": "float" 75 | } 76 | ], 77 | "version": 1 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /nodes/extra/ledscreen.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Creates ledscreen effect of the source item. Note: Uses source item texture so this node should be used in the beginning of node tree and nodes with color operations applied after it.", 4 | "fragmentCode": [ 5 | "@main", 6 | "{", 7 | " const float maxLedSize = ledScreenLedSize;", 8 | " vec2 center = floor(fragCoord / maxLedSize) * maxLedSize + maxLedSize * 0.5;", 9 | " vec3 ledColor = texture(scaledSourceImage, center / iResolution.xy).rgb;", 10 | "", 11 | "#if LED_SCREEN_SIZE_FROM_COLOR == 1", 12 | " vec3 sizeColorMultiplier = vec3(0.8, 0.4, 0.2);", 13 | " float ledSize = clamp(dot(ledColor, maxLedSize * sizeColorMultiplier), 0.1, maxLedSize);", 14 | "#else", 15 | " float ledSize = maxLedSize;", 16 | "#endif", 17 | "", 18 | " float alpha = 0.0;", 19 | " if (ledSize > 2.0) {", 20 | " float dist = distance(center, fragCoord) * 2.0;", 21 | " alpha = smoothstep(1.0, 0.5, dist / ledSize);", 22 | " }", 23 | "", 24 | "#if LED_SCREEN_COLOR_FROM_SOURCE == 1", 25 | " fragColor.rgb = ledColor.rgb * alpha;", 26 | "#else", 27 | " fragColor.rgb = vec3(alpha) * ledScreenLedColor.rgb;", 28 | "#endif", 29 | "", 30 | "}" 31 | ], 32 | "name": "LedScreen", 33 | "properties": [ 34 | { 35 | "defaultValue": "1", 36 | "description": "When this is set to 1, the size of the led is determined by its color.", 37 | "name": "LED_SCREEN_SIZE_FROM_COLOR", 38 | "type": "define" 39 | }, 40 | { 41 | "defaultValue": "1", 42 | "description": "When this is set to 1, the color of the led is determined by the color of the source item.", 43 | "name": "LED_SCREEN_COLOR_FROM_SOURCE", 44 | "type": "define" 45 | }, 46 | { 47 | "defaultValue": "20", 48 | "description": "Size of a single led in pixels.", 49 | "maxValue": "50", 50 | "minValue": "4", 51 | "name": "ledScreenLedSize", 52 | "type": "float" 53 | }, 54 | { 55 | "defaultValue": "1, 1, 1, 1", 56 | "description": "Color of the leds. This only affects when LED_SCREEN_COLOR_FROM_SOURCE is not set.", 57 | "name": "ledScreenLedColor", 58 | "type": "color" 59 | }, 60 | { 61 | "customValue": "scaledSource", 62 | "defaultValue": "", 63 | "description": "Helper property for the scaled source item.", 64 | "name": "scaledSourceImage", 65 | "type": "image", 66 | "useCustomValue": true 67 | } 68 | ], 69 | "qmlCode": [ 70 | "ShaderEffectSource {", 71 | " id: scaledSource", 72 | " sourceItem: source", 73 | " textureSize: Qt.size(source.width / ledScreenLedSize, source.height / ledScreenLedSize);", 74 | "}" 75 | ], 76 | "version": 1 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /nodes/extra/normalmapping.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Generates normal mapping effect where texture is used for adding 3D appearance for the source item. This is useful for example to faking the lighting of bumps and dents.", 4 | "fragmentCode": [ 5 | "@main", 6 | "{", 7 | " vec2 coord = vec2(fract(texCoord * normalMapTextureScale));", 8 | " vec4 normalMapTexture = texture(normalMapImage, coord);", 9 | " vec3 lightDir = vec3(normalMapLightPosition.xy - texCoord, normalMapLightPosition.z);", 10 | " // Aspect ratio correction", 11 | " lightDir.x *= iResolution.x / iResolution.y;", 12 | " float d = length(lightDir);", 13 | " vec3 n = normalize(normalMapTexture.rgb * 2.0 - 1.0);", 14 | " vec3 l = normalize(lightDir);", 15 | " vec3 normalMapDiffuse = (normalMapLightColor.rgb * normalMapLightColor.a) * max(dot(n, l), 0.0);", 16 | " float lightFade = 1.0 / (normalMapLightFade + normalMapLightFade * d + normalMapLightFade * d * d);", 17 | " // Fade based on normal map alpha", 18 | " lightFade *= pow(normalMapTexture.a, 10.0);", 19 | " vec3 normalMap = fragColor.rgb * normalMapDiffuse * lightFade;", 20 | " fragColor.rgb = mix(fragColor.rgb, normalMap, normalMapOpacity);", 21 | "}" 22 | ], 23 | "name": "NormalMapping", 24 | "properties": [ 25 | { 26 | "defaultValue": "../images/scratches_n.png", 27 | "description": "Texture for the normal mapping effect. If scaling is used then this should support seamless tiling.", 28 | "name": "normalMapImage", 29 | "type": "image" 30 | }, 31 | { 32 | "defaultValue": "1", 33 | "description": "Scaling of the normal map texture. The default value is 1.0, meaning the texture matches to source item size.", 34 | "maxValue": "4", 35 | "minValue": "0.2", 36 | "name": "normalMapTextureScale", 37 | "type": "float" 38 | }, 39 | { 40 | "defaultValue": "0.5, 0.5, 0.5", 41 | "description": "Position of the point light relative to the item coordinates. Bigger z value means the light if further away from the surface.", 42 | "maxValue": "1, 1, 1", 43 | "minValue": "0, 0, 0", 44 | "name": "normalMapLightPosition", 45 | "type": "vec3" 46 | }, 47 | { 48 | "defaultValue": "1, 1, 1, 1", 49 | "description": "Defines color of the light. The default value is white (1.0, 1.0, 1.0, 1.0).", 50 | "name": "normalMapLightColor", 51 | "type": "color" 52 | }, 53 | { 54 | "defaultValue": "0.5", 55 | "description": "Defines the fading rate at which the lighting effect dims the light in proportion to the distance to the light. The default value is 0.5.", 56 | "maxValue": "1", 57 | "minValue": "0", 58 | "name": "normalMapLightFade", 59 | "type": "float" 60 | }, 61 | { 62 | "defaultValue": "1", 63 | "description": "Defines the opacity of the normal map effect. Value 1.0 means full opacity while 0.0 means full transparency. The default value is 1.0.", 64 | "maxValue": "1", 65 | "minValue": "0", 66 | "name": "normalMapOpacity", 67 | "type": "float" 68 | } 69 | ], 70 | "version": 1 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /nodes/extra/rectangularshadow.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Creates a rounded rectangle with blur radius. The properties match with the RectangularShadow QtQuick.Effects element, so this node provides a starting point for the custom RectangularShadow materials.", 4 | "fragmentCode": [ 5 | "float roundedBox(vec2 centerPos, vec2 size, float radii) {", 6 | " return length(max(abs(centerPos) - size + radii, 0.0)) - radii;", 7 | "}", 8 | "", 9 | "@main", 10 | "{", 11 | " float box = roundedBox(fragCoord - iResolution.xy * 0.5, rectSize, radius);", 12 | " float a = 1.0 - smoothstep(0.0, blur, box);", 13 | " fragColor = color * a * a;", 14 | "}", 15 | "" 16 | ], 17 | "name": "RectangularShadow", 18 | "properties": [ 19 | { 20 | "defaultValue": "0, 0, 0, 1", 21 | "description": "Color of the shadow/glow.", 22 | "name": "color", 23 | "type": "color" 24 | }, 25 | { 26 | "defaultValue": "100, 100", 27 | "description": "Size of the shadow rectangle in pixels.", 28 | "maxValue": "200, 200", 29 | "minValue": "0, 0", 30 | "name": "rectSize", 31 | "type": "vec2" 32 | }, 33 | { 34 | "defaultValue": "0", 35 | "description": "Corner radius amount of the shadow rectangle.", 36 | "maxValue": "50", 37 | "minValue": "0", 38 | "name": "radius", 39 | "type": "float" 40 | }, 41 | { 42 | "defaultValue": "10", 43 | "description": "Blur radius amount of the shadow rectangle.", 44 | "maxValue": "50", 45 | "minValue": "0", 46 | "name": "blur", 47 | "type": "float" 48 | } 49 | ], 50 | "version": 1 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /nodes/extra/sunburst.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Renders a two coloured sunburst effect with adjustable colors, stripe count, angle, center point, center ring and smoothness", 4 | "fragmentCode": [ 5 | "#define TAU 6.28318530718", 6 | "@main", 7 | "{", 8 | " const vec2 d = texCoord - sunburstCenterPoint;", 9 | " const float a = atan(d.y, d.x) / TAU + sunburstAngle;", 10 | " const float stp = 1. / sunburstStripeCount;", 11 | " const float m = abs(mod(a, stp) / stp - 0.5) * 2.0;", 12 | " const float dist = sqrt(d.x*d.x + d.y*d.y) * 2.0;", 13 | " const float smth = sunburstSmoothness / dist;", 14 | " float p = smoothstep(0.5 - smth, 0.5 + smth, m);", 15 | " p = max(p, smoothstep(sunburstCenterRing + sunburstCenterSmoothness, sunburstCenterRing, dist + 0.1));", 16 | " fragColor = mix(sunburstColor2, sunburstColor1, p);", 17 | "}" 18 | ], 19 | "name": "Sunburst", 20 | "properties": [ 21 | { 22 | "defaultValue": "1, 1, 1, 1", 23 | "name": "sunburstColor1", 24 | "type": "color" 25 | }, 26 | { 27 | "defaultValue": "0, 0, 0, 0.5", 28 | "name": "sunburstColor2", 29 | "type": "color" 30 | }, 31 | { 32 | "defaultValue": "0.5, 0.5", 33 | "maxValue": "1, 1", 34 | "minValue": "0, 0", 35 | "name": "sunburstCenterPoint", 36 | "type": "vec2" 37 | }, 38 | { 39 | "defaultValue": "0", 40 | "description": "Sunburst rotation angle, 1.0 is a full circle rotation.", 41 | "maxValue": "1", 42 | "minValue": "0", 43 | "name": "sunburstAngle", 44 | "type": "float" 45 | }, 46 | { 47 | "defaultValue": "0.05", 48 | "description": "Smoothing amount between the sunburst colors.", 49 | "maxValue": "0.5", 50 | "minValue": "0", 51 | "name": "sunburstSmoothness", 52 | "type": "float" 53 | }, 54 | { 55 | "defaultValue": "0.1", 56 | "maxValue": "1", 57 | "minValue": "0", 58 | "name": "sunburstCenterSmoothness", 59 | "type": "float" 60 | }, 61 | { 62 | "defaultValue": "0", 63 | "description": "Paints a circle in the center of sunburst. Together with sunburstCenterSmoothness this reduces the moiré effect.", 64 | "maxValue": "2", 65 | "minValue": "0", 66 | "name": "sunburstCenterRing", 67 | "type": "float" 68 | }, 69 | { 70 | "defaultValue": "8", 71 | "maxValue": "100", 72 | "minValue": "3", 73 | "name": "sunburstStripeCount", 74 | "type": "int" 75 | } 76 | ], 77 | "version": 1 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /nodes/extra/swirl.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Simple swirl distortion effect. The effect uses by default 100 x 100 sized grid mesh and adjusts the geometry accoring to the given parameters. The item size should be scaled big enough to allow for the distortion without revealing the edges of the distorted item geometry.", 4 | "name": "Swirl", 5 | "properties": [ 6 | { 7 | "defaultValue": "4", 8 | "maxValue": "10", 9 | "minValue": "0", 10 | "name": "swirlWaveLength", 11 | "type": "float" 12 | }, 13 | { 14 | "defaultValue": "0.05", 15 | "maxValue": "0.5", 16 | "minValue": "0", 17 | "name": "swirlAmplitude", 18 | "type": "float" 19 | }, 20 | { 21 | "defaultValue": "0", 22 | "maxValue": "1", 23 | "minValue": "0", 24 | "name": "swirlPhase", 25 | "type": "float" 26 | }, 27 | { 28 | "defaultValue": "0.5, 0.5", 29 | "maxValue": "1, 1", 30 | "minValue": "0, 0", 31 | "name": "swirlCenterPoint", 32 | "type": "vec2" 33 | } 34 | ], 35 | "version": 1, 36 | "vertexCode": [ 37 | "@mesh 100, 100", 38 | "#define TAU 6.28318530718", 39 | "@main", 40 | "{", 41 | " const vec2 cp = iResolution.xy * swirlCenterPoint;", 42 | " const vec2 d = vertCoord - cp;", 43 | " if (d.x != 0.0 || d.y != 0.0) {", 44 | " const float dd = sqrt(d.x*d.x + d.y*d.y);", 45 | " float a = atan(d.y, d.x);", 46 | " a += sin((dd * swirlWaveLength / iResolution.x + swirlPhase) * TAU) * swirlAmplitude;", 47 | " vertCoord.x = cp.x + cos(a) * dd;", 48 | " vertCoord.y = cp.y + sin(a) * dd;", 49 | " }", 50 | "}" 51 | ] 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /nodes/images/blackcircle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/blackcircle.png -------------------------------------------------------------------------------- /nodes/images/clouds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/clouds.png -------------------------------------------------------------------------------- /nodes/images/fog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/fog.png -------------------------------------------------------------------------------- /nodes/images/fog2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/fog2.png -------------------------------------------------------------------------------- /nodes/images/lava.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lava.png -------------------------------------------------------------------------------- /nodes/images/lut_256_apocalypse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_apocalypse.png -------------------------------------------------------------------------------- /nodes/images/lut_256_bleach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_bleach.png -------------------------------------------------------------------------------- /nodes/images/lut_256_bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_bright.png -------------------------------------------------------------------------------- /nodes/images/lut_256_cinematic1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_cinematic1.png -------------------------------------------------------------------------------- /nodes/images/lut_256_cinematic2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_cinematic2.png -------------------------------------------------------------------------------- /nodes/images/lut_256_cinematic3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_cinematic3.png -------------------------------------------------------------------------------- /nodes/images/lut_256_cold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_cold.png -------------------------------------------------------------------------------- /nodes/images/lut_256_drama.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_drama.png -------------------------------------------------------------------------------- /nodes/images/lut_256_fall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_fall.png -------------------------------------------------------------------------------- /nodes/images/lut_256_horror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_horror.png -------------------------------------------------------------------------------- /nodes/images/lut_256_neutral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_neutral.png -------------------------------------------------------------------------------- /nodes/images/lut_256_old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_old.png -------------------------------------------------------------------------------- /nodes/images/lut_256_sepia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_sepia.png -------------------------------------------------------------------------------- /nodes/images/lut_256_summer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_summer.png -------------------------------------------------------------------------------- /nodes/images/lut_256_sunset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_sunset.png -------------------------------------------------------------------------------- /nodes/images/lut_256_tealorange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_tealorange.png -------------------------------------------------------------------------------- /nodes/images/lut_256_vibrant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_vibrant.png -------------------------------------------------------------------------------- /nodes/images/lut_256_vintage1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_vintage1.png -------------------------------------------------------------------------------- /nodes/images/lut_256_vintage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_vintage2.png -------------------------------------------------------------------------------- /nodes/images/lut_256_vintage3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_vintage3.png -------------------------------------------------------------------------------- /nodes/images/lut_256_vintagebw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_vintagebw.png -------------------------------------------------------------------------------- /nodes/images/lut_256_warm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_256_warm.png -------------------------------------------------------------------------------- /nodes/images/lut_512_apocalypse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_apocalypse.png -------------------------------------------------------------------------------- /nodes/images/lut_512_bleach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_bleach.png -------------------------------------------------------------------------------- /nodes/images/lut_512_bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_bright.png -------------------------------------------------------------------------------- /nodes/images/lut_512_cinematic1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_cinematic1.png -------------------------------------------------------------------------------- /nodes/images/lut_512_cinematic2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_cinematic2.png -------------------------------------------------------------------------------- /nodes/images/lut_512_cinematic3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_cinematic3.png -------------------------------------------------------------------------------- /nodes/images/lut_512_cold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_cold.png -------------------------------------------------------------------------------- /nodes/images/lut_512_drama.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_drama.png -------------------------------------------------------------------------------- /nodes/images/lut_512_fall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_fall.png -------------------------------------------------------------------------------- /nodes/images/lut_512_horror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_horror.png -------------------------------------------------------------------------------- /nodes/images/lut_512_neutral.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_neutral.png -------------------------------------------------------------------------------- /nodes/images/lut_512_old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_old.png -------------------------------------------------------------------------------- /nodes/images/lut_512_sepia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_sepia.png -------------------------------------------------------------------------------- /nodes/images/lut_512_summer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_summer.png -------------------------------------------------------------------------------- /nodes/images/lut_512_sunset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_sunset.png -------------------------------------------------------------------------------- /nodes/images/lut_512_tealorange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_tealorange.png -------------------------------------------------------------------------------- /nodes/images/lut_512_vibrant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_vibrant.png -------------------------------------------------------------------------------- /nodes/images/lut_512_vintage1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_vintage1.png -------------------------------------------------------------------------------- /nodes/images/lut_512_vintage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_vintage2.png -------------------------------------------------------------------------------- /nodes/images/lut_512_vintage3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_vintage3.png -------------------------------------------------------------------------------- /nodes/images/lut_512_vintagebw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_vintagebw.png -------------------------------------------------------------------------------- /nodes/images/lut_512_warm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/lut_512_warm.png -------------------------------------------------------------------------------- /nodes/images/mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/mask.png -------------------------------------------------------------------------------- /nodes/images/mask2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/mask2.png -------------------------------------------------------------------------------- /nodes/images/qt-logo-sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/qt-logo-sheet.png -------------------------------------------------------------------------------- /nodes/images/qt_logo_green_rgb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/qt_logo_green_rgb.png -------------------------------------------------------------------------------- /nodes/images/qt_logo_green_rgb_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/qt_logo_green_rgb_n.png -------------------------------------------------------------------------------- /nodes/images/quit_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/quit_logo.png -------------------------------------------------------------------------------- /nodes/images/quit_logo_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/quit_logo_n.png -------------------------------------------------------------------------------- /nodes/images/rain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/rain.png -------------------------------------------------------------------------------- /nodes/images/scratches_n.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/scratches_n.png -------------------------------------------------------------------------------- /nodes/images/whitecircle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/nodes/images/whitecircle.png -------------------------------------------------------------------------------- /nodes/nature/electricclouds.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Generates electric clouds type of effect for the source item.", 4 | "fragmentCode": [ 5 | "@requires NoiseHelper", 6 | "@main", 7 | "{", 8 | " vec2 uv = fragCoord.xy / iResolution.y;", 9 | " float cloudVal = 0.0;", 10 | " float sum = 0.0;", 11 | " float multiplier = 1.0;", 12 | " for (int i = 0; i < electricCloudLevels; i++) {", 13 | " vec3 noisePos = vec3(uv, iTime / multiplier);", 14 | " cloudVal += multiplier * abs(pseudo3dNoise(noisePos));", 15 | " sum += multiplier;", 16 | " multiplier *= 0.5;", 17 | " uv = 2.0 * uv;", 18 | " }", 19 | " cloudVal /= sum;", 20 | " fragColor.rgb = mix(fragColor.rgb, vec3(cos(TAU * cloudVal)) * electricCloudColor.rgb * fragColor.a, electricCloudColor.a);", 21 | "}" 22 | ], 23 | "name": "ElectricClouds", 24 | "properties": [ 25 | { 26 | "defaultValue": "6", 27 | "description": "The levels of details for the electic clouds. Bigger value means more detailed rending which also requires more processing power. The default value is 6 and practical range is between 1 and 10.", 28 | "maxValue": "10", 29 | "minValue": "1", 30 | "name": "electricCloudLevels", 31 | "type": "int" 32 | }, 33 | { 34 | "defaultValue": "1, 1, 1, 0.6", 35 | "description": "The color used for the clouds. Alpha channel defines the amount of opacity this effect has.", 36 | "name": "electricCloudColor", 37 | "type": "color" 38 | } 39 | ], 40 | "version": 1 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /nodes/nature/fog.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Generates fog/clouds/smoke effect.", 4 | "fragmentCode": [ 5 | "@main", 6 | "{", 7 | " float time = iTime * 0.5;", 8 | " float coordX = fract((fogMovement.x * time + texCoord.x) * fogTextureScale.x);", 9 | " float coordY = fract((fogMovement.y * time + texCoord.y) * fogTextureScale.y);", 10 | " vec2 fogCoord = vec2(coordX, coordY);", 11 | " vec4 fogTex = texture(fogTexture, fogCoord);", 12 | " float fog = dot(fogTex.rgb, fogAnimation.xyz);", 13 | " fragColor.rgb = mix(fragColor.rgb, fogColor.rgb * fragColor.a, fog * fogColor.a);", 14 | "}" 15 | ], 16 | "name": "Fog", 17 | "properties": [ 18 | { 19 | "defaultValue": "../images/fog.png", 20 | "description": "Texture for the fog effect. RGB layers are utilized as a separate fog sprites. This should support seamless tiling.", 21 | "name": "fogTexture", 22 | "type": "image" 23 | }, 24 | { 25 | "defaultValue": "1, 1", 26 | "description": "Scaling of the fog texture.", 27 | "maxValue": "2, 2", 28 | "minValue": "0.1, 0.1", 29 | "name": "fogTextureScale", 30 | "type": "vec2" 31 | }, 32 | { 33 | "defaultValue": "0, 0", 34 | "description": "Defines how the fog moves on x and y coordinates while it animates. The default value is (0, 0) so not moving and practical range between (-1.0, -1.0) and (1.0, 1.0).", 35 | "maxValue": "1, 1", 36 | "minValue": "-1, -1", 37 | "name": "fogMovement", 38 | "type": "vec2" 39 | }, 40 | { 41 | "defaultValue": "0.8, 0.8, 0.8, 1", 42 | "description": "Defines the color of the fog. The default value is light gray (0.8, 0.8, 0.8, 1.0).", 43 | "name": "fogColor", 44 | "type": "color" 45 | }, 46 | { 47 | "defaultValue": "1", 48 | "description": "Defines the speed how fast the fog frames are animated. The default value is 1.0.", 49 | "maxValue": "5", 50 | "minValue": "0", 51 | "name": "fogAnimationSpeed", 52 | "type": "float" 53 | } 54 | ], 55 | "version": 1, 56 | "vertexCode": [ 57 | "@mesh 16, 16", 58 | "out vec3 fogAnimation;", 59 | "// 1/3 and 2/3 of TAU", 60 | "#define TAU_13 2.09439510239", 61 | "#define TAU_23 4.18879020478", 62 | "@main", 63 | "{", 64 | " float time = iTime * fogAnimationSpeed;", 65 | " const float fogBaseOpacity = 0.3;", 66 | " float fogOpacityAnimation = (1.0 - fogBaseOpacity);", 67 | " // Animate fog opacity based on texCoord & time", 68 | " fogOpacityAnimation += 0.8 * sin(texCoord.x * 12.0 + sin(time * 0.2)) * sin(texCoord.y * 7.0 + sin(time * 0.35));", 69 | " // Animate RGB layers of fog texture like a sprite", 70 | " vec3 fogLayersAnimation = vec3(sin(time), sin(time + TAU_13), sin(time + TAU_23));", 71 | " fogAnimation = vec3(fogBaseOpacity) + fogLayersAnimation * fogOpacityAnimation;", 72 | "}" 73 | ] 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /nodes/nature/lava.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Adds lava effect to the source. The effect is based on texture so it is easy to adjust to different needs.", 4 | "fragmentCode": [ 5 | "@main", 6 | "{", 7 | " vec4 lavaTexture = texture(lavaImage, lavaTexturePos);", 8 | " vec4 lava = lavaTexture * lavaTextureColor;", 9 | " fragColor = mix(fragColor, lava * fragColor.a, lavaColor.a);", 10 | "}" 11 | ], 12 | "name": "Lava", 13 | "properties": [ 14 | { 15 | "defaultValue": "../images/lava.png", 16 | "description": "Lava texture image.", 17 | "name": "lavaImage", 18 | "type": "image" 19 | }, 20 | { 21 | "defaultValue": "1, 1, 0.5, 0.5", 22 | "description": "Color used as multiplier for the texture image. The alpha channel defines opacity for the effect.", 23 | "name": "lavaColor", 24 | "type": "color" 25 | }, 26 | { 27 | "defaultValue": "0.5", 28 | "description": "Speed how fast the effect animates.", 29 | "maxValue": "5", 30 | "minValue": "0.1", 31 | "name": "lavaAnimationSpeed", 32 | "type": "float" 33 | }, 34 | { 35 | "defaultValue": "0.2", 36 | "description": "The amount of movement used in the animation.", 37 | "maxValue": "1", 38 | "minValue": "0.01", 39 | "name": "lavaWaveAmount", 40 | "type": "float" 41 | } 42 | ], 43 | "version": 1, 44 | "vertexCode": [ 45 | "@mesh 16, 16", 46 | "out vec2 lavaTexturePos;", 47 | "out vec4 lavaTextureColor;", 48 | "@main", 49 | "{", 50 | " float time = iTime * lavaAnimationSpeed;", 51 | " lavaTexturePos = texCoord;", 52 | " lavaTexturePos.x += texCoord.x * (1.0 - texCoord.x) * lavaWaveAmount * sin((texCoord.y + sin(time * 0.3)) * 2.0);", 53 | " lavaTexturePos.y += texCoord.y * (1.0 - texCoord.y) * lavaWaveAmount * sin((texCoord.x + sin(time * 0.2)) * 3.0);", 54 | " float colorHighlights = 0.2 * (cos(texCoord.x * 16.0 + time) * cos(texCoord.y * 16.0));", 55 | " float colorHighlights2 = 0.4 * (cos(texCoord.x * 4.0+ time * 0.2) * cos(texCoord.y * 3.0 + time * 0.5));", 56 | " lavaTextureColor = lavaColor * (1.0 + colorHighlights + colorHighlights2);", 57 | "}", 58 | "" 59 | ] 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /nodes/nature/plasma.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "fragmentCode": [ 4 | "@main", 5 | "{", 6 | " float time = iTime * 0.2;", 7 | " vec2 a = vec2(iResolution.x / iResolution.y, 1.0);", 8 | " vec2 c = texCoord.xy * a * 2.0 + time * 0.45;", 9 | " float k = 0.25 + cos(c.y + sin(.148 - time)) + 3.2 * time;", 10 | " float w = 0.9 + sin(c.x + cos(.628 + time)) - 1.2 * time;", 11 | " float d = length(c);", 12 | " float s = (2.0 / (plasmaScale + 0.02)) * cos(d+w) * sin(k+w);", 13 | " vec4 plasma = vec4(0.5 + 0.5 * cos(s + plasmaColors.rgb), 1.0);", 14 | "#if PLASMA_ENABLE_SPECULAR == 1", 15 | " vec4 plasmaSpecularColor = vec4(0.8, 0.6, 0.4, 1.0);", 16 | " float plasmaSpecularDamper = 2.0;", 17 | " plasma *= (plasmaSpecularColor", 18 | " * pow(max(normalize(vec3(length(dFdx(plasma)), length(dFdy(plasma)), 0.5/iResolution.y)).z, 0.0), plasmaSpecularDamper)", 19 | " + 1.0);", 20 | "#endif", 21 | " fragColor = mix(fragColor, plasma * fragColor.a, plasmaColors.a);", 22 | "}" 23 | ], 24 | "name": "Plasma", 25 | "properties": [ 26 | { 27 | "defaultValue": "1", 28 | "description": "When this is set to 1, some specular reflection is added into the effect.", 29 | "name": "PLASMA_ENABLE_SPECULAR", 30 | "type": "define" 31 | }, 32 | { 33 | "defaultValue": "0.1, 0.4, 0.5, 0.5", 34 | "description": "Color used as a basis for the plasma effect.", 35 | "name": "plasmaColors", 36 | "type": "color" 37 | }, 38 | { 39 | "defaultValue": "0.2", 40 | "description": "The scale of the plasma waves. Practical range is between 0.0 and 1.0. The default value is 0.2.", 41 | "maxValue": "1", 42 | "minValue": "0", 43 | "name": "plasmaScale", 44 | "type": "float" 45 | } 46 | ], 47 | "version": 1 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /nodes/nature/rain.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Generates rain effect.", 4 | "fragmentCode": [ 5 | "@main", 6 | "{", 7 | " float rain = 0.0;", 8 | " float time = iTime * 0.4;", 9 | " for (int i = 0; i < rainLayers; i++) {", 10 | " float rainMovement = time * (1.0 + (float(i) / (rainLayers- i)) * 0.5);", 11 | " float coordY = fract(0.35 * i + texCoord.y * (rainTextureScale.y + i * rainTextureScale.w) - rainMovement);", 12 | " float coordX = fract(0.65 * i + (texCoord.x + rainWind * texCoord.y ) * (rainTextureScale.x + i * rainTextureScale.z));", 13 | " vec2 rainCoord = vec2(coordX, coordY);", 14 | " float rainTex = texture(rainTexture, rainCoord).a;", 15 | " float rainAlpha = float(i + 1.0) / rainLayers;", 16 | " rain += rainTex * rainAlpha;", 17 | " }", 18 | " vec3 rColor = rainColor.rgb * (1.0 / (0.01 + rainColor.a));", 19 | " fragColor.rgb = mix(fragColor.rgb, rColor * fragColor.a, rain * rainColor.a);", 20 | "}" 21 | ], 22 | "name": "Rain", 23 | "properties": [ 24 | { 25 | "defaultValue": "../images/rain.png", 26 | "description": "Texture for the rain effect. This should support seamless tiling.", 27 | "name": "rainTexture", 28 | "type": "image" 29 | }, 30 | { 31 | "defaultValue": "4", 32 | "description": "The amount of rain layers. Increasing the layers adds variation to the rain effect but also requires more processing power. The default value is 4 and practical range is between 1 and 10.", 33 | "maxValue": "10", 34 | "minValue": "1", 35 | "name": "rainLayers", 36 | "type": "int" 37 | }, 38 | { 39 | "defaultValue": "1, 0.5, 0.2, 0.1", 40 | "description": "Scaling of the rain texture. Values of x and y define scaling of the first rain layer and values z and w define the scaling step size of each following rain layer. So if values of z and w are 0.0, all rain layers have the same size.", 41 | "maxValue": "2, 2, 1, 1", 42 | "minValue": "0.1, 0.1, 0, 0", 43 | "name": "rainTextureScale", 44 | "type": "vec4" 45 | }, 46 | { 47 | "defaultValue": "0", 48 | "description": "Defines wind direction for the rain. The default value is 0.0 and practical range is between -1.0 and 1.0.", 49 | "maxValue": "1", 50 | "minValue": "-1", 51 | "name": "rainWind", 52 | "type": "float" 53 | }, 54 | { 55 | "defaultValue": "0.8, 0.8, 1, 1", 56 | "description": "Defines the color of the rain. The default value is light blue (0.8, 0.8, 1.0, 1.0).", 57 | "name": "rainColor", 58 | "type": "color" 59 | } 60 | ], 61 | "version": 1 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /nodes/nature/snowing.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "Generates snowing effect.", 4 | "fragmentCode": [ 5 | "@main", 6 | "{", 7 | " float snowing = 0.0;", 8 | " float time = iTime * 0.8;", 9 | " for (int i = 1; i < (1 + snowingLayers); i++) {", 10 | " // Divide layer into cells", 11 | " float cellAmount = 2.0 + (float(i) * 3.0);", 12 | " vec2 uv = vec2(texCoord.x, texCoord.y - time * snowingGravity * (1.0 / float(i)));", 13 | " vec2 uvStep = (ceil(uv * cellAmount - vec2(0.5, 0.5)) / cellAmount);", 14 | " float discardFlake = fract(sin(dot(uvStep.xy, vec2(32.4691, 94.615))) * 31572.1684);", 15 | " if (discardFlake < 0.3) {", 16 | " // Random positions inside the cell", 17 | " float x = fract(sin(dot(uvStep, vec2(12.9898, 78.233))) * 43758.5453) - 0.5;", 18 | " float y = fract(sin(dot(uvStep, vec2(62.2364, 94.674))) * 62159.8432) - 0.5;", 19 | " float maxMag = snowingVariation / (1.0 + snowingFlakeSize);", 20 | " float mag1 = maxMag / cellAmount * cos(time * 3.0);", 21 | " float mag2 = maxMag / cellAmount * sin(time * 3.0);", 22 | " float d = (2.0 / snowingFlakeSize) * distance((uvStep.xy + vec2(x , sin(y)) * mag1 + vec2(y, x) * mag2), uv);", 23 | " float snowd = (x + 1.0) * 0.5 * clamp((1.5 - d * (10.0 + (x * 5.0)) * cellAmount), 0.0, 1.0);", 24 | " snowing +=snowd;", 25 | " }", 26 | " }", 27 | " vec4 snowingColor = vec4(1.0, 1.0, 1.0, snowing);", 28 | " fragColor = mix(fragColor, snowingColor * fragColor.a, snowing);", 29 | "}" 30 | ], 31 | "name": "Snowing", 32 | "properties": [ 33 | { 34 | "defaultValue": "4", 35 | "description": "The amount of snow layers. Increasing the layers adds variation to the snowing effect, but also requires more processing power. The default value is 4 and practical range is between 1 and 10.", 36 | "maxValue": "10", 37 | "minValue": "1", 38 | "name": "snowingLayers", 39 | "type": "int" 40 | }, 41 | { 42 | "defaultValue": "1", 43 | "description": "Size of a single snowflake. The default value is 1.0 and practical range is between 0.2 and 2.0.", 44 | "maxValue": "2", 45 | "minValue": "0.2", 46 | "name": "snowingFlakeSize", 47 | "type": "float" 48 | }, 49 | { 50 | "defaultValue": "1", 51 | "description": "Defines gravity of the snowing effect so how fast the snowflakes fall down. The default value is 1.0 and practical range is between 0.2 and 2.0.", 52 | "maxValue": "2", 53 | "minValue": "0.2", 54 | "name": "snowingGravity", 55 | "type": "float" 56 | }, 57 | { 58 | "defaultValue": "0.5", 59 | "description": "Defines how much snowflakes positions vary while they are coming down. The default value is 0.5 and the range is between 0.0 and 1.0.", 60 | "maxValue": "1", 61 | "minValue": "0", 62 | "name": "snowingVariation", 63 | "type": "float" 64 | } 65 | ], 66 | "version": 1 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /nodes/nature/thunder.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "This is an empty node for creating custom effects.", 4 | "fragmentCode": [ 5 | "@requires NoiseHelper", 6 | "// Renders a thunder strike line", 7 | "float renderThunderStrike(vec2 p, float d)", 8 | "{", 9 | " // Vertical movement of the strike", 10 | " float w = 0.4;", 11 | " float r = 0.0;", 12 | " float s = 1.0;", 13 | " float sw = 1.0;", 14 | " // Create random line with noise", 15 | " for (int i=0; i<4; i++) {", 16 | " s *= 2.2;", 17 | " sw *= 0.35;", 18 | " r += sw * pseudo3dNoise(vec3(s * 2.0 * p.y, 1.0, 1.0)).x;", 19 | " }", 20 | " w *= r;", 21 | " return smoothstep(d, 0.0, abs(w - p.x));", 22 | "}", 23 | "", 24 | "@main", 25 | "{", 26 | " // Speed of the strikes", 27 | " float t = iTime * 2.0;", 28 | " uint tIndex = uint(floor(t));", 29 | " // Get set of random values per strike", 30 | " vec3 rand3 = _hash13(tIndex);", 31 | " if (rand3.x > (1.0 - thunderStrikeOccurrence)) {", 32 | " // Animater between 0..1..0", 33 | " float sTime = 2.0 * (0.5 - abs((t - tIndex) - 0.5));", 34 | " vec2 uv = 2.0 * texCoord - 1.0;", 35 | " uv.y = 1.0 - uv.y;", 36 | " vec2 uv2 = uv;", 37 | " // Lightning shape", 38 | " uv2.y += tIndex;", 39 | " // Lightning position", 40 | " // Wider so some strikes happen outside the item", 41 | " float px = (rand3.y - 0.5) * 3.0;", 42 | " uv2.x += px;", 43 | "", 44 | " float strikeWidth = (0.5 + rand3.z) * uv.y * 0.006;", 45 | " float strike = renderThunderStrike(uv2, strikeWidth);", 46 | " float glowWidth = 0.5 + 0.5 * sTime;", 47 | " float glow = renderThunderStrike(uv2, glowWidth) * sTime;", 48 | " float lightning = strike * 0.4 * sTime;", 49 | " // Reduce the strike height", 50 | " float strikeHeight = 1.5 - 2.0 * rand3.z;", 51 | " lightning *= smoothstep(strikeHeight, strikeHeight + 0.5, uv.y);", 52 | " lightning += glow * 0.2;", 53 | " float backgroundLight = 0.4 * sTime;", 54 | "", 55 | " float thunderAlpha = backgroundLight + lightning;", 56 | " float thunderStrength = 10.0;", 57 | " vec3 thunder = thunderColor.rgb * thunderAlpha * thunderStrength;", 58 | " fragColor = mix(fragColor, vec4(thunder.rgb, 1.0) * fragColor.a, thunderAlpha * thunderColor.a);", 59 | " }", 60 | "}" 61 | ], 62 | "name": "Thunder", 63 | "properties": [ 64 | { 65 | "defaultValue": "1, 0.9, 0.8, 0.5", 66 | "description": "Color used for the thunder strikes.", 67 | "name": "thunderColor", 68 | "type": "color" 69 | }, 70 | { 71 | "defaultValue": "0.1", 72 | "description": "Defines how often the strikes occur. Values are between 0 (never) and 1 (every time).", 73 | "maxValue": "1", 74 | "minValue": "0", 75 | "name": "thunderStrikeOccurrence", 76 | "type": "float" 77 | } 78 | ], 79 | "version": 1 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /nodes/nature/water.qen: -------------------------------------------------------------------------------- 1 | { 2 | "QEN": { 3 | "description": "This node generates a water waves effect.", 4 | "fragmentCode": [ 5 | "#define TAU 6.28318530718", 6 | "", 7 | "@main", 8 | "{", 9 | " const float time = 1.0 + iTime * 0.6;", 10 | " const vec2 uv = texCoord;", 11 | " const vec2 p = mod(uv * TAU, TAU) + 10.0;", 12 | " const float inten = 0.05;", 13 | " vec2 ip = p;", 14 | " float c = 0.0;", 15 | " for (int n = 0; n < WATER_ITERATIONS; n++) {", 16 | " float t = time * (1.0 / float(n + 0.4));", 17 | " ip = p + vec2(cos(t - ip.x) + sin(t + ip.y), sin(t - ip.y) + cos(t + ip.x));", 18 | " c += 1.0 / length(vec2(p.x / (sin(ip.x + t) / inten), p.y / (cos(ip.y + t) / inten)));", 19 | " }", 20 | " c /= float(WATER_ITERATIONS);", 21 | " c = max(0.0, 1.2 - (c * c));", 22 | " vec3 water = waterColor.rgb + vec3(pow(c, 4.0)) * (2.0 * waterWavesColor.rgb - 1.0);", 23 | " fragColor = mix(fragColor, vec4(water, 1.0) * fragColor.a, waterColor.a);", 24 | "}" 25 | ], 26 | "name": "Water", 27 | "properties": [ 28 | { 29 | "defaultValue": "4", 30 | "description": "How many water wave levels there are. More iterations means more resource usage. Meaningfull range is between 2 and 8.", 31 | "name": "WATER_ITERATIONS", 32 | "type": "define" 33 | }, 34 | { 35 | "defaultValue": "0, 0.2, 0.4, 0.5", 36 | "description": "Color used for the water. Alpha channel defines the opacity of the effect.", 37 | "name": "waterColor", 38 | "type": "color" 39 | }, 40 | { 41 | "defaultValue": "0.2, 0.8, 0.8, 1", 42 | "description": "Color used for the water waves.", 43 | "name": "waterWavesColor", 44 | "type": "color" 45 | } 46 | ], 47 | "version": 1 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(doc) 2 | -------------------------------------------------------------------------------- /src/doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(QtQuickEffectMakerDoc INTERFACE) 2 | qt_internal_add_docs(QtQuickEffectMakerDoc 3 | qtquickeffectmaker.qdocconf 4 | ) 5 | -------------------------------------------------------------------------------- /src/doc/images/add-custom-node.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/src/doc/images/add-custom-node.webp -------------------------------------------------------------------------------- /src/doc/images/blur-effect-nodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/src/doc/images/blur-effect-nodes.png -------------------------------------------------------------------------------- /src/doc/images/blur-effect-step-1.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/src/doc/images/blur-effect-step-1.webp -------------------------------------------------------------------------------- /src/doc/images/blur-effect-step-2.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/src/doc/images/blur-effect-step-2.webp -------------------------------------------------------------------------------- /src/doc/images/blur-effect-step-3.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/src/doc/images/blur-effect-step-3.webp -------------------------------------------------------------------------------- /src/doc/images/effect-item-borders-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/src/doc/images/effect-item-borders-icon.png -------------------------------------------------------------------------------- /src/doc/images/effect-item-padding-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/src/doc/images/effect-item-padding-dialog.png -------------------------------------------------------------------------------- /src/doc/images/effect-maker-export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/src/doc/images/effect-maker-export.png -------------------------------------------------------------------------------- /src/doc/images/qqem-online-installer.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/src/doc/images/qqem-online-installer.webp -------------------------------------------------------------------------------- /src/doc/images/qqem-start.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/src/doc/images/qqem-start.webp -------------------------------------------------------------------------------- /src/doc/images/vert-tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/src/doc/images/vert-tab.png -------------------------------------------------------------------------------- /src/doc/qtquickeffectmaker.qdocconf: -------------------------------------------------------------------------------- 1 | include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) 2 | 3 | project = QtQuickEffectMaker 4 | description = Qt Quick Effect Maker Documentation 5 | version = $QT_VERSION 6 | buildversion = Qt Quick Effect Maker | Commercial or GPLv3 7 | moduleheader = 8 | 9 | sourcedirs += src 10 | imagedirs += images 11 | 12 | examplesinstallpath = quickeffectmaker 13 | exampledirs += ../../examples/${examplesinstallpath} 14 | 15 | qhp.projects = QtQuickEffectMaker 16 | 17 | qhp.QtQuickEffectMaker.file = qtquickeffectmaker.qhp 18 | qhp.QtQuickEffectMaker.namespace = org.qt-project.qtquickeffectmaker.$QT_VERSION_TAG 19 | qhp.QtQuickEffectMaker.virtualFolder = qtquickeffectmaker 20 | qhp.QtQuickEffectMaker.indexTitle = Qt Quick Effect Maker 21 | qhp.QtQuickEffectMaker.indexRoot = 22 | 23 | qhp.QtQuickEffectMaker.filterAttributes = qtquickeffectmaker $QT_VERSION qtrefdoc 24 | qhp.QtQuickEffectMaker.customFilters.Qt.name = QtQuickEffectMaker $QT_VERSION 25 | qhp.QtQuickEffectMaker.customFilters.Qt.filterAttributes = qtquickeffectmaker $QT_VERSION 26 | 27 | qhp.QtQuickEffectMaker.subprojects = manual 28 | qhp.QtQuickEffectMaker.subprojects.manual.title = Qt Quick Effect Maker 29 | qhp.QtQuickEffectMaker.subprojects.manual.indexTitle = All Topics 30 | qhp.QtQuickEffectMaker.subprojects.manual.type = manual 31 | 32 | tagfile = qtquickeffectmaker.tags 33 | 34 | depends += \ 35 | qtdoc \ 36 | qtcore \ 37 | qtgui \ 38 | qtquick \ 39 | qtquickcontrols \ 40 | qtqml 41 | 42 | buildversion = "Qt Quick Effect Maker $QT_VERSION" 43 | 44 | navigation.landingpage = "Qt Quick Effect Maker" 45 | navigation.toctitles = "All Topics" 46 | 47 | macro.QQEM = "Qt Quick Effect Maker" 48 | -------------------------------------------------------------------------------- /src/doc/src/concepts/qqem-concept.qdoc: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2023 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only 3 | /*! 4 | \page qqem-concept.html 5 | 6 | \title About \QQEM 7 | 8 | */ 9 | -------------------------------------------------------------------------------- /src/doc/src/getting-started/qqem-create-effect.qdoc: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2023 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only 3 | /*! 4 | \page qqem-create-first-effect.html 5 | 6 | \title Creating your first effect 7 | 8 | */ 9 | -------------------------------------------------------------------------------- /src/doc/src/getting-started/qqem-installing.qdoc: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2024 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only 3 | /*! 4 | \page qqem-installing.html 5 | 6 | \title Installing \QQEM 7 | 8 | You can install \QQEM with Qt Online Installer or Qt Maintenance Tool. Download 9 | Qt Online Installer from \l{https://account.qt.io/s/downloads}{Qt Account Downloads}. 10 | 11 | To install \QQEM with Qt Online Installer. 12 | 13 | \list 1 14 | \li Open Qt Online Installer, continue to \uicontrol {Installation Folder}, and select 15 | \uicontrol {Custom installation}. 16 | \li Select \uicontrol {Next}. 17 | \li Go to \uicontrol Qt > \uicontrol {Qt 6.5} (or newer version) > 18 | \uicontrol {Additional Libraries} and select \uicontrol {\QQEM}. 19 | \li Complete the installation and close Qt Online installer. 20 | \endlist 21 | 22 | \image qqem-online-installer.webp 23 | 24 | \section1 Opening \QQEM 25 | 26 | To open \QQEM, run \c qqem.exe located in 27 | the \c bin folder of your Qt installation, for example, 28 | \e {C:\\Qt\\\QtVersion\\msvc2019_64\\bin}. 29 | */ 30 | -------------------------------------------------------------------------------- /src/doc/src/how-tos/qqem-creating-blur-effect.qdoc: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2023 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only 3 | /*! 4 | \page qqem-creating-blur-effect.html 5 | 6 | \title Creating a blur effect 7 | 8 | To create a blur effect in \QQEM: 9 | 10 | \list 1 11 | \li Add a \uicontrol FastBlur node to the node tree. 12 | \li Add a \uicontrol BlurHelper node to the node tree. You need the 13 | \uicontrol BlurHelper node for all effects that contains a blur effect. 14 | \image blur-effect-nodes.png 15 | \li Select the \uicontrol FastBlur node and in the settings, change 16 | the \uicontrol fastBlurAmount value to control the amount of blur. 17 | \image blur-effect-step-1.webp 18 | \endlist 19 | 20 | \section3 Adjusting item borders 21 | 22 | The effect appears cropped. You need to adjust item borders: 23 | 24 | \list 1 25 | \li Select \inlineimage effect-item-borders-icon.png 26 | to display item borders. 27 | \image blur-effect-step-2.webp 28 | \li Go to \uicontrol Edit > \uicontrol {Project Settings}. 29 | \li Set the item padding for all sides to 100. 30 | \image effect-item-padding-dialog.png 31 | \endlist 32 | 33 | Now, you can see the complete blur effect. 34 | 35 | \image blur-effect-step-3.webp 36 | 37 | */ 38 | -------------------------------------------------------------------------------- /src/doc/src/how-tos/qqem-porting-shadertoy.qdoc: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2023 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only 3 | /*! 4 | \page qqem-porting-shadertoy.html 5 | \title Porting Shadertoy effects to \QQEM 6 | 7 | You can use effects created in Shadertoy in \QQEM. When you use Shadertoy effects, consider 8 | the following: 9 | 10 | \list 11 | \li \QQEM doesn't support the following Shadertoy features: 12 | \list 13 | \li Multipass effects (Buffer tabs) 14 | \li Audio 15 | \li Cube maps 16 | \li 3D textures 17 | \endlist 18 | \li Shadertoy supports only fragment shaders and built-in textures. To improve the 19 | effect performance in \QQEM, move some calculations to the vertex shader and use 20 | custom images to simplify the shader code. 21 | \li The coordinate system differs between Shadertoy and \QQEM. In Shadertoy, the origin (0,0) 22 | is located in the lower-left corner while \QQEM has the origin in the upper-left corner. 23 | \endlist 24 | 25 | \section1 Using a Shadertoy effect in \QQEM 26 | 27 | To use a Shadertoy effect in \QQEM: 28 | \list 1 29 | \li In \QQEM, create a new effect. 30 | \li In the node editor, select \uicontrol {Add node} and then, under \uicontrol Common, 31 | select \uicontrol Custom. This creates an empty node. 32 | \image add-custom-node.webp 33 | \li In Shadertoy, copy all the code from the \uicontrol Image tab. 34 | \li In \QQEM, double-click the \uicontrol Custom node in the node editor. This opens the 35 | code editor. 36 | \li Paste the Shadertoy code to the \uicontrol Frag tab. 37 | \li Find the \c Main function in the code, it looks something like: 38 | \badcode 39 | void mainImage( out vec4 fragColor, in vec2 fragCoord ) 40 | \endcode 41 | \li Replace this line with: 42 | \badcode 43 | @main 44 | \endcode 45 | \note You can't have \c @main and the following \unicode 0x7B on the same line. 46 | \li Optional. If the effect depends on the coordinate system, it appears flipped 47 | upside down. To solve this, you need to flip the y-coordinate: 48 | \list 1 49 | \li Go to the \uicontrol Vert tab. 50 | \image vert-tab.png 51 | \li In the drop-down menu, select \uicontrol Main. 52 | \li Find the \c fragCoord line, it should look something like: 53 | \badcode 54 | fragCoord = qt_Vertex.xy; 55 | \endcode 56 | \li Replace this line with: 57 | \badcode 58 | fragCoord = vec2(qt_Vertex.x, iResolution.y - qt_Vertex.y); 59 | \endcode 60 | \li Similarly, you might need to adjust \c texCoord and \c iMouse. 61 | \endlist 62 | \endlist 63 | 64 | Now, the effect runs and looks the same as the Shadertoy effect. 65 | */ 66 | -------------------------------------------------------------------------------- /src/doc/src/qtquickeffectmaker.qdoc: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2023 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only 3 | /*! 4 | \page qtquickeffectmaker-index.html 5 | \title \QQEM 6 | 7 | \QQEM is a tool for creating shader effects for 8 | Qt Quick with high productivity and performance. You can run \QQEM 9 | as a standalone tool but it is also included in 10 | \l{https://doc.qt.io/qtdesignstudio/}{Qt Design Studio}. 11 | 12 | \image qqem-start.webp 13 | 14 | \section1 Feature overview 15 | 16 | The main features of \QQEM: 17 | 18 | \list 19 | \li \b {Live preview}: When you work with effects, you can see most changes instantly in the 20 | live preview. 21 | \li \b {Node view}: In the node view, you build effects without coding. There are 22 | over 30 nodes, including most of the Qt Graphical Effects. 23 | \li \b {Code view}: In the code view, you can edit the code of all effect node shaders. The 24 | code editor features include GLSL syntax highlighting, auto indent, search, and more. 25 | \li \b {Combined effects}: For increased performance, \QQEM combines all the 26 | effects in one shader. 27 | \li \b {JSON file format}: \QQEM stores project and node files in JSON format, 28 | making it easy to share files for increased productivity. 29 | \li \b {Shadertoy compatibility}: Variable naming in \QQEM is in most cases 30 | compatible with \l{http://www.shadertoy.com}{Shadertoy}, making it easy to port Shadertoy 31 | shaders to \QQEM and the other way around. Most Shadertoy features and some 32 | extra features, such as vertex shaders, custom textures, and properties, are supported. 33 | \li \b {Pure Qt Quick}: \QQEM is implemented with Qt Quick and 34 | Qt Quick Controls. The work flow is designed for Qt Quick and Qt RHI. 35 | \endlist 36 | 37 | \section1 Getting started 38 | 39 | \list 40 | \li \l{Installing \QQEM} 41 | \endlist 42 | 43 | \section1 How-to's 44 | 45 | \list 46 | \li \l{Creating a blur effect} 47 | \li \l{Porting Shadertoy effects to \QQEM} 48 | \endlist 49 | 50 | \section1 Examples 51 | 52 | \list 53 | \li \l{Wiggly}: Demonstrates how to use an effect created with \QQEM. 54 | \endlist 55 | */ 56 | 57 | /*! 58 | \group quickeffectmaker-examples 59 | \title \QQEM examples 60 | \brief Example usage of \QQEM. 61 | 62 | */ 63 | 64 | /*! 65 | \page qqem-toc.html 66 | \title All topics 67 | 68 | \list 69 | \li \l{\QQEM} 70 | \li Getting started 71 | \list 72 | \li \l {Installing \QQEM} 73 | \endlist 74 | \li How-tos 75 | \list 76 | \li \l{Creating a blur effect} 77 | \li \l{Porting Shadertoy effects to \QQEM} 78 | \endlist 79 | \li Examples 80 | \list 81 | \li \l{Wiggly} 82 | \endlist 83 | \endlist 84 | 85 | */ 86 | -------------------------------------------------------------------------------- /src/doc/src/reference/qqem-troubleshooting.qdoc: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2023 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only 3 | /*! 4 | \page qqem-troubleshooting.html 5 | 6 | \title Troubleshooting 7 | 8 | 9 | */ 10 | 11 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | if(QT_BUILD_STANDALONE_TESTS) 5 | # Add qt_find_package calls for extra dependencies that need to be found when building 6 | # the standalone tests here. 7 | endif() 8 | qt_build_tests() 9 | -------------------------------------------------------------------------------- /tests/auto/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | if(NOT CMAKE_CROSSCOMPILING AND NOT WASM) 5 | add_subdirectory(qtquickeffectmaker) 6 | endif() 7 | -------------------------------------------------------------------------------- /tests/auto/qtquickeffectmaker/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | qt_internal_add_test(tst_qtquickeffectmaker 5 | SOURCES 6 | tst_qtquickeffectmaker.cpp 7 | DEFINES 8 | SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" 9 | LIBRARIES 10 | Qt::Gui 11 | Qt::Qml 12 | Qt::QmlPrivate 13 | Qt::Quick 14 | Qt::QuickPrivate 15 | ) 16 | -------------------------------------------------------------------------------- /tests/auto/qtquickeffectmaker/tst_qtquickeffectmaker.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class Tst_QtQuickEffectMaker : public QObject 9 | { 10 | Q_OBJECT 11 | 12 | private Q_SLOTS: 13 | void dummyTest(); 14 | }; 15 | 16 | void Tst_QtQuickEffectMaker::dummyTest() 17 | { 18 | QSKIP("Dummy test, skipping."); 19 | } 20 | 21 | QTEST_MAIN(Tst_QtQuickEffectMaker) 22 | 23 | #include "tst_qtquickeffectmaker.moc" 24 | -------------------------------------------------------------------------------- /tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 The Qt Company Ltd. 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | add_subdirectory(qqem) 5 | -------------------------------------------------------------------------------- /tools/qqem/Info_mac.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrincipalClass 6 | NSApplication 7 | CFBundleIconFile 8 | @ICON@ 9 | CFBundlePackageType 10 | APPL 11 | CFBundleSignature 12 | ???? 13 | CFBundleIdentifier 14 | org.qt-project.qqem 15 | CFBundleExecutable 16 | @EXECUTABLE@ 17 | CFBundleDocumentTypes 18 | 19 | 20 | CFBundleTypeExtensions 21 | 22 | qep 23 | 24 | CFBundleTypeIconFile 25 | qqem.icns 26 | CFBundleTypeRole 27 | Editor 28 | LSIsAppleDefaultForType 29 | 30 | 31 | 32 | NSHumanReadableCopyright 33 | (C) 2023 The Qt Company Ltd 34 | 35 | 36 | -------------------------------------------------------------------------------- /tools/qqem/addnodemodel.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef ADDNODEMODEL_H 5 | #define ADDNODEMODEL_H 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | class EffectManager; 13 | 14 | struct NodeDataProperty { 15 | Q_GADGET 16 | Q_PROPERTY(QString name MEMBER m_name) 17 | Q_PROPERTY(QString type MEMBER m_type) 18 | public: 19 | QString m_name; 20 | QString m_type; 21 | }; 22 | 23 | class AddNodeModel : public QAbstractListModel 24 | { 25 | Q_OBJECT 26 | Q_PROPERTY(int rowCount READ rowCount NOTIFY rowCountChanged) 27 | 28 | public: 29 | struct NodeData { 30 | QString name; 31 | QString description; 32 | QString file; 33 | QString group; 34 | QStringList requiredNodes; 35 | // Properties as variant list to get access from QML 36 | QVariantList properties; 37 | // False when node would overlap with existing node in view 38 | bool canBeAdded = true; 39 | bool show = false; 40 | }; 41 | 42 | enum AddNodeModelRoles { 43 | Name = Qt::UserRole + 1, 44 | Description, 45 | File, 46 | Group, 47 | Properties, 48 | CanBeAdded, 49 | Show, 50 | RequiredNodes 51 | }; 52 | 53 | explicit AddNodeModel(QObject *effectManager); 54 | 55 | int rowCount(const QModelIndex & = QModelIndex()) const final; 56 | QVariant data(const QModelIndex &index, int role) const final; 57 | QHash roleNames() const final; 58 | 59 | void updateCanBeAdded(const QStringList &propertyNames); 60 | void updateShowHide(const QString &groupName, bool show); 61 | void updateNodesList(); 62 | 63 | signals: 64 | void rowCountChanged(); 65 | 66 | private: 67 | void loadNodesFromPath(const QString &path); 68 | QList m_modelList; 69 | EffectManager *m_effectManager = nullptr; 70 | 71 | }; 72 | 73 | bool operator==(const AddNodeModel::NodeData &a, const AddNodeModel::NodeData &b) noexcept; 74 | 75 | Q_DECLARE_METATYPE(NodeDataProperty); 76 | 77 | #endif // ADDNODEMODEL_H 78 | -------------------------------------------------------------------------------- /tools/qqem/arrowsmodel.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include "arrowsmodel.h" 5 | 6 | ArrowsModel::ArrowsModel(QObject *parent) 7 | : QAbstractListModel(parent) 8 | { 9 | connect(this, &QAbstractListModel::rowsInserted, this, &ArrowsModel::rowCountChanged); 10 | connect(this, &QAbstractListModel::rowsRemoved, this, &ArrowsModel::rowCountChanged); 11 | connect(this, &QAbstractListModel::modelReset, this, &ArrowsModel::rowCountChanged); 12 | } 13 | 14 | int ArrowsModel::rowCount(const QModelIndex &) const 15 | { 16 | return m_arrowsList.size(); 17 | } 18 | 19 | QHash ArrowsModel::roleNames() const 20 | { 21 | QHash roles; 22 | roles[StartX] = "startX"; 23 | roles[StartY] = "startY"; 24 | roles[EndX] = "endX"; 25 | roles[EndY] = "endY"; 26 | roles[StartNodeId] = "startNodeId"; 27 | roles[EndNodeId] = "endNodeId"; 28 | return roles; 29 | } 30 | 31 | QVariant ArrowsModel::data(const QModelIndex &index, int role) const 32 | { 33 | if (!index.isValid()) 34 | return QVariant(); 35 | 36 | if (index.row() >= m_arrowsList.size()) 37 | return false; 38 | 39 | const auto &node = (m_arrowsList)[index.row()]; 40 | 41 | if (role == StartX) 42 | return QVariant::fromValue(node.startX); 43 | else if (role == StartY) 44 | return QVariant::fromValue(node.startY); 45 | else if (role == EndX) 46 | return QVariant::fromValue(node.endX); 47 | else if (role == EndY) 48 | return QVariant::fromValue(node.endY); 49 | else if (role == StartNodeId) 50 | return QVariant::fromValue(node.startNodeId); 51 | else if (role == EndNodeId) 52 | return QVariant::fromValue(node.endNodeId); 53 | 54 | return QVariant(); 55 | } 56 | -------------------------------------------------------------------------------- /tools/qqem/arrowsmodel.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef ARROWSMODEL_H 5 | #define ARROWSMODEL_H 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | class ArrowsModel : public QAbstractListModel 12 | { 13 | Q_OBJECT 14 | Q_PROPERTY(int rowCount READ rowCount NOTIFY rowCountChanged) 15 | 16 | public: 17 | struct Arrow { 18 | float startX = 0; 19 | float startY = 0; 20 | float endX = 0; 21 | float endY = 0; 22 | int startNodeId = 0; 23 | int endNodeId = 1; 24 | bool operator==(const Arrow& rhs) const noexcept 25 | { 26 | return this->startNodeId == rhs.startNodeId; 27 | } 28 | }; 29 | 30 | enum NodesModelRoles { 31 | Type = Qt::UserRole + 1, 32 | StartX, 33 | StartY, 34 | EndX, 35 | EndY, 36 | StartNodeId, 37 | EndNodeId 38 | }; 39 | 40 | explicit ArrowsModel(QObject *parent = nullptr); 41 | 42 | int rowCount(const QModelIndex & = QModelIndex()) const final; 43 | QVariant data(const QModelIndex &index, int role) const final; 44 | QHash roleNames() const final; 45 | 46 | signals: 47 | void rowCountChanged(); 48 | 49 | private: 50 | friend class NodeView; 51 | friend class EffectManager; 52 | QList m_arrowsList; 53 | 54 | }; 55 | 56 | #endif // ARROWSMODEL_H 57 | -------------------------------------------------------------------------------- /tools/qqem/codecompletionmodel.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include "codecompletionmodel.h" 5 | #include "effectmanager.h" 6 | 7 | CodeCompletionModel::CodeCompletionModel(QObject *effectManager) 8 | : QAbstractListModel(effectManager) 9 | { 10 | m_effectManager = static_cast(effectManager); 11 | connect(this, &QAbstractListModel::modelReset, this, &CodeCompletionModel::rowCountChanged); 12 | } 13 | 14 | int CodeCompletionModel::rowCount(const QModelIndex &) const 15 | { 16 | return m_modelList.size(); 17 | } 18 | 19 | QHash CodeCompletionModel::roleNames() const 20 | { 21 | QHash roles; 22 | roles[Name] = "name"; 23 | roles[Type] = "type"; 24 | return roles; 25 | } 26 | 27 | QVariant CodeCompletionModel::data(const QModelIndex &index, int role) const 28 | { 29 | if (!index.isValid()) 30 | return QVariant(); 31 | 32 | const auto &data = (m_modelList)[index.row()]; 33 | 34 | if (role == Name) 35 | return QVariant::fromValue(data.name); 36 | else if (role == Type) 37 | return QVariant::fromValue(data.type); 38 | 39 | return QVariant(); 40 | } 41 | 42 | // Note: Doesn't reset the model, do that outside 43 | void CodeCompletionModel::addItem(const QString &text, int type) 44 | { 45 | ModelData data; 46 | data.name = text; 47 | data.type = type; 48 | m_modelList.append(data); 49 | } 50 | 51 | // Note: Doesn't reset the model, do that outside 52 | void CodeCompletionModel::clearItems() 53 | { 54 | m_modelList.clear(); 55 | } 56 | 57 | CodeCompletionModel::ModelData CodeCompletionModel::currentItem() 58 | { 59 | if (m_modelList.size() > m_currentIndex) 60 | return m_modelList.at(m_currentIndex); 61 | 62 | return CodeCompletionModel::ModelData(); 63 | } 64 | 65 | int CodeCompletionModel::currentIndex() const 66 | { 67 | return m_currentIndex; 68 | } 69 | 70 | void CodeCompletionModel::setCurrentIndex(int index) 71 | { 72 | if (m_currentIndex == index) 73 | return; 74 | m_currentIndex = index; 75 | Q_EMIT currentIndexChanged(); 76 | } 77 | 78 | void CodeCompletionModel::nextItem() 79 | { 80 | if (m_modelList.size() > m_currentIndex + 1) { 81 | m_currentIndex++; 82 | Q_EMIT currentIndexChanged(); 83 | } 84 | } 85 | 86 | void CodeCompletionModel::previousItem() 87 | { 88 | if (m_currentIndex > 0) { 89 | m_currentIndex--; 90 | Q_EMIT currentIndexChanged(); 91 | } 92 | } 93 | 94 | -------------------------------------------------------------------------------- /tools/qqem/codecompletionmodel.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef CODECOMPLETIONMODEL_H 5 | #define CODECOMPLETIONMODEL_H 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | class EffectManager; 13 | 14 | class CodeCompletionModel : public QAbstractListModel 15 | { 16 | Q_OBJECT 17 | Q_PROPERTY(int rowCount READ rowCount NOTIFY rowCountChanged) 18 | Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) 19 | 20 | public: 21 | struct ModelData { 22 | QString name; 23 | int type = 0; 24 | }; 25 | 26 | enum CodeCompletionModelRoles { 27 | Name = Qt::UserRole + 1, 28 | Type 29 | }; 30 | enum WordTypes { 31 | TypeArgument, 32 | TypeTag, 33 | TypeFunction 34 | }; 35 | 36 | explicit CodeCompletionModel(QObject *effectManager); 37 | 38 | int rowCount(const QModelIndex & = QModelIndex()) const final; 39 | QVariant data(const QModelIndex &index, int role) const final; 40 | QHash roleNames() const final; 41 | 42 | void addItem(const QString &text, int type); 43 | void clearItems(); 44 | CodeCompletionModel::ModelData currentItem(); 45 | int currentIndex() const; 46 | void setCurrentIndex(int index); 47 | 48 | void nextItem(); 49 | void previousItem(); 50 | 51 | signals: 52 | void rowCountChanged(); 53 | void currentIndexChanged(); 54 | 55 | private: 56 | friend class CodeHelper; 57 | QList m_modelList; 58 | EffectManager *m_effectManager = nullptr; 59 | int m_currentIndex = 0; 60 | }; 61 | 62 | #endif // CODECOMPLETIONMODEL_H 63 | -------------------------------------------------------------------------------- /tools/qqem/codehelper.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef CODEHELPER_H 5 | #define CODEHELPER_H 6 | 7 | #include 8 | #include 9 | #include 10 | #include "codecompletionmodel.h" 11 | 12 | class EffectManager; 13 | 14 | class CodeHelper : public QObject 15 | { 16 | Q_OBJECT 17 | Q_PROPERTY(CodeCompletionModel *codeCompletionModel READ codeCompletionModel NOTIFY codeCompletionModelChanged) 18 | Q_PROPERTY(bool codeCompletionVisible READ codeCompletionVisible WRITE setCodeCompletionVisible NOTIFY codeCompletionVisibleChanged) 19 | 20 | public: 21 | explicit CodeHelper(QObject *parent = nullptr); 22 | 23 | CodeCompletionModel *codeCompletionModel() const; 24 | bool codeCompletionVisible() const; 25 | 26 | public Q_SLOTS: 27 | bool processKey(QQuickTextEdit *textEdit, int keyCode, int modifiers); 28 | QString autoIndentGLSLCode(const QString &code); 29 | QString autoIndentGLSLNextLine(const QString &codeLine, bool multilineComment); 30 | QString getCurrentWord(QQuickTextEdit *textEdit); 31 | void removeCurrentWord(QQuickTextEdit *textEdit); 32 | void updateCodeCompletion(QQuickTextEdit *textEdit, bool force = false); 33 | void setCodeCompletionVisible(bool visible); 34 | void applyCodeCompletion(QQuickTextEdit *textEdit); 35 | 36 | signals: 37 | void codeCompletionModelChanged(); 38 | void codeCompletionVisibleChanged(); 39 | 40 | private: 41 | friend class EffectManager; 42 | 43 | void showCodeCompletion(); 44 | 45 | EffectManager *m_effectManager = nullptr; 46 | CodeCompletionModel *m_codeCompletionModel = nullptr; 47 | QQuickTextEdit *m_textEdit = nullptr; 48 | bool m_codeCompletionVisible = false; 49 | QTimer m_codeCompletionTimer; 50 | 51 | QList m_reservedArgumentNames; 52 | QList m_reservedTagNames; 53 | QList m_reservedFunctionNames; 54 | 55 | }; 56 | 57 | #endif // CODEHELPER_H 58 | -------------------------------------------------------------------------------- /tools/qqem/fpshelper.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include "fpshelper.h" 5 | 6 | FpsHelper::FpsHelper() 7 | { 8 | setFlag(QQuickItem::ItemHasContents); 9 | 10 | connect(this, &QQuickItem::enabledChanged, this, [this]() { 11 | if (isEnabled()) { 12 | m_frames = 0; 13 | m_timer.start(); 14 | update(); 15 | } 16 | }); 17 | 18 | if (isEnabled()) 19 | m_timer.start(); 20 | } 21 | 22 | float FpsHelper::fps() const 23 | { 24 | return m_fps; 25 | } 26 | 27 | QSGNode *FpsHelper::updatePaintNode(QSGNode *node, UpdatePaintNodeData *) 28 | { 29 | m_frames++; 30 | qint64 nsElapsed = m_timer.nsecsElapsed(); 31 | float ms = float(nsElapsed / 1000000.0); 32 | if (ms >= 1000.0f) { 33 | float fps = m_frames / (ms / 1000.0f); 34 | // Round to 0.2 accuracy 35 | fps = std::round(fps * 5.0f) / 5.0f; 36 | if (!qFuzzyCompare(fps, m_fps)) { 37 | m_fps = fps; 38 | Q_EMIT fpsChanged(); 39 | } 40 | m_frames = 0; 41 | m_timer.restart(); 42 | } 43 | 44 | // Call update in a loop if fps tracking is enabled 45 | if (isEnabled()) 46 | update(); 47 | 48 | return node; 49 | } 50 | -------------------------------------------------------------------------------- /tools/qqem/fpshelper.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef FPSHELPER_H 5 | #define FPSHELPER_H 6 | 7 | #include 8 | #include 9 | 10 | class FpsHelper : public QQuickItem 11 | { 12 | Q_OBJECT 13 | Q_PROPERTY(float fps READ fps NOTIFY fpsChanged) 14 | 15 | public: 16 | FpsHelper(); 17 | 18 | float fps() const; 19 | 20 | protected: 21 | QSGNode *updatePaintNode(QSGNode *node, UpdatePaintNodeData *) override; 22 | 23 | signals: 24 | void fpsChanged(); 25 | 26 | private: 27 | float m_fps = 0.0f; 28 | int m_frames = 0; 29 | QElapsedTimer m_timer; 30 | }; 31 | 32 | #endif // FPSHELPER_H 33 | -------------------------------------------------------------------------------- /tools/qqem/nodesmodel.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include "nodesmodel.h" 5 | 6 | NodesModel::NodesModel(QObject *parent) 7 | : QAbstractListModel(parent) 8 | { 9 | connect(this, &QAbstractListModel::rowsInserted, this, &NodesModel::rowCountChanged); 10 | connect(this, &QAbstractListModel::rowsRemoved, this, &NodesModel::rowCountChanged); 11 | connect(this, &QAbstractListModel::modelReset, this, &NodesModel::rowCountChanged); 12 | } 13 | 14 | int NodesModel::rowCount(const QModelIndex &) const 15 | { 16 | return m_nodesList.size(); 17 | } 18 | 19 | QHash NodesModel::roleNames() const 20 | { 21 | QHash roles; 22 | roles[Type] = "type"; 23 | roles[Name] = "name"; 24 | roles[X] = "x"; 25 | roles[Y] = "y"; 26 | roles[Width] = "width"; 27 | roles[Height] = "height"; 28 | roles[Selected] = "selected"; 29 | roles[NodeId] = "nodeId"; 30 | roles[Description] = "description"; 31 | roles[Disabled] = "disabled"; 32 | return roles; 33 | } 34 | 35 | QVariant NodesModel::data(const QModelIndex &index, int role) const 36 | { 37 | if (!index.isValid()) 38 | return QVariant(); 39 | 40 | if (index.row() >= m_nodesList.size()) 41 | return false; 42 | 43 | const auto &node = (m_nodesList)[index.row()]; 44 | 45 | if (role == Type) 46 | return QVariant::fromValue(node.type); 47 | else if (role == Name) 48 | return QVariant::fromValue(node.name); 49 | else if (role == X) 50 | return QVariant::fromValue(node.x); 51 | else if (role == Y) 52 | return QVariant::fromValue(node.y); 53 | else if (role == Width) 54 | return QVariant::fromValue(node.width); 55 | else if (role == Height) 56 | return QVariant::fromValue(node.height); 57 | else if (role == Selected) 58 | return QVariant::fromValue(node.selected); 59 | else if (role == NodeId) 60 | return QVariant::fromValue(node.nodeId); 61 | else if (role == Description) 62 | return QVariant::fromValue(node.description); 63 | else if (role == Disabled) 64 | return QVariant::fromValue(node.disabled); 65 | 66 | return QVariant(); 67 | } 68 | 69 | bool NodesModel::setData(const QModelIndex &index, const QVariant &value, int role) 70 | { 71 | if (!index.isValid()) 72 | return false; 73 | 74 | if (index.row() >= m_nodesList.size()) 75 | return false; 76 | 77 | auto &uniform = (m_nodesList)[index.row()]; 78 | 79 | if (role == Disabled) { 80 | uniform.disabled = value.toBool(); 81 | } 82 | 83 | emit dataChanged(index, index, {role}); 84 | 85 | return true; 86 | } 87 | 88 | NodesModel::Node *NodesModel::getNodeWithId(int id) 89 | { 90 | for (auto &node : m_nodesList) { 91 | if (node.nodeId == id) 92 | return &node; 93 | } 94 | return nullptr; 95 | } 96 | 97 | void NodesModel::setSelectedNode(Node *node) 98 | { 99 | if (m_selectedNode == node) 100 | return; 101 | 102 | m_selectedNode = node; 103 | Q_EMIT selectedNodeChanged(); 104 | } 105 | -------------------------------------------------------------------------------- /tools/qqem/nodesmodel.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef NODESMODEL_H 5 | #define NODESMODEL_H 6 | 7 | #include 8 | #include 9 | #include 10 | #include "uniformmodel.h" 11 | 12 | class NodesModel : public QAbstractListModel 13 | { 14 | Q_OBJECT 15 | Q_PROPERTY(int rowCount READ rowCount NOTIFY rowCountChanged) 16 | 17 | public: 18 | enum NodeType { 19 | SourceNode = 0, 20 | DestinationNode, 21 | CustomNode 22 | }; 23 | struct Node { 24 | int type = CustomNode; 25 | // Id of the model, must be unique! 26 | int nodeId = -1; 27 | float x = 0; 28 | float y = 0; 29 | float width = 0; 30 | float height = 0; 31 | QString name; 32 | bool selected = false; 33 | bool disabled = false; 34 | // These are helper positions when moving starts 35 | float startX = 0; 36 | float startY = 0; 37 | // This points to next connected node. -1 when not connected. 38 | int nextNodeId = -1; 39 | 40 | // Unforms from the node JSON 41 | // Note: These are not updated when the uniforms/properties change, 42 | // so don't use this to other things than checking JSON uniforms. 43 | QList jsonUniforms = {}; 44 | QString fragmentCode = {}; 45 | QString vertexCode = {}; 46 | QString qmlCode = {}; 47 | QString description = {}; 48 | bool operator==(const Node& rhs) const noexcept 49 | { 50 | return this->nodeId == rhs.nodeId; 51 | } 52 | bool operator!=(const Node& rhs) const noexcept 53 | { 54 | return !operator==(rhs); 55 | } 56 | }; 57 | 58 | enum NodesModelRoles { 59 | Type = Qt::UserRole + 1, 60 | Name, 61 | X, 62 | Y, 63 | Width, 64 | Height, 65 | Selected, 66 | NodeId, 67 | Description, 68 | Disabled 69 | }; 70 | 71 | explicit NodesModel(QObject *parent = nullptr); 72 | 73 | // Override from QAbstractItemModel 74 | int rowCount(const QModelIndex & = QModelIndex()) const final; 75 | QVariant data(const QModelIndex &index, int role) const final; 76 | bool setData(const QModelIndex &index, const QVariant &value, int role) final; 77 | QHash roleNames() const final; 78 | 79 | Node *getNodeWithId(int id); 80 | void setSelectedNode(Node *node); 81 | 82 | signals: 83 | void selectedNodeChanged(); 84 | void rowCountChanged(); 85 | 86 | private: 87 | friend class NodeView; 88 | friend class EffectManager; 89 | 90 | QList m_nodesList; 91 | Node m_emptyNode; 92 | Node *m_selectedNode = nullptr; 93 | }; 94 | 95 | #endif // NODESMODEL_H 96 | -------------------------------------------------------------------------------- /tools/qqem/propertyhandler.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #include "propertyhandler.h" 5 | 6 | QQmlPropertyMap g_propertyData; 7 | -------------------------------------------------------------------------------- /tools/qqem/propertyhandler.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef PROPERTYHANDLER_H 5 | #define PROPERTYHANDLER_H 6 | 7 | #include 8 | 9 | // This will be used for binding dynamic properties 10 | // changes between C++ and QML. 11 | extern QQmlPropertyMap g_propertyData; 12 | 13 | #endif // PROPERTYHANDLER_H 14 | -------------------------------------------------------------------------------- /tools/qqem/qml/AboutDialog.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | import QtQuick.Controls 6 | import "about_effect" 7 | 8 | CustomPopup { 9 | id: rootItem 10 | modal: true 11 | width: 400 12 | height: 260 13 | padding: 1 14 | 15 | AboutEffect1 { 16 | anchors.fill: parent 17 | timeRunning: rootItem.visible 18 | opacity: 0.5 19 | } 20 | 21 | Item { 22 | anchors.fill: parent 23 | anchors.margins: 10 24 | Column { 25 | width: parent.width 26 | spacing: 10 27 | Label { 28 | text: qsTr("Qt Quick Effect Maker") 29 | font.bold: true 30 | font.pixelSize: 22 31 | color: mainView.foregroundColor2 32 | } 33 | Label { 34 | text: qsTr("VERSION %1 (Built with Qt %2)").arg(Qt.application.version).arg(buildQtVersion); 35 | width: parent.width 36 | font.pixelSize: 18 37 | color: mainView.foregroundColor2 38 | } 39 | } 40 | Column { 41 | anchors.bottom: parent.bottom 42 | width: parent.width 43 | spacing: 10 44 | Label { 45 | text: qsTr("Copyright (C) The Qt Company Ltd and other contributors.") 46 | width: parent.width 47 | wrapMode: Label.WrapAtWordBoundaryOrAnywhere 48 | font.pixelSize: 14 49 | color: mainView.foregroundColor2 50 | } 51 | 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /tools/qqem/qml/ClearNodeViewDialog.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | import QtQuick.Controls 6 | import QtQuick.Dialogs 7 | 8 | CustomDialog { 9 | id: root 10 | 11 | title: qsTr("Clear Node View") 12 | width: 320 13 | height: 200 14 | modal: true 15 | focus: true 16 | standardButtons: Dialog.Yes | Dialog.No 17 | closePolicy: Popup.NoAutoClose 18 | 19 | Text { 20 | text: "Are you sure you want to delete all nodes?" 21 | font.pixelSize: 14 22 | color: mainView.foregroundColor2 23 | } 24 | 25 | onAccepted: { 26 | effectManager.cleanupNodeView(true); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tools/qqem/qml/CustomDialog.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | import QtQuick.Controls 6 | 7 | Dialog { 8 | id: rootItem 9 | Material.roundedScale: Material.SmallScale 10 | 11 | Overlay.modal: Rectangle { 12 | color: "#B0000000" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tools/qqem/qml/CustomIconButton.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | import QtQuick.Controls 6 | 7 | Item { 8 | id: rootItem 9 | 10 | property string icon 11 | property string toggledIcon 12 | property string description 13 | property bool toggleButton: false 14 | property bool toggled: false 15 | 16 | signal clicked 17 | 18 | Image { 19 | id: iconImage 20 | property real effectiveOpacity: 1.0 21 | anchors.centerIn: parent 22 | height: parent.height * 0.8 23 | width: parent.width * 0.8 24 | fillMode: Image.PreserveAspectFit 25 | source: (toggleButton && toggled) ? rootItem.toggledIcon : rootItem.icon 26 | mipmap: true 27 | opacity: rootItem.enabled ? effectiveOpacity : 0.3 28 | } 29 | MouseArea { 30 | id: iconButtomMouseArea 31 | anchors.fill: parent 32 | hoverEnabled: true 33 | onClicked: { 34 | if (!toggleButton) 35 | clickAnimation.restart(); 36 | rootItem.clicked(); 37 | } 38 | } 39 | SequentialAnimation { 40 | id: clickAnimation 41 | NumberAnimation { 42 | target: iconImage 43 | property: "effectiveOpacity" 44 | to: 0.5 45 | easing.type: Easing.InOutQuad 46 | duration: 200 47 | } 48 | NumberAnimation { 49 | target: iconImage 50 | property: "effectiveOpacity" 51 | to: 1.0 52 | easing.type: Easing.InOutQuad 53 | duration: 200 54 | } 55 | } 56 | ToolTip { 57 | parent: rootItem 58 | visible: iconButtomMouseArea.containsMouse && description 59 | delay: 1000 60 | text: description 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /tools/qqem/qml/CustomImageSelector.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | import QtQuick.Controls 6 | 7 | Item { 8 | id: rootItem 9 | 10 | property string currentImage: imagesModel ? imagesModel.currentImageFile : "" 11 | property string description 12 | property int currentIndex: 0 13 | property var imagesModel: null 14 | property bool open: false 15 | property bool showAddButton: false 16 | 17 | signal addPressed 18 | 19 | height: parent.height - 20 20 | width: height 21 | 22 | onCurrentIndexChanged: { 23 | imagesModel.setImageIndex(currentIndex); 24 | } 25 | 26 | Item { 27 | anchors.fill: parent 28 | Rectangle { 29 | anchors.fill: parent 30 | color: mainView.backgroundColor2 31 | border.color: mainView.foregroundColor1 32 | opacity: 0.8 33 | radius: 4 34 | } 35 | Image { 36 | id: currentImageItem 37 | anchors.fill: parent 38 | anchors.margins: 6 39 | source: rootItem.currentImage 40 | fillMode: Image.PreserveAspectFit 41 | mipmap: true 42 | sourceSize: Qt.size(128, 128) 43 | } 44 | } 45 | MouseArea { 46 | id: mouseArea 47 | anchors.fill: parent 48 | hoverEnabled: true 49 | onClicked: { 50 | rootItem.open = !rootItem.open; 51 | } 52 | } 53 | 54 | Column { 55 | id: imageSelector 56 | anchors.top: parent.bottom 57 | visible: rootItem.open 58 | Repeater { 59 | model: imagesModel 60 | Item { 61 | width: rootItem.width 62 | height: rootItem.height 63 | Rectangle { 64 | anchors.fill: parent 65 | color: mainView.backgroundColor2 66 | border.color: mainView.foregroundColor1 67 | border.width: 1 68 | opacity: 0.8 69 | } 70 | Image { 71 | anchors.fill: parent 72 | anchors.margins: 6 73 | source: model.file 74 | fillMode: Image.PreserveAspectFit 75 | mipmap: true 76 | sourceSize: Qt.size(128, 128) 77 | } 78 | MouseArea { 79 | anchors.fill: parent 80 | onClicked: { 81 | rootItem.currentIndex = index; 82 | rootItem.open = false; 83 | } 84 | } 85 | } 86 | } 87 | // Optionally show add button as the last item 88 | Rectangle { 89 | width: rootItem.width 90 | height: rootItem.height 91 | visible: rootItem.showAddButton 92 | color: mainView.backgroundColor1 93 | border.color: mainView.foregroundColor2 94 | border.width: 1 95 | radius: 4 96 | Image { 97 | anchors.fill: parent 98 | anchors.margins: 6 99 | source: "images/icon_add.png" 100 | fillMode: Image.PreserveAspectFit 101 | mipmap: true 102 | } 103 | MouseArea { 104 | anchors.fill: parent 105 | onClicked: { 106 | rootItem.addPressed(); 107 | rootItem.open = false; 108 | } 109 | } 110 | } 111 | } 112 | ToolTip { 113 | parent: rootItem 114 | visible: mouseArea.containsMouse 115 | delay: 1000 116 | text: description 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /tools/qqem/qml/CustomModeToggle.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | import QtQuick.Controls 6 | 7 | Item { 8 | id: rootItem 9 | 10 | property bool toggled: false 11 | property real toggledAnimated: toggled 12 | property alias animatedToggle: toggleBehavior.enabled 13 | property string textOn: "" 14 | property string textOff: "" 15 | property string description 16 | 17 | readonly property real imageScale: (288 / 128) 18 | 19 | height: 64 20 | width: height * imageScale 21 | 22 | Behavior on toggledAnimated { 23 | id: toggleBehavior 24 | NumberAnimation { 25 | duration: 400 26 | easing.type: Easing.InOutQuad 27 | } 28 | } 29 | 30 | Image { 31 | id: backgroundImage 32 | anchors.fill: parent 33 | source: "images/toggle_background.png" 34 | mipmap: true 35 | opacity: 0.5 36 | } 37 | Image { 38 | anchors.fill: parent 39 | source: "images/toggle_m1.png" 40 | mipmap: true 41 | opacity: 1.0 - rootItem.toggledAnimated 42 | } 43 | Image { 44 | anchors.fill: parent 45 | source: "images/toggle_m2.png" 46 | mipmap: true 47 | opacity: rootItem.toggledAnimated 48 | } 49 | Text { 50 | anchors.verticalCenter: parent.verticalCenter 51 | anchors.horizontalCenter: parent.horizontalCenter 52 | anchors.horizontalCenterOffset: -5 53 | text: rootItem.textOff 54 | font.pixelSize: 14 55 | font.bold: true 56 | color: mainView.foregroundColor2 57 | opacity: rootItem.toggledAnimated 58 | } 59 | Text { 60 | anchors.verticalCenter: parent.verticalCenter 61 | anchors.horizontalCenter: parent.horizontalCenter 62 | anchors.horizontalCenterOffset: 5 63 | text: rootItem.textOn 64 | font.pixelSize: 14 65 | color: mainView.foregroundColor2 66 | font.bold: true 67 | opacity: 1.0 - rootItem.toggledAnimated 68 | } 69 | Rectangle { 70 | readonly property real marg: parent.height * 0.30 71 | anchors.verticalCenter: parent.verticalCenter 72 | height: parent.height - (2 * marg) 73 | width: height * 0.4 74 | x: marg + toggledAnimated * (rootItem.width - width - 2 * marg) 75 | radius: width * 0.5 76 | color: mainView.foregroundColor2 77 | border.width: 1 78 | border.color: mainView.foregroundColor1 79 | rotation: toggledAnimated * 180 80 | } 81 | MouseArea { 82 | id: customToggleMouseArea 83 | anchors.fill: parent 84 | hoverEnabled: true 85 | onClicked: { 86 | rootItem.toggled = !rootItem.toggled; 87 | } 88 | } 89 | ToolTip { 90 | parent: rootItem 91 | visible: customToggleMouseArea.containsMouse && description 92 | delay: 1000 93 | text: description 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /tools/qqem/qml/CustomPopup.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | import QtQuick.Controls 6 | 7 | Popup { 8 | id: rootItem 9 | Overlay.modal: Rectangle { 10 | color: "#B0000000" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tools/qqem/qml/CustomSplitView.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | import QtQuick.Controls 6 | 7 | SplitView { 8 | id: mainSplitView 9 | 10 | handle: Rectangle { 11 | implicitWidth: parent.orientation === Qt.Horizontal ? 6 : parent.width 12 | implicitHeight: parent.orientation === Qt.Horizontal ? parent.height : 6 13 | color: Qt.lighter(mainView.backgroundColor1, 1.2) 14 | Image { 15 | x: (parent.width - width) / 2 16 | y: (parent.height - height) / 2 17 | source:"images/icon_viewseparator.png" 18 | rotation: parent.parent.orientation === Qt.Horizontal ? 90 : 0 19 | opacity: parent.SplitHandle.pressed ? 1.0 : parent.SplitHandle.hovered ? 0.6 : 0.2 20 | width: 32 21 | height: 8 22 | Behavior on opacity { 23 | NumberAnimation { 24 | duration: 200 25 | } 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tools/qqem/qml/CustomTextEdit.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | 6 | Item { 7 | id: rootItem 8 | 9 | property alias text: textItem.text 10 | 11 | Rectangle { 12 | id: descriptionItem 13 | anchors.fill: parent 14 | color: mainView.backgroundColor2 15 | border.width: 1 16 | border.color: mainView.foregroundColor1 17 | } 18 | Flickable { 19 | id: flickableItem 20 | width: textItem.width 21 | height: textItem.height 22 | contentWidth: textItem.width 23 | contentHeight: textItem.contentHeight + 20 24 | clip: true 25 | boundsBehavior: Flickable.StopAtBounds 26 | function ensureVisible(r) { 27 | if (contentX >= r.x) 28 | contentX = r.x; 29 | else if (contentX+width <= r.x+r.width) 30 | contentX = r.x+r.width-width; 31 | if (contentY >= r.y) 32 | contentY = r.y; 33 | else if (contentY+height <= r.y+r.height) 34 | contentY = r.y+r.height-height; 35 | } 36 | TextEdit { 37 | id: textItem 38 | width: rootItem.width 39 | height: rootItem.height 40 | padding: 10 41 | wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere 42 | onCursorRectangleChanged: flickableItem.ensureVisible(cursorRectangle) 43 | color: mainView.foregroundColor2 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /tools/qqem/qml/CustomTextField.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | import QtQuick.Controls.Basic as ControlStyle 6 | 7 | ControlStyle.TextField { 8 | background: Rectangle { 9 | color: mainView.backgroundColor2 10 | border.color: mainView.foregroundColor1 11 | border.width: 1 12 | } 13 | color: mainView.foregroundColor2 14 | font.pixelSize: 14 15 | } 16 | -------------------------------------------------------------------------------- /tools/qqem/qml/DeleteNodeDialog.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | import QtQuick.Controls 6 | import QtQuick.Dialogs 7 | 8 | CustomDialog { 9 | id: root 10 | 11 | title: qsTr("Delete Selected Nodes") 12 | width: 320 13 | height: 200 14 | modal: true 15 | focus: true 16 | standardButtons: Dialog.Yes | Dialog.No 17 | closePolicy: Popup.NoAutoClose 18 | 19 | Text { 20 | width: parent.width 21 | text: "Are you sure you want to delete the selected nodes?" 22 | font.pixelSize: 14 23 | color: mainView.foregroundColor2 24 | wrapMode: Text.WordWrap 25 | } 26 | 27 | onAccepted: { 28 | mainView.nodeViewItem.deleteSelectedNodes(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tools/qqem/qml/FindBar.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | import QtQuick.Controls 6 | import QtQuick.Layouts 7 | 8 | Rectangle { 9 | id: rootItem 10 | 11 | property bool show: false 12 | property bool stringNotFound: currentEditorComponent ? currentEditorComponent.stringNotFound : false 13 | 14 | function setFindString(findString) { 15 | findTextField.text = findString; 16 | findTextField.selectAll(); 17 | findTextField.focus = true; 18 | } 19 | function findNext() { 20 | if (currentEditorComponent) 21 | currentEditorComponent.findNext(findTextField.text); 22 | } 23 | function findPrev() { 24 | if (currentEditorComponent) 25 | currentEditorComponent.findPrev(findTextField.text); 26 | } 27 | 28 | Layout.fillWidth: true 29 | height: 44 30 | visible: rootItem.show 31 | enabled: visible 32 | color: mainView.backgroundColor1 33 | 34 | RowLayout { 35 | id: findTextRow 36 | width: parent.width 37 | anchors.verticalCenter: parent.verticalCenter 38 | spacing: 5 39 | Item { 40 | width: 5 41 | height: 1 42 | } 43 | Text { 44 | font.pixelSize: 14 45 | color: mainView.foregroundColor2 46 | text: "Find:" 47 | } 48 | CustomTextField { 49 | id: findTextField 50 | Layout.fillWidth: true 51 | onAccepted: { 52 | findNext(); 53 | } 54 | Item { 55 | id: stringNotFoundItem 56 | 57 | readonly property alias show: rootItem.stringNotFound 58 | property real showAnimated: show 59 | 60 | anchors.fill: parent 61 | anchors.margins: -1 62 | z: -1 63 | opacity: showAnimated 64 | visible: opacity > 0 65 | Rectangle { 66 | anchors.fill: parent 67 | color: "#dd4040" 68 | } 69 | Behavior on showAnimated { 70 | NumberAnimation { 71 | duration: 400 72 | easing.type: Easing.InOutQuad 73 | } 74 | } 75 | } 76 | } 77 | Button { 78 | id: findPrevButton 79 | Layout.preferredHeight: 40 80 | text: "Previous" 81 | onClicked: { 82 | findPrev(); 83 | } 84 | Action { 85 | shortcut: StandardKey.FindPrevious 86 | enabled: rootItem.show 87 | onTriggered: { 88 | findPrev(); 89 | } 90 | } 91 | } 92 | Button { 93 | id: findNextButton 94 | Layout.preferredHeight: 40 95 | text: "Next" 96 | onClicked: { 97 | findNext(); 98 | } 99 | Action { 100 | shortcut: StandardKey.FindNext 101 | enabled: rootItem.show 102 | onTriggered: { 103 | findNext(); 104 | } 105 | } 106 | } 107 | CustomIconButton { 108 | height: 22 109 | width: height 110 | icon: "images/icon_remove_shadow.png" 111 | onClicked: { 112 | mainView.showFindBar = false; 113 | } 114 | } 115 | Item { 116 | width: 1 117 | height: 1 118 | } 119 | } 120 | } 121 | 122 | -------------------------------------------------------------------------------- /tools/qqem/qml/HelpView.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | 6 | Item { 7 | id: rootItem 8 | 9 | Rectangle { 10 | anchors.fill: parent 11 | color: mainView.backgroundColor1 12 | } 13 | 14 | Flickable { 15 | id: helpFlickable 16 | anchors.fill: parent 17 | contentWidth: helpTextEdit.width 18 | contentHeight: helpTextEdit.height 19 | clip: true 20 | TextEdit { 21 | id: helpTextEdit 22 | padding: 20 23 | width: helpFlickable.width 24 | wrapMode: TextEdit.WordWrap 25 | color: mainView.foregroundColor2 26 | textFormat: TextEdit.RichText 27 | readOnly: true 28 | selectByMouse: true 29 | text: effectManager.getHelpTextString(); 30 | font.pixelSize: 14 31 | onLinkActivated: (link)=> Qt.openUrlExternally(link) 32 | MouseArea { 33 | anchors.fill: parent 34 | acceptedButtons: Qt.NoButton 35 | cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tools/qqem/qml/MainToolbar.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | import QtQuick.Controls 6 | 7 | Item { 8 | id: rootItem 9 | 10 | property bool designMode: !designModeToggle.toggled 11 | property real designModeAnimated: 1.0 - designModeToggle.toggledAnimated 12 | 13 | function setDesignMode(mode) { 14 | designModeToggle.toggled = !mode; 15 | } 16 | 17 | function setDesignModeInstantly(mode) { 18 | mainView.switchDesignModeInstantly = true; 19 | designModeToggle.toggled = !mode; 20 | mainView.switchDesignModeInstantly = false; 21 | } 22 | 23 | Rectangle { 24 | width: parent.width 25 | height: 50 26 | color: backgroundColor1 27 | } 28 | CustomModeToggle { 29 | id: designModeToggle 30 | anchors.left: parent.left 31 | anchors.leftMargin: 5 32 | anchors.verticalCenter: parent.verticalCenter 33 | height: parent.height - 10 34 | textOff: "CODE" 35 | textOn: "DESIGN" 36 | description: rootItem.designMode ? "Switch to Code mode" : "Switch to Design mode" 37 | animatedToggle: !mainView.switchDesignModeInstantly 38 | } 39 | Item { 40 | id: designModeToolbar 41 | anchors.left: designModeToggle.right 42 | anchors.leftMargin: 10 43 | anchors.right: parent.right 44 | height: parent.height 45 | opacity: designModeAnimated 46 | visible: opacity 47 | CustomIconButton { 48 | id: alignHorizontallyButton 49 | anchors.verticalCenter: parent.verticalCenter 50 | height: parent.height * 0.6 51 | width: height 52 | icon: "images/icon_layout_nodes.png" 53 | description: "Align nodes horizontally" 54 | onClicked: { 55 | nodeViewItem.layoutNodes(false); 56 | } 57 | } 58 | CustomIconButton { 59 | id: distributeVerticallyButton 60 | anchors.verticalCenter: parent.verticalCenter 61 | anchors.left: alignHorizontallyButton.right 62 | height: parent.height * 0.6 63 | width: height 64 | icon: "images/icon_distribute_nodes.png" 65 | description: "Distribute nodes vertically" 66 | onClicked: { 67 | nodeViewItem.layoutNodes(true); 68 | } 69 | } 70 | } 71 | Item { 72 | id: codeModeToolbar 73 | anchors.left: designModeToggle.right 74 | anchors.leftMargin: 10 75 | anchors.right: parent.right 76 | height: parent.height 77 | opacity: 1.0 - designModeAnimated 78 | visible: opacity 79 | ComboBox { 80 | anchors.verticalCenter: parent.verticalCenter 81 | height: 40 82 | width: parent.width * 0.5 83 | model: effectManager.nodeView.codeSelectorModel 84 | currentIndex: effectManager.nodeView.codeSelectorIndex 85 | onActivated: { 86 | var nodeId = effectManager.nodeView.getNodeIdWithName(currentText); 87 | effectManager.nodeView.selectSingleNode(nodeId); 88 | } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /tools/qqem/qml/NewProjectDialog.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | import QtQuick.Layouts 6 | import QtQuick.Controls 7 | import QtQuick.Window 8 | import QtQuick.Dialogs 9 | import QtCore 10 | 11 | CustomDialog { 12 | id: root 13 | 14 | property string defaultPath: StandardPaths.standardLocations(StandardPaths.DesktopLocation)[0] 15 | property bool clearNodeView: false 16 | property bool exportNext: false 17 | 18 | title: qsTr("New Effect Project") 19 | width: 540 20 | height: 400 21 | modal: true 22 | focus: true 23 | standardButtons: Dialog.Ok | Dialog.Cancel 24 | closePolicy: Popup.NoAutoClose 25 | 26 | Component.onCompleted: { 27 | pathTextEdit.text = effectManager.stripFileFromURL(defaultPath); 28 | nameTextEdit.text = "Effect01" 29 | } 30 | 31 | FolderDialog { 32 | id: projectPathDialog 33 | currentFolder: defaultPath 34 | onAccepted: { 35 | if (currentFolder) { 36 | // Remove file start 37 | var usedFolder = effectManager.stripFileFromURL(currentFolder.toString()); 38 | pathTextEdit.text = usedFolder; 39 | } 40 | } 41 | } 42 | 43 | GridLayout { 44 | width: parent.width 45 | columns: 3 46 | columnSpacing: 20 47 | Label { 48 | text: qsTr("Name:") 49 | font.bold: true 50 | font.pixelSize: 14 51 | color: mainView.foregroundColor2 52 | } 53 | CustomTextField { 54 | id: nameTextEdit 55 | Layout.columnSpan: 2 56 | Layout.fillWidth: true 57 | text: effectManager.projectName 58 | } 59 | Label { 60 | text: qsTr("Create in:") 61 | font.bold: true 62 | font.pixelSize: 14 63 | color: mainView.foregroundColor2 64 | } 65 | CustomTextField { 66 | id: pathTextEdit 67 | Layout.fillWidth: true 68 | text: effectManager.projectFilename 69 | } 70 | Button { 71 | Layout.preferredHeight: 40 72 | text: qsTr("Browse"); 73 | onClicked: { 74 | projectPathDialog.open(); 75 | } 76 | } 77 | } 78 | onAccepted: { 79 | mainView.mainToolbar.setDesignModeInstantly(true); 80 | effectManager.newProject(pathTextEdit.text, nameTextEdit.text, clearNodeView, true); 81 | if (root.exportNext) { 82 | // Proceed next with exporting 83 | mainWindow.exportAction(); 84 | root.exportNext = false; 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /tools/qqem/qml/OutputView.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | import QtQuick.Controls 6 | import QtQuick.Layouts 7 | import QQEMLib 1.0 8 | 9 | Item { 10 | id: rootItem 11 | 12 | property alias outputEditorView: outputEditorView 13 | property alias effectPreview: effectPreview 14 | 15 | function showHelp() { 16 | tabBarViews.currentIndex = 2; 17 | } 18 | function showCodePreview() { 19 | tabBarViews.currentIndex = 1; 20 | } 21 | 22 | function renderToImage(filename) { 23 | effectPreview.renderToImage(filename); 24 | } 25 | 26 | FpsHelper { 27 | id: fpsHelper 28 | enabled: previewAnimationRunning 29 | } 30 | 31 | TabBar { 32 | id: tabBarViews 33 | currentIndex: 0 34 | TabButton { 35 | text: "Preview" 36 | width: 100 37 | } 38 | TabButton { 39 | text: "Code" 40 | width: 100 41 | } 42 | TabButton { 43 | text: "Help" 44 | width: 100 45 | } 46 | } 47 | Rectangle { 48 | anchors.fill: toolbarRow 49 | color: mainView.backgroundColor1 50 | opacity: 0.8 51 | } 52 | Row { 53 | id: toolbarRow 54 | anchors.right: parent.right 55 | anchors.verticalCenter: tabBarViews.verticalCenter 56 | height: tabBarViews.height * 0.8 57 | PlaybackTimeComponent { 58 | id: playbackTimeComponent 59 | } 60 | Item { 61 | width: 10 62 | height: 1 63 | } 64 | CustomIconButton { 65 | id: resetTimeButton 66 | height: parent.height 67 | width: height 68 | icon: "images/icon_restart.png" 69 | description: "Restart time" 70 | onClicked: { 71 | // Reset the time to 0 72 | previewFrameTimer.reset(); 73 | playbackTimeComponent.reset(); 74 | } 75 | } 76 | CustomIconButton { 77 | id: playPauseButton 78 | height: parent.height 79 | width: height 80 | icon: previewAnimationRunning ? "images/icon_pause.png" : "images/icon_play.png" 81 | description: "Play / Pause time" 82 | onClicked: { 83 | previewAnimationRunning = !previewAnimationRunning; 84 | } 85 | } 86 | } 87 | 88 | EffectPreview { 89 | id: effectPreview 90 | anchors.top: tabBarViews.bottom 91 | anchors.bottom: statusBar.top 92 | width: parent.width 93 | FrameAnimation { 94 | id: previewFrameTimer 95 | running: true 96 | paused: !previewAnimationRunning 97 | } 98 | } 99 | EditorView { 100 | id: outputEditorView 101 | anchors.top: tabBarViews.bottom 102 | anchors.bottom: statusBar.top 103 | width: parent.width 104 | editable: false 105 | visible: tabBarViews.currentIndex == 1 106 | } 107 | HelpView { 108 | id: helpView 109 | anchors.top: tabBarViews.bottom 110 | anchors.bottom: statusBar.top 111 | width: parent.width 112 | visible: tabBarViews.currentIndex == 2 113 | } 114 | 115 | StatusBar { 116 | id: statusBar 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /tools/qqem/qml/RenameNodeDialog.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | import QtQuick.Controls 6 | 7 | CustomDialog { 8 | id: rootItem 9 | title: qsTr("Rename Node") 10 | width: 400 11 | height: 340 12 | modal: true 13 | focus: true 14 | function checkNameOK() { 15 | // Name must not be empty 16 | var name = nameTextItem.text; 17 | var button = rootItem.standardButton(Dialog.Ok); 18 | if (name.length < 1) { 19 | button.enabled = false; 20 | } else { 21 | button.enabled = true; 22 | } 23 | } 24 | 25 | CustomTextField { 26 | id: nameTextItem 27 | width: parent.width 28 | text: effectManager.nodeView.selectedNodeName 29 | onTextChanged: { 30 | checkNameOK(); 31 | } 32 | } 33 | CustomTextEdit { 34 | id: descriptionTextItem 35 | anchors.top: nameTextItem.bottom 36 | anchors.topMargin: 10 37 | anchors.bottom: parent.bottom 38 | width: parent.width 39 | text: effectManager.nodeView.selectedNodeDescription 40 | Text { 41 | anchors.centerIn: parent 42 | text: "(Description)" 43 | visible: descriptionTextItem.text === "" 44 | color: mainView.foregroundColor1 45 | font.pixelSize: 16 46 | } 47 | } 48 | 49 | standardButtons: Dialog.Ok | Dialog.Cancel 50 | onAccepted: { 51 | effectManager.nodeView.selectedNodeName = nameTextItem.text; 52 | effectManager.nodeView.selectedNodeDescription = descriptionTextItem.text; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /tools/qqem/qml/SaveProjectDialog.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | import QtQuick 5 | import QtQuick.Controls 6 | import QtQuick.Dialogs 7 | 8 | CustomDialog { 9 | id: root 10 | 11 | // Which action user is trying to do when this dialog gets shown 12 | // 0: New Project 13 | // 1: Open Project 14 | // 2: Close Project 15 | // 3: Close Application 16 | property int action: -1 17 | 18 | // File user is trying to open when this dialog gets shown 19 | property string openFileName: "" 20 | 21 | title: qsTr("Save Project Changes") 22 | width: 320 23 | height: 200 24 | modal: true 25 | focus: true 26 | standardButtons: Dialog.Save | Dialog.Discard | Dialog.Cancel 27 | closePolicy: Popup.NoAutoClose 28 | 29 | Text { 30 | width: parent.width 31 | text: "Project '" + effectManager.projectName + "' contains unsaved changes." 32 | font.pixelSize: 14 33 | color: mainView.foregroundColor2 34 | wrapMode: Text.WordWrap 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tools/qqem/qml/about_effect/AboutEffect1.qml: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause 3 | 4 | // Created with Qt Quick Effect Maker (version 0.43), Mon Mar 27 11:23:23 2023 5 | 6 | import QtQuick 7 | 8 | Item { 9 | id: rootItem 10 | 11 | // Enable this to animate iTime property 12 | property bool timeRunning: false 13 | // When timeRunning is false, this can be used to control iTime manually 14 | property real animatedTime: frameAnimation.elapsedTime 15 | 16 | // Defines the vignette color. The default value is black (0, 0, 0, 1). 17 | property color vignetteColor: Qt.rgba(0, 0, 0, 1) 18 | // Inner radius from the center where vignette effect starts from. The value should be smaller than vignetteOuterRadius. The default value is 0.2. 19 | property real vignetteInnerRadius: 0.2 20 | // Outer radius from the center where vignette effect ends to. The value should be bigger than vignetteInnerRadius. The default value is 0.8. 21 | property real vignetteOuterRadius: 0.8 22 | 23 | FrameAnimation { 24 | id: frameAnimation 25 | running: rootItem.timeRunning 26 | } 27 | 28 | ShaderEffect { 29 | readonly property alias iTime: rootItem.animatedTime 30 | readonly property alias vignetteColor: rootItem.vignetteColor 31 | readonly property alias vignetteInnerRadius: rootItem.vignetteInnerRadius 32 | readonly property alias vignetteOuterRadius: rootItem.vignetteOuterRadius 33 | 34 | vertexShader: 'abouteffect1.vert.qsb' 35 | fragmentShader: 'abouteffect1.frag.qsb' 36 | anchors.fill: parent 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /tools/qqem/qml/about_effect/abouteffect1.frag.qsb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/about_effect/abouteffect1.frag.qsb -------------------------------------------------------------------------------- /tools/qqem/qml/about_effect/abouteffect1.vert.qsb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/about_effect/abouteffect1.vert.qsb -------------------------------------------------------------------------------- /tools/qqem/qml/fonts/REUSE.toml: -------------------------------------------------------------------------------- 1 | version = 1 2 | 3 | [[annotations]] 4 | path = ["*"] 5 | precedence = "closest" 6 | SPDX-FileCopyrightText = "Copyright 2010, 2012 Adobe Systems Incorporated" 7 | SPDX-License-Identifier = "OFL-1.1" 8 | -------------------------------------------------------------------------------- /tools/qqem/qml/fonts/SourceCodePro-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/fonts/SourceCodePro-Bold.ttf -------------------------------------------------------------------------------- /tools/qqem/qml/fonts/SourceCodePro-It.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/fonts/SourceCodePro-It.ttf -------------------------------------------------------------------------------- /tools/qqem/qml/fonts/SourceCodePro-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/fonts/SourceCodePro-Regular.ttf -------------------------------------------------------------------------------- /tools/qqem/qml/images/background_colorful.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/background_colorful.jpg -------------------------------------------------------------------------------- /tools/qqem/qml/images/background_dark.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/background_dark.jpg -------------------------------------------------------------------------------- /tools/qqem/qml/images/background_light.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/background_light.jpg -------------------------------------------------------------------------------- /tools/qqem/qml/images/button_qsb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/button_qsb.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/button_show.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/button_show.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_add.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_api.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_api_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_api_on.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_arrow.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_arrow_down.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_arrow_up.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_autoplay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_autoplay.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_autoplay_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_autoplay_on.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_borders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_borders.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_borders_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_borders_on.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_distribute_nodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_distribute_nodes.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_edit.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_error.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_export.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_layout_nodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_layout_nodes.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_pause.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_play.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_remove_shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_remove_shadow.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_requires.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_requires.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_reset.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_restart.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_settings.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_settings_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_settings_on.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_soften.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_soften.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_soften_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_soften_on.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_viewseparator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_viewseparator.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_visibility_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_visibility_off.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_visibility_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_visibility_on.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_zoom_auto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_zoom_auto.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_zoom_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_zoom_in.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/icon_zoom_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/icon_zoom_out.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/item_border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/item_border.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/nodeview_background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/nodeview_background.jpg -------------------------------------------------------------------------------- /tools/qqem/qml/images/toggle_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/toggle_background.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/toggle_m1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/toggle_m1.png -------------------------------------------------------------------------------- /tools/qqem/qml/images/toggle_m2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qml/images/toggle_m2.png -------------------------------------------------------------------------------- /tools/qqem/qqem.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qqem.icns -------------------------------------------------------------------------------- /tools/qqem/qqem.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qt/qtquickeffectmaker/3fc8d9876d03bb919579ae2ba1113d6a7afc8b09/tools/qqem/qqem.ico -------------------------------------------------------------------------------- /tools/qqem/qsbinspectorhelper.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef QSBINSPECTORHELPER_H 5 | #define QSBINSPECTORHELPER_H 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | // Model for common qsb information 12 | struct QsbShaderData { 13 | Q_GADGET 14 | Q_PROPERTY(QString currentFile MEMBER m_currentFile) 15 | Q_PROPERTY(QString stage MEMBER m_stage) 16 | Q_PROPERTY(QString reflectionInfo MEMBER m_reflectionInfo) 17 | Q_PROPERTY(int qsbVersion MEMBER m_qsbVersion) 18 | Q_PROPERTY(int shaderCount MEMBER m_shaderCount) 19 | Q_PROPERTY(int size MEMBER m_size) 20 | public: 21 | QString m_currentFile; 22 | QString m_stage; 23 | QString m_reflectionInfo; 24 | int m_qsbVersion = 0; 25 | int m_shaderCount = 0; 26 | int m_size = 0; 27 | }; 28 | 29 | // Model for shaders and their index in the qsb 30 | struct ShaderSelectorData { 31 | Q_GADGET 32 | Q_PROPERTY(QString name MEMBER m_name) 33 | Q_PROPERTY(int sourceIndex MEMBER m_sourceIndex) 34 | public: 35 | QString m_name; 36 | int m_sourceIndex; 37 | }; 38 | 39 | class QsbInspectorHelper : public QObject 40 | { 41 | Q_OBJECT 42 | Q_PROPERTY(QsbShaderData shaderData READ shaderData NOTIFY shaderDataChanged) 43 | Q_PROPERTY(QVariantList sourceSelectorModel READ sourceSelectorModel NOTIFY sourceSelectorModelChanged) 44 | Q_PROPERTY(int currentSourceIndex READ currentSourceIndex WRITE setCurrentSourceIndex NOTIFY currentSourceIndexChanged) 45 | Q_PROPERTY(QString currentSourceCode READ currentSourceCode NOTIFY currentSourceCodeChanged) 46 | 47 | public: 48 | explicit QsbInspectorHelper(QObject *parent = nullptr); 49 | 50 | QsbShaderData shaderData() const; 51 | QVariantList sourceSelectorModel() const; 52 | int currentSourceIndex() const; 53 | QString currentSourceCode() const; 54 | 55 | public Q_SLOTS: 56 | bool loadQsb(const QString &filename); 57 | void setCurrentSourceIndex(int index); 58 | 59 | Q_SIGNALS: 60 | void shaderDataChanged(); 61 | void sourceSelectorModelChanged(); 62 | void currentSourceIndexChanged(); 63 | void currentSourceCodeChanged(); 64 | 65 | private: 66 | QsbShaderData m_shaderData; 67 | QVariantList m_sourceSelectorModel; 68 | int m_currentSourceIndex = -1; 69 | QStringList m_sourceCodes; 70 | }; 71 | 72 | Q_DECLARE_METATYPE(QsbShaderData); 73 | 74 | #endif // QSBINSPECTORHELPER_H 75 | -------------------------------------------------------------------------------- /tools/qqem/qtquickcontrols2.conf: -------------------------------------------------------------------------------- 1 | [Controls] 2 | Style=Material 3 | 4 | [Universal] 5 | Theme=Dark 6 | Accent="#2aafd3" 7 | 8 | [Material] 9 | Theme=Dark 10 | Accent="#2aafd3" 11 | Foreground="#e0e0e0" 12 | Primary="#1f1f1f" 13 | Background="#1f1f1f" 14 | Variant=Dense 15 | -------------------------------------------------------------------------------- /tools/qqem/shaderfeatures.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | // Qt-Security score:critical reason:data-parser 4 | 5 | #include "shaderfeatures.h" 6 | #include 7 | #include 8 | 9 | ShaderFeatures::ShaderFeatures() 10 | { 11 | } 12 | 13 | // Browse the shaders and check which features are used in them. 14 | void ShaderFeatures::update(const QString &vs, const QString &fs, const QString &qml) 15 | { 16 | QStringList vsList = vs.split("\n"); 17 | QStringList fsList = fs.split("\n"); 18 | 19 | QStringList code = vsList + fsList; 20 | Features newFeatures = {}; 21 | m_gridMeshWidth = 1; 22 | m_gridMeshHeight = 1; 23 | for (const auto &line : code) 24 | checkLine(line, newFeatures); 25 | 26 | // iTime may also be used in QML side, without being used in shaders. 27 | // In this case enable the time helpers creation. 28 | if (qml.contains("iTime")) 29 | newFeatures.setFlag(Time, true); 30 | 31 | if (newFeatures != m_enabledFeatures) 32 | m_enabledFeatures = newFeatures; 33 | } 34 | 35 | void ShaderFeatures::checkLine(const QString &line, Features &features) { 36 | if (line.contains("iTime")) 37 | features.setFlag(Time, true); 38 | 39 | if (line.contains("iFrame")) 40 | features.setFlag(Frame, true); 41 | 42 | if (line.contains("iResolution")) 43 | features.setFlag(Resolution, true); 44 | 45 | if (line.contains("iSource")) 46 | features.setFlag(Source, true); 47 | 48 | if (line.contains("iMouse")) 49 | features.setFlag(Mouse, true); 50 | 51 | if (line.contains("fragCoord")) 52 | features.setFlag(FragCoord, true); 53 | 54 | if (line.contains("@mesh")) { 55 | // Get the mesh size, remove "@mesh" 56 | QString l = line.trimmed().sliced(5); 57 | QStringList list = l.split(QLatin1Char(',')); 58 | if (list.size() >= 2) { 59 | int w = list.at(0).trimmed().toInt(); 60 | int h = list.at(1).trimmed().toInt(); 61 | // Set size to max values 62 | m_gridMeshWidth = std::max(m_gridMeshWidth, w); 63 | m_gridMeshHeight = std::max(m_gridMeshHeight, h); 64 | } 65 | // If is bigger than default (1, 1), set the feature 66 | if (m_gridMeshWidth > 1 || m_gridMeshHeight > 1) 67 | features.setFlag(GridMesh, true); 68 | } 69 | if (line.contains("@blursources")) 70 | features.setFlag(BlurSources, true); 71 | } 72 | -------------------------------------------------------------------------------- /tools/qqem/shaderfeatures.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef SHADERFEATURES_H 5 | #define SHADERFEATURES_H 6 | 7 | #include 8 | #include 9 | 10 | class ShaderFeatures 11 | { 12 | public: 13 | enum Feature { 14 | Time = 1 << 0, 15 | Frame = 1 << 1, 16 | Resolution = 1 << 2, 17 | Source = 1 << 3, 18 | Mouse = 1 << 4, 19 | FragCoord = 1 << 5, 20 | GridMesh = 1 << 6, 21 | BlurSources = 1 << 7 22 | }; 23 | Q_DECLARE_FLAGS(Features, Feature) 24 | 25 | ShaderFeatures(); 26 | void update(const QString &vs, const QString &fs, const QString &qml); 27 | 28 | bool enabled(ShaderFeatures::Feature feature) const { 29 | return m_enabledFeatures.testFlag(feature); 30 | } 31 | private: 32 | friend class EffectManager; 33 | void checkLine(const QString &line, ShaderFeatures::Features &features); 34 | ShaderFeatures::Features m_enabledFeatures; 35 | int m_gridMeshWidth = 1; 36 | int m_gridMeshHeight = 1; 37 | }; 38 | 39 | Q_DECLARE_OPERATORS_FOR_FLAGS(ShaderFeatures::Features) 40 | 41 | #endif // SHADERFEATURES_H 42 | -------------------------------------------------------------------------------- /tools/qqem/syntaxhighlighter.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef SYNTAXHIGHLIGHTER_H 5 | #define SYNTAXHIGHLIGHTER_H 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | class SyntaxHighlighter : public QSyntaxHighlighter 14 | { 15 | Q_OBJECT 16 | Q_PROPERTY(QQuickTextDocument *document READ document WRITE setDocument NOTIFY documentChanged) 17 | QML_ELEMENT 18 | public: 19 | enum BlockState 20 | { 21 | None, 22 | Comment 23 | }; 24 | 25 | explicit SyntaxHighlighter(QObject *p = nullptr); 26 | 27 | // Shadows 28 | QQuickTextDocument *document() const; 29 | void setDocument(QQuickTextDocument *newDocument); 30 | 31 | signals: 32 | void documentChanged(); 33 | 34 | protected: 35 | void highlightBlock(const QString &text) final; 36 | QPointer m_quickTextDocument; 37 | QSet m_tagKeywords; 38 | QSet m_argumentKeywords; 39 | 40 | private: 41 | void highlightLine(const QString &text, int position, int length, const QTextCharFormat &format); 42 | }; 43 | 44 | #endif // SYNTAXHIGHLIGHTER_H 45 | -------------------------------------------------------------------------------- /tools/qqem/syntaxhighlighterdata.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 The Qt Company Ltd. 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only 3 | 4 | #ifndef SYNTAXHIGHLIGHTERDATA_H 5 | #define SYNTAXHIGHLIGHTERDATA_H 6 | 7 | #include 8 | #include 9 | 10 | class SyntaxHighlighterData 11 | { 12 | public: 13 | SyntaxHighlighterData(); 14 | 15 | static QList reservedArgumentNames(); 16 | static QList reservedTagNames(); 17 | static QList reservedFunctionNames(); 18 | }; 19 | 20 | #endif // SYNTAXHIGHLIGHTERDATA_H 21 | --------------------------------------------------------------------------------