diff --git a/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/FireEffect.qml b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/FireEffect.qml new file mode 100644 index 0000000000000000000000000000000000000000..3f77268617dc248c5a4b1a1895e0e4280be20a43 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/FireEffect.qml @@ -0,0 +1,139 @@ +import QtQuick +import QtQuick3D +import QtQuick3D.Particles3D +import QtQuick3D.Helpers + +ParticleSystem3D { + id: root + + property vector3d volume: Qt.vector3d(20, 20, 20) + property real intensity: 0.5 + property real size: 0.5 + + property color color: "#db9b60" + running: root.visible + + ParticleEmitter3D { + id: fireEmitter + property real multiplier: (root.volume.x / 10) * (root.volume.y / 10) + * (root.volume.z / 10) * root.intensity + x: 0 + particleScale: 20 * root.size + + enabled: root.visible + emitRate: 10 * root.intensity * fireEmitter.multiplier + particleRotation.x: 0 + particleRotationVariation.x: 360 + lifeSpanVariation: 0 + particleRotationVariation.z: 360 + system: root + particleEndScaleVariation: 20 * root.size + particleRotationVelocityVariation.y: 90 + particleEndScale: 20 * root.size + particleRotationVelocityVariation.z: 90 + ModelParticle3D { + id: fireParticle + color: "#ffffff" + unifiedColorVariation: false + fadeInDuration: 1250 + hasTransparency: true + colorVariation.z: 1 + sortMode: Particle3D.SortDistance + fadeOutDuration: 250 + colorVariation.y: 1 + alignMode: Particle3D.AlignNone + maxAmount: 100 * root.intensity * fireEmitter.multiplier + colorVariation.x: 1 + colorVariation.w: 1 + } + + ParticleShape3D { + id: fireArea + extents: root.volume + } + particle: fireParticle + particleRotation.y: 360 + particleScaleVariation: 20 * root.size + particleRotationVelocity.y: 0 + particleRotationVelocityVariation.x: 90 + shape: fireArea + lifeSpan: 1500 + particleRotationVariation.y: 360 + particleRotationVelocity.x: 0 + particleRotationVelocity.z: 0 + particleRotation.z: 360 + } + + Gravity3D { + id: fireGravity + particles: fireParticle + system: root + magnitude: 300 + direction.y: 1 + } + + Model { + source: "#Sphere" + castsReflections: true + castsShadows: true + receivesShadows: true + scale.z: 0.1 + instancing: fireParticle.instanceTable + materials: fireMat + scale.y: 0.1 + scale.x: 0.1 + receivesReflections: true + } + + Wander3D { + id: fireWander + uniqueAmount.x: 10 + uniquePace.x: 0.1 + globalPaceStart.z: 0.1 + globalAmount.z: 5 + system: root + uniquePaceVariation: 1 + globalPace.y: 0.1 + uniquePace.y: 0.1 + particles: fireParticle + uniquePace.z: 0.1 + globalPaceStart.y: 0.1 + uniqueAmount.z: 10 + globalPaceStart.x: 0.1 + globalPace.x: 0.1 + uniqueAmountVariation: 1 + globalAmount.x: 5 + globalPace.z: 0.1 + } + + Node { + id: __materialLibrary__ + + CustomMaterial { + id: fireMat + cullMode: Material.BackFaceCulling + property color baseColor: root.color + property real opacity: root.opacity + property TextureInput dfMask: null + depthDrawMode: Material.NeverDepthDraw + objectName: "Fire Material" + sourceBlend: CustomMaterial.SrcColor + destinationBlend: CustomMaterial.OneMinusSrcAlpha + TextureInput { + id: firetexinput + texture: firetex + enabled: true + } + + Texture { + id: firetex + source: "images/fire.png" + generateMipmaps: true + mipFilter: Texture.Linear + } + vertexShader: "shaders/fire.vert" + fragmentShader: "shaders/fire.frag" + shadingMode: CustomMaterial.Shaded + } + } +} diff --git a/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/_asset_ref.json b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/_asset_ref.json new file mode 100644 index 0000000000000000000000000000000000000000..2886a161b417fbfacdda6d436359ff9b93de0239 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/_asset_ref.json @@ -0,0 +1,23 @@ +{ + "designer/fire.metainfo": [ + "FireEffect.qml" + ], + "designer/images/material.png": [ + "FireEffect.qml" + ], + "designer/images/material16.png": [ + "FireEffect.qml" + ], + "designer/images/material@2x.png": [ + "FireEffect.qml" + ], + "images/fire.png": [ + "FireEffect.qml" + ], + "shaders/fire.frag": [ + "FireEffect.qml" + ], + "shaders/fire.vert": [ + "FireEffect.qml" + ] +} diff --git a/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/designer/fire.metainfo b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/designer/fire.metainfo new file mode 100644 index 0000000000000000000000000000000000000000..446067cf5f3b36b09d0706378e96b7ffb1b4a011 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/designer/fire.metainfo @@ -0,0 +1,20 @@ +MetaInfo { + Type { + name: "ComponentBundles.EffectBundle.Fire" + icon: "images/material16.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Fire" + category: "" + libraryIcon: "images/material.png" + version: "1.0" + requiredImport: "ComponentBundles.EffectBundle" + } + } +} diff --git a/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/designer/images/material.png b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/designer/images/material.png new file mode 100644 index 0000000000000000000000000000000000000000..e39bda7944e1f33052608ebbc25eaab614483fa6 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/designer/images/material.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc1e1674b239730bcec93be0e2b93c665ecc20e57098be637da401abac4ca05b +size 333 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/designer/images/material16.png b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/designer/images/material16.png new file mode 100644 index 0000000000000000000000000000000000000000..4c22ae9169a60c94f43b32e64fd27a6ca2fb0235 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/designer/images/material16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28dc5a98224ba3418bd64baec84ce3bc9e16dede7838f797f085210d90409497 +size 314 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/designer/images/material@2x.png b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/designer/images/material@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..1a8ea3f84cac620fef4f98266c04aa72a13b5772 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/designer/images/material@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8abe051df801948a8768a405ef6c61ecce60bdcc6c6cbfe68e0b715e12ae25a7 +size 621 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/images/fire.png b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/images/fire.png new file mode 100644 index 0000000000000000000000000000000000000000..dd95d234ce6a61575253dd1d03e053b45bfb62ef --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/images/fire.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa086fa1fb245e6caace11360a5fc8da636cc18c860f10e89adfdd61f88f5c5e +size 236372 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/qmldir b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/qmldir new file mode 100644 index 0000000000000000000000000000000000000000..557b2a40241ef3e7743be0765601baff5e9d73e6 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/qmldir @@ -0,0 +1,2 @@ +module Bundles.EffectBundle +FireEffect 1.0 FireEffect.qml diff --git a/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/shaders/fire.frag b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/shaders/fire.frag new file mode 100644 index 0000000000000000000000000000000000000000..f8e89e922697678b67d0c21a245adc86ed3ae383 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/shaders/fire.frag @@ -0,0 +1,59 @@ +VARYING vec2 vTexCoord; +VARYING vec4 vColor; +VARYING vec3 vNormal; + +float fresnel = 1.0; + +void MAIN(){ + BASE_COLOR = vec4(0.0); + + fresnel = smoothstep(0.0,1.0,abs(dot(VIEW_VECTOR,VAR_WORLD_NORMAL))); +} + +void POST_PROCESS() +{ + vec2 centerCoord = vTexCoord*2.0-1.0; + float centerDist = smoothstep(1.0,0.0,length(centerCoord)); + + vec2 screenPos = gl_FragCoord.xy/textureSize(SCREEN_TEXTURE, 0); + vec2 screenCoord = (screenPos); + + float distortion = 1.*centerDist; + + //screenCoord.x = centerCoord.x > 0.0 ? mix(screenCoord.x, 0.0,centerCoord.x*distortion) : mix(screenCoord.x, 1.0,-centerCoord.x*distortion); + + //screenCoord.y = centerCoord.y > 0.0 ? mix(screenCoord.y, 0.0,centerCoord.y*distortion) : mix(screenCoord.y, 1.0,-centerCoord.y*distortion); + + //if (FRAMEBUFFER_Y_UP < 0.0) // effectively: if not OpenGL + //screencoord.y = 1.0 - screencoord.y; + + float depthSample = texture(DEPTH_TEXTURE, screenCoord).x; + //vec4 sceneSample = texture(SCREEN_TEXTURE, screenCoord); + + //COLOR_SUM = vec4(vec3(vTexCoord,0.0)*centerDist,centerDist); + + vec3 fNormal = normalize(vNormal); + vec3 normalCoord = fNormal*0.5+0.5; + + vec3 df = vec3(0.0); + df.x = texture(dfMask, normalCoord.yz).x; + df.y = texture(dfMask, normalCoord.xz).y; + df.z = texture(dfMask, normalCoord.yx).z; + + float dfDot = dot(abs(fNormal), df);//*dot(abs(fNormal),vColor.rgb); + // df = texture(dfMask, vTexCoord); + + + vec3 fColor = mix(baseColor.rgb,baseColor.rgb*2.250,vColor.a);//df.rgb;// * vColor.rgb; + float a = baseColor.a*dfDot*vColor.a;//1.0;//min(max(0.0,centerDist*smoothstep(0.0,1.0,vColor.a)),1.0); + //a *= mix(smoothstep(0.75,1.0,dfDot*fresnel),1.0,pow(fresnel,20.0)); + a *= smoothstep(0.250,.750,dfDot*fresnel); + + float depthFade = smoothstep(0.0,0.0025,abs(depthSample-gl_FragCoord.z));//depthSample;//smoothstep(0.0,.10,abs(depthSample - (gl_FragCoord.z/gl_FragCoord.w))); + a *= depthFade; + a *= opacity; + COLOR_SUM = vec4(fColor*a,a); + //COLOR_SUM = vec4(depthFade); + //baseColor;//mix(COLOR_SUM,refraction,1.0-vFresnel)*baseColor; + //COLOR_SUM = vec4(vDepth,vDepth,vDepth,1.0); +} \ No newline at end of file diff --git a/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/shaders/fire.vert b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/shaders/fire.vert new file mode 100644 index 0000000000000000000000000000000000000000..b074f4028d98ef9b3723942edaaaa38e77e547d5 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/EffectBundle/shaders/fire.vert @@ -0,0 +1,10 @@ +VARYING vec2 vTexCoord; +VARYING vec4 vColor; +VARYING vec3 vNormal; + +void MAIN() +{ + vTexCoord = UV0; + vColor = COLOR; + vNormal = NORMAL.xyz; +} \ No newline at end of file diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/AcrylicPaintMaterial.qml b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/AcrylicPaintMaterial.qml new file mode 100644 index 0000000000000000000000000000000000000000..2bf1089dd101f98647701cb6d8a63bd06c7f4dd4 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/AcrylicPaintMaterial.qml @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Design Studio Material Bundle. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick +import QtQuick3D + +PrincipledMaterial { + id: acrylicpaint + cullMode: Material.NoCulling + roughnessMap: paint006_2K_Roughness + normalMap: paint006_2K_NormalGL + occlusionMap: paint006_2K_AmbientOcclusion + metalness: 0 + roughness: 1 + baseColor: "#024903" + transmissionFactor: 0 + roughnessChannel: Material.B + specularAmount: 1 + clearcoatAmount: 0 + objectName: "Acrylic Paint" + + Texture { + id: paint006_2K_AmbientOcclusion + source: "images/Paint006_2K_AmbientOcclusion.png" + rotationUV: 90 + generateMipmaps: true + mipFilter: Texture.Linear + magFilter: Texture.Linear + scaleV: 10 + scaleU: 10 + } + + Texture { + id: paint006_2K_NormalGL + source: "images/Paint006_2K_NormalGL.png" + rotationUV: 90 + generateMipmaps: true + mipFilter: Texture.Linear + magFilter: Texture.Linear + scaleV: 10 + scaleU: 10 + } + + Texture { + id: paint006_2K_Roughness + source: "images/Paint006_2K_Roughness.png" + rotationUV: 90 + generateMipmaps: true + mipFilter: Texture.Linear + magFilter: Texture.Linear + scaleV: 10 + scaleU: 10 + } +} diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/CeramicMaterial.qml b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/CeramicMaterial.qml new file mode 100644 index 0000000000000000000000000000000000000000..d4d44a8f6cdba45f2097bdb70f091db6888b215d --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/CeramicMaterial.qml @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Design Studio Material Bundle. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick +import QtQuick3D + +PrincipledMaterial { + id: ceramic + cullMode: Material.NoCulling + normalStrength: 0.5 + roughnessMap: concrete032_2K_Roughness + normalMap: concrete032_2K_NormalGL + objectName: "Ceramic" + roughness: 1 + baseColor: "#79422a" + specularAmount: 0.25 + clearcoatAmount: 0.25 + metalness: 0 + + Texture { + id: concrete032_2K_Roughness + source: "images/Concrete032_2K_Roughness.png" + scaleV: 3 + scaleU: 3 + } + + Texture { + id: concrete032_2K_NormalGL + source: "images/Concrete032_2K_NormalGL.png" + scaleV: 3 + scaleU: 3 + } +} diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/CopperMaterial.qml b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/CopperMaterial.qml new file mode 100644 index 0000000000000000000000000000000000000000..fa219413af1ea93495ce4c5d06118580b3805f25 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/CopperMaterial.qml @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Design Studio Material Bundle. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick +import QtQuick3D + +PrincipledMaterial { + id: copper + cullMode: Material.NoCulling + roughnessMap: roughness + baseColor: "#ffbd7f" + objectName: "Copper" + metalness: 1 + roughness: 0.15 + clearcoatAmount: 0 + + Texture { + id: roughness + source: "images/Metal029_2K_Displacement.jpg" + mipFilter: Texture.Linear + scaleV: 5 + scaleU: 5 + } +} diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/FabricMaterial.qml b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/FabricMaterial.qml new file mode 100644 index 0000000000000000000000000000000000000000..bce306487885fda1625ad4cacf0786202975ea5e --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/FabricMaterial.qml @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Design Studio Material Bundle. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick +import QtQuick3D + +PrincipledMaterial { + id: fabric + normalStrength: 0.5 + occlusionMap: fabric031_2K_Displacement + roughnessMap: fabric031_2K_Roughness + normalMap: fabric031_2K_NormalGL + clearcoatAmount: 0 + objectName: "Fabric, Rough" + roughness: 1 + specularAmount: 1 + cullMode: Material.NoCulling + metalness: 0 + transmissionFactor: 0 + alphaMode: PrincipledMaterial.Opaque + occlusionAmount: 0.75 + baseColor: "#d7c9b5" + depthDrawMode: Material.AlwaysDepthDraw + roughnessChannel: Material.R + + Texture { + id: fabric031_2K_NormalGL + source: "images/Fabric031_2K_NormalGL.png" + generateMipmaps: true + mipFilter: Texture.Linear + scaleV: 3 + scaleU: 3 + } + + Texture { + id: fabric031_2K_Roughness + source: "images/Fabric031_2K_Roughness.png" + generateMipmaps: true + mipFilter: Texture.Linear + scaleV: 3 + scaleU: 3 + } + + Texture { + id: fabric031_2K_Displacement + source: "images/Fabric031_2K_Displacement.png" + generateMipmaps: true + mipFilter: Texture.Linear + scaleV: 3 + scaleU: 3 + } +} diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/FabricRoughMaterial.qml b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/FabricRoughMaterial.qml new file mode 100644 index 0000000000000000000000000000000000000000..00c5accf33ce71497517b201fae068458f41a85e --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/FabricRoughMaterial.qml @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Design Studio Material Bundle. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick +import QtQuick3D + +PrincipledMaterial { + id: fabricrough + occlusionAmount: 1 + alphaMode: PrincipledMaterial.Opaque + cullMode: Material.NoCulling + depthDrawMode: Material.AlwaysDepthDraw + specularMap: fabric030_2K_Displacement + roughnessMap: fabric030_2K_Roughness + normalMap: fabric030_2K_NormalGL + roughness: 1 + roughnessChannel: Material.R + baseColor: "#d7c9b5" + metalness: 0 + specularAmount: 1 + objectName: "Fabric" + clearcoatAmount: 0 + transmissionFactor: 0 + + Texture { + id: fabric030_2K_NormalGL + source: "images/Fabric030_2K_NormalGL.png" + mipFilter: Texture.Linear + generateMipmaps: true + scaleV: 3 + scaleU: 3 + } + + Texture { + id: fabric030_2K_Roughness + source: "images/Fabric030_2K_Roughness.png" + mipFilter: Texture.Linear + generateMipmaps: true + scaleV: 3 + scaleU: 3 + } + + Texture { + id: fabric030_2K_Displacement + source: "images/Fabric030_2K_Displacement.png" + mipFilter: Texture.Linear + generateMipmaps: true + scaleV: 3 + scaleU: 3 + } +} diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/PaperMaterial.qml b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/PaperMaterial.qml new file mode 100644 index 0000000000000000000000000000000000000000..6d9aeb4a214474cd95cc52f1994c056f4d1b2c72 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/PaperMaterial.qml @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Design Studio Material Bundle. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick +import QtQuick3D + +PrincipledMaterial { + id: paper + cullMode: Material.NoCulling + objectName: "Paper" + roughness: 0.75 + baseColor: "#ffffff" + specularAmount: 0.25 + clearcoatAmount: 0 + metalness: 0 +} diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/PlasticShinyMaterial.qml b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/PlasticShinyMaterial.qml new file mode 100644 index 0000000000000000000000000000000000000000..6b7e233a4fb889b86c17ca6ecb5666755505490a --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/PlasticShinyMaterial.qml @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Design Studio Material Bundle. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick +import QtQuick3D + +PrincipledMaterial { + id: plasticShiny + clearcoatAmount: 0 + objectName: "Plastic, Shiny" + roughness: 0 + specularAmount: 0.93 + cullMode: Material.NoCulling + metalness: 0 + transmissionFactor: 0 + baseColor: "#ff0000" + roughnessChannel: Material.B +} diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/PlasticTexturedMaterial.qml b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/PlasticTexturedMaterial.qml new file mode 100644 index 0000000000000000000000000000000000000000..e04900f1baf656288735e3a50da91c4b08bb98ac --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/PlasticTexturedMaterial.qml @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Design Studio Material Bundle. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick +import QtQuick3D + +PrincipledMaterial { + id: plasticTextured + normalStrength: 0.06125 + normalMap: noisenormal + clearcoatAmount: 0 + objectName: "Plastic, Textured" + roughness: 0.3 + specularAmount: 0.93 + transmissionFactor: 0 + metalness: 0 + cullMode: Material.NoCulling + baseColor: "#ff0000" + roughnessChannel: Material.B + + Texture { + id: noisenormal + source: "images/noisenormal.png" + mipFilter: Texture.Linear + generateMipmaps: true + scaleV: 10 + scaleU: 10 + } +} diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/RubberMaterial.qml b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/RubberMaterial.qml new file mode 100644 index 0000000000000000000000000000000000000000..293e485c3eda406d087a388b370598e3ed5244e8 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/RubberMaterial.qml @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Design Studio Material Bundle. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick +import QtQuick3D + +PrincipledMaterial { + id: rubber + cullMode: Material.NoCulling + roughnessChannel: Material.B + baseColor: "#0b0b0b" + metalness: 0 + specularAmount: 1 + objectName: "Rubber" + transmissionFactor: 0 + roughness: 0.4 + clearcoatAmount: 0 +} diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/WaxMaterial.qml b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/WaxMaterial.qml new file mode 100644 index 0000000000000000000000000000000000000000..92aa6ddb26cc68cb3c07c956bbd7a4f5c4e2c137 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/WaxMaterial.qml @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Design Studio Material Bundle. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick +import QtQuick3D + +CustomMaterial { + id: wax + fragmentShader: Qt.resolvedUrl("shaders/SSS.frag") + vertexShader: Qt.resolvedUrl("shaders/SSS.vert") + cullMode: Material.NoCulling + depthDrawMode: Material.OpaqueOnlyDepthDraw + property color baseColor: "#ffffff" + property color subsurfaceColor: "#ffc783" + property real specular: 0.0 + property real density: 0 + property real opacity: 1 + property real roughness: 0.5 + property real clearcoat: 1 + property real metalness: 0.0 + property real sssDistortion: 0.0 + property real sssPower: 10 + property real sssScale: 2 + objectName: "Wax" +} diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/SteelFloorMaterial.qml b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/WoodMaterial.qml similarity index 72% rename from examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/SteelFloorMaterial.qml rename to examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/WoodMaterial.qml index 2e489be18cef1377a6c40b7e81d87a57f5c1c7e5..90712bca06872cafc1223e17761af878d5187bbb 100644 --- a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/SteelFloorMaterial.qml +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/WoodMaterial.qml @@ -27,20 +27,32 @@ import QtQuick import QtQuick3D PrincipledMaterial { - id: steelFloor - normalMap: diamondPlate001_2K_NormalGL + id: wood cullMode: Material.NoCulling + normalMap: wood048_2K_NormalGL + roughnessMap: wood048_2K_Roughness + baseColorMap: wood048_2K_Color + transmissionFactor: 0 + roughnessChannel: Material.B + metalness: 0 specularAmount: 1 - clearcoatAmount: 0 roughness: 1 - roughnessMap: diamondPlate001_2K_Roughness - metalness: 1 - objectName: "Steel, Floor" - baseColor: "#d9d7d2" + clearcoatAmount: 0 + objectName: "Wood" + baseColor: "#ffffff" + + Texture { + id: wood048_2K_Color + source: "images/Wood048_2K_Color.png" + mipFilter: Texture.Linear + generateMipmaps: true + scaleV: 3 + scaleU: 3 + } Texture { - id: diamondPlate001_2K_NormalGL - source: "images/DiamondPlate001_2K_NormalGL.png" + id: wood048_2K_Roughness + source: "images/Wood048_2K_Roughness.png" mipFilter: Texture.Linear generateMipmaps: true scaleV: 3 @@ -48,8 +60,8 @@ PrincipledMaterial { } Texture { - id: diamondPlate001_2K_Roughness - source: "images/DiamondPlate001_2K_Roughness.png" + id: wood048_2K_NormalGL + source: "images/Wood048_2K_NormalGL.png" mipFilter: Texture.Linear generateMipmaps: true scaleV: 3 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/WoodParquetMaterial.qml b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/WoodParquetMaterial.qml new file mode 100644 index 0000000000000000000000000000000000000000..721560fec0383df551d5061ea7db56f3fec74827 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/WoodParquetMaterial.qml @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Design Studio Material Bundle. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick +import QtQuick3D + +PrincipledMaterial { + id: woodParquet + roughnessMap: woodFloor054_2K_Roughness + normalMap: woodFloor054_2K_NormalGL + occlusionMap: woodFloor054_2K_AmbientOcclusion + baseColorMap: woodFloor054_2K_Color + clearcoatAmount: 0 + objectName: "Wood, Parquet" + roughness: 1 + specularAmount: 0.1 + cullMode: Material.NoCulling + metalness: 0 + transmissionFactor: 0 + baseColor: "#ffffff" + roughnessChannel: Material.B + + Texture { + id: woodFloor054_2K_Color + source: "images/WoodFloor054_2K_Color.png" + mipFilter: Texture.Linear + generateMipmaps: true + scaleV: 3 + scaleU: 3 + } + + Texture { + id: woodFloor054_2K_AmbientOcclusion + source: "images/WoodFloor054_2K_AmbientOcclusion.png" + mipFilter: Texture.Linear + generateMipmaps: true + scaleV: 3 + scaleU: 3 + } + + Texture { + id: woodFloor054_2K_NormalGL + source: "images/WoodFloor054_2K_NormalGL.png" + mipFilter: Texture.Linear + generateMipmaps: true + scaleV: 3 + scaleU: 3 + } + + Texture { + id: woodFloor054_2K_Roughness + source: "images/WoodFloor054_2K_Roughness.png" + mipFilter: Texture.Linear + generateMipmaps: true + scaleV: 3 + scaleU: 3 + } +} diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/WoodPlanksMaterial.qml b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/WoodPlanksMaterial.qml new file mode 100644 index 0000000000000000000000000000000000000000..b9049eb5483355327135b2311dbc22658387d357 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/WoodPlanksMaterial.qml @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Design Studio Material Bundle. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick +import QtQuick3D + +PrincipledMaterial { + id: woodPlanks + occlusionMap: woodFloor044_2K_AmbientOcclusion + roughnessMap: woodFloor044_2K_Roughness + normalMap: woodFloor044_2K_NormalGL + baseColorMap: woodFloor044_2K_Color + normalStrength: 1 + clearcoatAmount: 0 + objectName: "Wood, Planks" + roughness: 1 + specularAmount: 1 + cullMode: Material.NoCulling + metalness: 0 + transmissionFactor: 0 + baseColor: "#ffffff" + + Texture { + id: woodFloor044_2K_Color + source: "images/WoodFloor044_2K_Color.png" + mipFilter: Texture.Linear + generateMipmaps: true + scaleV: 3 + scaleU: 3 + } + + Texture { + id: woodFloor044_2K_NormalGL + source: "images/WoodFloor044_2K_NormalGL.png" + mipFilter: Texture.Linear + generateMipmaps: true + scaleV: 3 + scaleU: 3 + } + + Texture { + id: woodFloor044_2K_Roughness + source: "images/WoodFloor044_2K_Roughness.png" + mipFilter: Texture.Linear + generateMipmaps: true + scaleV: 3 + scaleU: 3 + } + + Texture { + id: woodFloor044_2K_AmbientOcclusion + source: "images/WoodFloor054_2K_AmbientOcclusion.png" + mipFilter: Texture.Linear + generateMipmaps: true + scaleV: 3 + scaleU: 3 + } +} diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/_asset_ref.json b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/_asset_ref.json index 1d818a3742137a7a649c98bcaa9a0f90647c1d20..bb5e7ceac4f5113b6eaae22cad9d9549ea0b5f36 100644 --- a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/_asset_ref.json +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/_asset_ref.json @@ -1,14 +1,170 @@ { + "designer/acrylicpaint.metainfo": [ + "AcrylicPaintMaterial.qml" + ], + "designer/ceramic.metainfo": [ + "CeramicMaterial.qml" + ], + "designer/copper.metainfo": [ + "CopperMaterial.qml" + ], + "designer/fabric.metainfo": [ + "FabricMaterial.qml" + ], + "designer/fabricrough.metainfo": [ + "FabricRoughMaterial.qml" + ], + "designer/images/material.png": [ + "CeramicMaterial.qml", + "WoodMaterial.qml", + "WoodParquetMaterial.qml", + "WoodPlanksMaterial.qml", + "WaxMaterial.qml", + "PlasticTexturedMaterial.qml", + "PlasticMatteMaterial.qml", + "PlasticShinyMaterial.qml", + "AcrylicPaintMaterial.qml", + "FabricRoughMaterial.qml", + "FabricMaterial.qml", + "CopperMaterial.qml", + "PaperMaterial.qml", + "RubberMaterial.qml" + ], + "designer/images/material16.png": [ + "CeramicMaterial.qml", + "WoodMaterial.qml", + "WoodParquetMaterial.qml", + "WoodPlanksMaterial.qml", + "WaxMaterial.qml", + "PlasticTexturedMaterial.qml", + "PlasticMatteMaterial.qml", + "PlasticShinyMaterial.qml", + "AcrylicPaintMaterial.qml", + "FabricRoughMaterial.qml", + "FabricMaterial.qml", + "CopperMaterial.qml", + "PaperMaterial.qml", + "RubberMaterial.qml" + ], + "designer/images/material@2x.png": [ + "CeramicMaterial.qml", + "WoodMaterial.qml", + "WoodParquetMaterial.qml", + "WoodPlanksMaterial.qml", + "WaxMaterial.qml", + "PlasticTexturedMaterial.qml", + "PlasticMatteMaterial.qml", + "PlasticShinyMaterial.qml", + "AcrylicPaintMaterial.qml", + "FabricRoughMaterial.qml", + "FabricMaterial.qml", + "CopperMaterial.qml", + "PaperMaterial.qml", + "RubberMaterial.qml" + ], + "designer/paper.metainfo": [ + "PaperMaterial.qml" + ], "designer/plasticmatte.metainfo": [ "PlasticMatteMaterial.qml" ], - "designer/steelfloor.metainfo": [ - "SteelFloorMaterial.qml" + "designer/plasticshiny.metainfo": [ + "PlasticShinyMaterial.qml" + ], + "designer/plastictextured.metainfo": [ + "PlasticTexturedMaterial.qml" + ], + "designer/rubber.metainfo": [ + "RubberMaterial.qml" + ], + "designer/wax.metainfo": [ + "WaxMaterial.qml" + ], + "designer/wood.metainfo": [ + "WoodMaterial.qml" + ], + "designer/woodparquet.metainfo": [ + "WoodParquetMaterial.qml" + ], + "designer/woodplanks.metainfo": [ + "WoodPlanksMaterial.qml" + ], + "images/Concrete032_2K_NormalGL.png": [ + "CeramicMaterial.qml" + ], + "images/Concrete032_2K_Roughness.png": [ + "CeramicMaterial.qml" + ], + "images/Fabric030_2K_Displacement.png": [ + "FabricRoughMaterial.qml" + ], + "images/Fabric030_2K_NormalGL.png": [ + "FabricRoughMaterial.qml" + ], + "images/Fabric030_2K_Roughness.png": [ + "FabricRoughMaterial.qml" + ], + "images/Fabric031_2K_Displacement.png": [ + "FabricMaterial.qml" + ], + "images/Fabric031_2K_NormalGL.png": [ + "FabricMaterial.qml" + ], + "images/Fabric031_2K_Roughness.png": [ + "FabricMaterial.qml" + ], + "images/Metal029_2K_Displacement.jpg": [ + "CopperMaterial.qml" + ], + "images/Paint006_2K_AmbientOcclusion.png": [ + "AcrylicPaintMaterial.qml" + ], + "images/Paint006_2K_NormalGL.png": [ + "AcrylicPaintMaterial.qml" + ], + "images/Paint006_2K_Roughness.png": [ + "AcrylicPaintMaterial.qml" + ], + "images/Wood048_2K_Color.png": [ + "WoodMaterial.qml" + ], + "images/Wood048_2K_NormalGL.png": [ + "WoodMaterial.qml" + ], + "images/Wood048_2K_Roughness.png": [ + "WoodMaterial.qml" + ], + "images/WoodFloor044_2K_Color.png": [ + "WoodPlanksMaterial.qml" + ], + "images/WoodFloor044_2K_NormalGL.png": [ + "WoodPlanksMaterial.qml" + ], + "images/WoodFloor044_2K_Roughness.png": [ + "WoodPlanksMaterial.qml" + ], + "images/WoodFloor054_2K_AmbientOcclusion.png": [ + "WoodParquetMaterial.qml" + ], + "images/WoodFloor054_2K_Color.png": [ + "WoodParquetMaterial.qml" + ], + "images/WoodFloor054_2K_NormalGL.png": [ + "WoodParquetMaterial.qml" + ], + "images/WoodFloor054_2K_Roughness.png": [ + "WoodParquetMaterial.qml" + ], + "images/blurrynoise.tga": [ + "CeramicMaterial.qml" + ], + "images/noisenormal.png": [ + "PlasticTexturedMaterial.qml" ], - "images/DiamondPlate001_2K_NormalGL.png": [ - "SteelFloorMaterial.qml" + "shaders/SSS.frag": [ + "WaxMaterial.qml" ], - "images/DiamondPlate001_2K_Roughness.png": [ - "SteelFloorMaterial.qml" + "shaders/SSS.vert": [ + "WaxMaterial.qml" ] } diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/acrylicpaint.metainfo b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/acrylicpaint.metainfo new file mode 100644 index 0000000000000000000000000000000000000000..b8ad61af64b42fca7c929d08cd03d06d4aa0d894 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/acrylicpaint.metainfo @@ -0,0 +1,20 @@ +MetaInfo { + Type { + name: "ComponentBundles.MaterialBundle.AcrylicPaintMaterial" + icon: "images/material16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Acrylic Paint" + category: "Synthetic" + libraryIcon: "images/material.png" + version: "1.0" + requiredImport: "ComponentBundles.MaterialBundle" + } + } +} \ No newline at end of file diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/ceramic.metainfo b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/ceramic.metainfo new file mode 100644 index 0000000000000000000000000000000000000000..5445d47537aebdb0b77dca25ef9bbad3009072c2 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/ceramic.metainfo @@ -0,0 +1,20 @@ +MetaInfo { + Type { + name: "ComponentBundles.MaterialBundle.CeramicMaterial" + icon: "images/material16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Ceramic" + category: "Architectural" + libraryIcon: "images/material.png" + version: "1.0" + requiredImport: "ComponentBundles.MaterialBundle" + } + } +} \ No newline at end of file diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/steelfloor.metainfo b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/copper.metainfo similarity index 80% rename from examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/steelfloor.metainfo rename to examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/copper.metainfo index 9d7bfee2e3f9c24bfd891b19c2753b83212d29c7..cd94fe4d472aeaf5043b8f295d3f90d38f72633f 100644 --- a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/steelfloor.metainfo +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/copper.metainfo @@ -1,6 +1,6 @@ MetaInfo { Type { - name: "ComponentBundles.MaterialBundle.SteelFloorMaterial" + name: "ComponentBundles.MaterialBundle.CopperMaterial" icon: "images/material16.png" Hints { @@ -10,7 +10,7 @@ MetaInfo { } ItemLibraryEntry { - name: "Steel, Floor" + name: "Copper" category: "Metal" libraryIcon: "images/material.png" version: "1.0" diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/fabric.metainfo b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/fabric.metainfo new file mode 100644 index 0000000000000000000000000000000000000000..b9867d4c03a84f20680dad0f59fe032efeb8d186 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/fabric.metainfo @@ -0,0 +1,20 @@ +MetaInfo { + Type { + name: "ComponentBundles.MaterialBundle.FabricMaterial" + icon: "images/material16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Fabric" + category: "Other" + libraryIcon: "images/material.png" + version: "1.0" + requiredImport: "ComponentBundles.MaterialBundle" + } + } +} \ No newline at end of file diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/fabricrough.metainfo b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/fabricrough.metainfo new file mode 100644 index 0000000000000000000000000000000000000000..fc461e5b02fda9b44aa041a11dafac971246f058 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/fabricrough.metainfo @@ -0,0 +1,20 @@ +MetaInfo { + Type { + name: "ComponentBundles.MaterialBundle.FabricRoughMaterial" + icon: "images/material16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Fabric, Rough" + category: "Other" + libraryIcon: "images/material.png" + version: "1.0" + requiredImport: "ComponentBundles.MaterialBundle" + } + } +} \ No newline at end of file diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/paper.metainfo b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/paper.metainfo new file mode 100644 index 0000000000000000000000000000000000000000..ee873952da0fc7162f7d3e4e597c3bbd044607e4 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/paper.metainfo @@ -0,0 +1,20 @@ +MetaInfo { + Type { + name: "ComponentBundles.MaterialBundle.PaperMaterial" + icon: "images/material16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Paper" + category: "Other" + libraryIcon: "images/material.png" + version: "1.0" + requiredImport: "ComponentBundles.MaterialBundle" + } + } +} \ No newline at end of file diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/plasticshiny.metainfo b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/plasticshiny.metainfo new file mode 100644 index 0000000000000000000000000000000000000000..31b1e77ff4edd7563b3025a9f0df678a1faf5052 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/plasticshiny.metainfo @@ -0,0 +1,20 @@ +MetaInfo { + Type { + name: "ComponentBundles.MaterialBundle.PlasticShinyMaterial" + icon: "images/material16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Plastic, Shiny" + category: "Synthetic" + libraryIcon: "images/material.png" + version: "1.0" + requiredImport: "ComponentBundles.MaterialBundle" + } + } +} \ No newline at end of file diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/plastictextured.metainfo b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/plastictextured.metainfo new file mode 100644 index 0000000000000000000000000000000000000000..85fcfa3161522fcf90d60a42f08b5e6bce788429 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/plastictextured.metainfo @@ -0,0 +1,20 @@ +MetaInfo { + Type { + name: "ComponentBundles.MaterialBundle.PlasticTexturedMaterial" + icon: "images/material16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Plastic, Textured" + category: "Synthetic" + libraryIcon: "images/material.png" + version: "1.0" + requiredImport: "ComponentBundles.MaterialBundle" + } + } +} \ No newline at end of file diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/rubber.metainfo b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/rubber.metainfo new file mode 100644 index 0000000000000000000000000000000000000000..b1288621206e73dcf5e4eb2185f461ebfa89e5c6 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/rubber.metainfo @@ -0,0 +1,20 @@ +MetaInfo { + Type { + name: "ComponentBundles.MaterialBundle.RubberMaterial" + icon: "images/material16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Rubber" + category: "Synthetic" + libraryIcon: "images/material.png" + version: "1.0" + requiredImport: "ComponentBundles.MaterialBundle" + } + } +} \ No newline at end of file diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/wax.metainfo b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/wax.metainfo new file mode 100644 index 0000000000000000000000000000000000000000..2658a4163291b41c302340e78d34b89ddfa98b0a --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/wax.metainfo @@ -0,0 +1,20 @@ +MetaInfo { + Type { + name: "ComponentBundles.MaterialBundle.WaxMaterial" + icon: "images/material16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Wax" + category: "Synthetic" + libraryIcon: "images/material.png" + version: "1.0" + requiredImport: "ComponentBundles.MaterialBundle" + } + } +} \ No newline at end of file diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/wood.metainfo b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/wood.metainfo new file mode 100644 index 0000000000000000000000000000000000000000..d1bdef3ae99d8363330a8c8cd239a74296b80394 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/wood.metainfo @@ -0,0 +1,20 @@ +MetaInfo { + Type { + name: "ComponentBundles.MaterialBundle.WoodMaterial" + icon: "images/material16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Wood" + category: "Architectural" + libraryIcon: "images/material.png" + version: "1.0" + requiredImport: "ComponentBundles.MaterialBundle" + } + } +} \ No newline at end of file diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/woodparquet.metainfo b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/woodparquet.metainfo new file mode 100644 index 0000000000000000000000000000000000000000..e4587b06cbb0fbde921269d40f32c0976a8ce413 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/woodparquet.metainfo @@ -0,0 +1,20 @@ +MetaInfo { + Type { + name: "ComponentBundles.MaterialBundle.WoodParquetMaterial" + icon: "images/material16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Wood, Parquet" + category: "Architectural" + libraryIcon: "images/material.png" + version: "1.0" + requiredImport: "ComponentBundles.MaterialBundle" + } + } +} \ No newline at end of file diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/woodplanks.metainfo b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/woodplanks.metainfo new file mode 100644 index 0000000000000000000000000000000000000000..c2540e9ed23118c164365efb99490812a242d515 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/designer/woodplanks.metainfo @@ -0,0 +1,20 @@ +MetaInfo { + Type { + name: "ComponentBundles.MaterialBundle.WoodPlanksMaterial" + icon: "images/material16.png" + + Hints { + visibleInNavigator: false + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + } + + ItemLibraryEntry { + name: "Wood, Planks" + category: "Architectural" + libraryIcon: "images/material.png" + version: "1.0" + requiredImport: "ComponentBundles.MaterialBundle" + } + } +} \ No newline at end of file diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Concrete032_2K_NormalGL.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Concrete032_2K_NormalGL.png new file mode 100644 index 0000000000000000000000000000000000000000..0821398536387c5730e901984f5b37da254823c6 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Concrete032_2K_NormalGL.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7627388cd6ed5265efd07f60ae4efab36cd4e97e7899ca35d95b838ce2cea7fd +size 8670934 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Concrete032_2K_Roughness.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Concrete032_2K_Roughness.png new file mode 100644 index 0000000000000000000000000000000000000000..3ad762532b7b7fa82ea371e33193f5d1770524bb --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Concrete032_2K_Roughness.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2485afc178d4c98026a84871d2d805a285d1ca56fba9bf424deacfea9214a3e1 +size 3143720 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/DiamondPlate001_2K_NormalGL.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/DiamondPlate001_2K_NormalGL.png deleted file mode 100644 index e2850b90c977e606d2f6f87e191c255ad645c659..0000000000000000000000000000000000000000 --- a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/DiamondPlate001_2K_NormalGL.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c4ec70aea3496af2ad46c9e6ff77e66b44b7aa09819e4957e11ecd808353b3e9 -size 7275278 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/DiamondPlate001_2K_Roughness.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/DiamondPlate001_2K_Roughness.png deleted file mode 100644 index eac97a8b91dfaa7abd5cadec19a168c89837512a..0000000000000000000000000000000000000000 --- a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/DiamondPlate001_2K_Roughness.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8f4e67eb5b24ea3afdb9eab7b5d8096cceb53d45e2b1c40eb5c0986d8c5be534 -size 2538400 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric030_2K_Displacement.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric030_2K_Displacement.png new file mode 100644 index 0000000000000000000000000000000000000000..bfc4b21f7a16924f25e62ad6519c1084bd755ef8 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric030_2K_Displacement.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5171d98edd9b0ad367663082a01d6d6a257875420d35b84f2a974d7f6781ab18 +size 4114052 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric030_2K_NormalGL.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric030_2K_NormalGL.png new file mode 100644 index 0000000000000000000000000000000000000000..1d2fa46ad2f089fbe8030df71ce0f5f6954cc5d4 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric030_2K_NormalGL.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c43406c17ad79e44d025e05c8f680703b666596e29a445df7d63f0bf0fa5f7b +size 9700605 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric030_2K_Roughness.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric030_2K_Roughness.png new file mode 100644 index 0000000000000000000000000000000000000000..861b977a3d0161ceb4a809d074181adcd24b78d7 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric030_2K_Roughness.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5975c35e03a2d22e9024675c1d69485ce20d673aa7dff48a419485df70050ad +size 3346336 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric031_2K_Displacement.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric031_2K_Displacement.png new file mode 100644 index 0000000000000000000000000000000000000000..e40e7f34e7672c51fcf670aeeb663e02f575d78b --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric031_2K_Displacement.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:761095eced544e145509d2cbda576ff1c82cb57ed5bebd442569fc6f8ceded2b +size 3407521 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric031_2K_NormalGL.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric031_2K_NormalGL.png new file mode 100644 index 0000000000000000000000000000000000000000..755df48f28b8cacdfa9e81a2914db82071a29d0c --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric031_2K_NormalGL.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d985373414141aa100a984358bf5bcd979cbee876762aa10e997c89dc6d713ae +size 9515510 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric031_2K_Roughness.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric031_2K_Roughness.png new file mode 100644 index 0000000000000000000000000000000000000000..68a7aeebaf17ac93e9849ad3517e11d187bbe44d --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Fabric031_2K_Roughness.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81353e4112b2af2f88276e8fafadce168638e6e15b4a15c649d7a342145c5d2c +size 2256064 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Metal029_2K_Displacement.jpg b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Metal029_2K_Displacement.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a975fd704f9ee4c19717001f92d3f799dceb4298 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Metal029_2K_Displacement.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b290046d83b5c7ed13b1bae5130162f2ddaf3bdc67cc8a4ff3741db282fceaef +size 3362437 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Paint006_2K_AmbientOcclusion.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Paint006_2K_AmbientOcclusion.png new file mode 100644 index 0000000000000000000000000000000000000000..4065c51548ee7f87119cc49801afc54cf9455768 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Paint006_2K_AmbientOcclusion.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48c50ccdcc4fd32d3b6c2c710fc0271a4e541d794cb098553f1795ad8d30af69 +size 1344033 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Paint006_2K_NormalGL.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Paint006_2K_NormalGL.png new file mode 100644 index 0000000000000000000000000000000000000000..0767374a717212f422fbe7b147c2f97aee5d22de --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Paint006_2K_NormalGL.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9033e5d00627632067acd7d33aafdfd501afa3fdd98fbb652764e72257ac176a +size 5195788 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Paint006_2K_Roughness.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Paint006_2K_Roughness.png new file mode 100644 index 0000000000000000000000000000000000000000..5648ace073faae5f802e5751896500da030d16fc --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Paint006_2K_Roughness.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:254b7f89a0742f8f7815cc3979892cb8e906f4e06e85ffbc4f0a7bd1cf6adac3 +size 1924182 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Wood048_2K_Color.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Wood048_2K_Color.png new file mode 100644 index 0000000000000000000000000000000000000000..d99a2c149c25663202574f3412c25918c4ad3cde --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Wood048_2K_Color.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1b53251387b22841122cff56574a01c190cbcf64a581982f29c54509fe4dcd7 +size 4824072 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Wood048_2K_NormalGL.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Wood048_2K_NormalGL.png new file mode 100644 index 0000000000000000000000000000000000000000..cad0e84812bb21b37cb099fbc05bd28b7ebc621f --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Wood048_2K_NormalGL.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:063161fcaaf5feb998d625183e263db40da62b53df2fca90155c0b9f06892746 +size 5891494 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Wood048_2K_Roughness.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Wood048_2K_Roughness.png new file mode 100644 index 0000000000000000000000000000000000000000..4eda9848a033cd2925873d2121f57054a00a99c8 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/Wood048_2K_Roughness.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f04e0e8c7b4a95a488d2d6878794f00666278bf622edd9768e86136053f649cc +size 2844296 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor044_2K_Color.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor044_2K_Color.png new file mode 100644 index 0000000000000000000000000000000000000000..12a798a8116fc40d567ff86dd6ce381e8199fe83 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor044_2K_Color.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c23bafe2c6bbd8a8be4c90f3f424ae66481af231bf8650f6d5dfc8ea8afc5a1b +size 2574864 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor044_2K_NormalGL.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor044_2K_NormalGL.png new file mode 100644 index 0000000000000000000000000000000000000000..b3be14e02077437235a2e84574a6167802b0c955 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor044_2K_NormalGL.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:335ef4858616e57de9b548488ba7e96bb84b2164585dafe67fc04332a8f44866 +size 1861180 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor044_2K_Roughness.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor044_2K_Roughness.png new file mode 100644 index 0000000000000000000000000000000000000000..a216510ea5995e5e822cb3340ab13507b7a3a207 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor044_2K_Roughness.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1cc3a3514fdbc8392e79d910fd8b0e7082efe8986f5cacb46cf1e853f3a811b +size 763662 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor054_2K_AmbientOcclusion.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor054_2K_AmbientOcclusion.png new file mode 100644 index 0000000000000000000000000000000000000000..3f762e1fe2f4caa02b465f575b9c5bcf188e1060 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor054_2K_AmbientOcclusion.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e5414e65aafe950d5f20371f791981125a67b10980fec62b95fe306beffd54e +size 290994 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor054_2K_Color.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor054_2K_Color.png new file mode 100644 index 0000000000000000000000000000000000000000..e228116d4056fd8dc65319237e4200b5dceddc8d --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor054_2K_Color.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9905de2fa9e860076e26d522f2bea63b24cf7c472a432f6c8372402ebb2bb615 +size 4694289 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor054_2K_NormalGL.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor054_2K_NormalGL.png new file mode 100644 index 0000000000000000000000000000000000000000..402551fde2a6eacb6a5fbd440c1d9447647aa066 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor054_2K_NormalGL.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b88ee099fc7cb1468df681b82c4a1e89a43081368bf7740fac0b08c6885c8a2 +size 3012577 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor054_2K_Roughness.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor054_2K_Roughness.png new file mode 100644 index 0000000000000000000000000000000000000000..b71530d1aac4dd648f886e7bc2e337dcaad5725a --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/WoodFloor054_2K_Roughness.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b95a5902c2498c3b552ec7d594c675a207726e11d183ca10d7815edb6f82d57 +size 1452502 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/blurrynoise.tga b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/blurrynoise.tga new file mode 100644 index 0000000000000000000000000000000000000000..3faa792872a96d91454fdf6f9263789cdd101d4e Binary files /dev/null and b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/blurrynoise.tga differ diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/noisenormal.png b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/noisenormal.png new file mode 100644 index 0000000000000000000000000000000000000000..d9738d08ecac9ae36d6b65b1705286088cbf3687 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/images/noisenormal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0ee73f131f1107a5ac70f3a21ce5d3a403ef104df9e4f0e298b2ceca2d71d23 +size 40629 diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/qmldir b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/qmldir index 3ce94aa2f6068d580f9a91ced59fa10a4495538b..d918f9c71e2cd42a57311aeb354e8234fcafd230 100644 --- a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/qmldir +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/qmldir @@ -1,3 +1,15 @@ module ComponentBundles.MaterialBundle +CeramicMaterial 1.0 CeramicMaterial.qml +WoodMaterial 1.0 WoodMaterial.qml +WoodParquetMaterial 1.0 WoodParquetMaterial.qml +WoodPlanksMaterial 1.0 WoodPlanksMaterial.qml +WaxMaterial 1.0 WaxMaterial.qml +PlasticTexturedMaterial 1.0 PlasticTexturedMaterial.qml PlasticMatteMaterial 1.0 PlasticMatteMaterial.qml -SteelFloorMaterial 1.0 SteelFloorMaterial.qml +PlasticShinyMaterial 1.0 PlasticShinyMaterial.qml +AcrylicPaintMaterial 1.0 AcrylicPaintMaterial.qml +FabricRoughMaterial 1.0 FabricRoughMaterial.qml +FabricMaterial 1.0 FabricMaterial.qml +CopperMaterial 1.0 CopperMaterial.qml +PaperMaterial 1.0 PaperMaterial.qml +RubberMaterial 1.0 RubberMaterial.qml diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/shaders/SSS.frag b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/shaders/SSS.frag new file mode 100644 index 0000000000000000000000000000000000000000..248baea591dca0608df7fc9a9144f4f8b52e7a94 --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/shaders/SSS.frag @@ -0,0 +1,137 @@ +precision lowp int; +precision lowp float; + +vec3 diff = vec3(0.0); +vec4 albedo = vec4(0.0); +float specVal = 0.0; +vec3 spec = vec3(0.0); +vec3 sss = vec3(0.0); +vec3 fNormal = vec3(0.0); +vec3 fView = vec3(0.0); +float fresnel = 0.0; +float fresnelBase = 0.0; +float rough = 0.0; +vec3 flakeNormal = vec3(0.0); + +float curvature = 0.0; + +VARYING vec3 vColor; +VARYING vec3 vPos; + + +vec3 testCol = vec3(0.0); + +void MAIN(){ + fNormal = normalize(VAR_WORLD_NORMAL); + fView=normalize(VIEW_VECTOR); + fresnelBase = 1.0-max(0.0,dot(fNormal, fView)); + + NORMAL = fNormal; + + fresnel = fresnelBase; + FRESNEL_POWER = 5.0; + fresnel = pow(fresnel,FRESNEL_POWER); + + specVal = mix(mix(mix(fresnel*specular,specular,specular),1.0,metalness),1.0,fresnelBase*clearcoat); + SPECULAR_AMOUNT = specVal; + albedo = baseColor; + BASE_COLOR = vec4(1.0); + + vec3 vNormalWsDdx = dFdx(fNormal.xyz); + vec3 vNormalWsDdy = dFdy(fNormal.xyz); + float flGeometricRoughnessFactor = pow(clamp(max(dot(vNormalWsDdx, vNormalWsDdx), dot(vNormalWsDdy, vNormalWsDdy)), 0.0, 1.0),0.333); + METALNESS = mix(metalness,0.0,fresnelBase*clearcoat); + ROUGHNESS = mix(mix(mix(roughness,0.0,fresnel),0.0,fresnelBase*clearcoat),1.0,flGeometricRoughnessFactor); + rough = ROUGHNESS; + + curvature = length(fwidth(fNormal)); +} + + +void AMBIENT_LIGHT() +{ + diff += TOTAL_AMBIENT_COLOR; +} + +const float PI = 3.141592; +const float e = 2.71828; +float r2 = roughness * roughness; + +float sssDepth = 1.0-density; +float sssHalf = sssDepth*0.5; + +float PixarBRDF(vec3 normalWS, vec3 lightDirectionWS, vec3 viewDirectionWS) { + + vec3 H = normalize(lightDirectionWS + viewDirectionWS); + float NH = (dot(normalWS, H)); + NH = NH*(1.0-sssHalf)+sssHalf; + float NH2 = NH * NH; + float NH3 = NH2 * NH; + float VH = (dot(viewDirectionWS, H)); + VH = VH*(1.0-sssHalf)+sssHalf; + float LN = dot(normalWS, lightDirectionWS); + LN = LN*(1.0-sssHalf)+sssHalf; + LN=max(0.0,LN); + + float step1 = NH2 - 1.0; + float secondStepExp = (step1 / (r2 * NH2)); + float step2 = (pow(e, secondStepExp)); + float step3 = (4.0 * PI * r2 * NH3 * VH); + float BRDF = max(0.0,step2 / step3) * LN; + + + return BRDF; +} + + +float DisneyDiffuse(vec3 l, vec3 n, vec3 v) +{ + + float a = 1.0 - 0.5 * (r2 / (r2 + 0.57)); + float b = 0.45 * (r2 / (r2 + 0.09)); + + float nl = dot(n, l); + nl = nl*(1.0-sssHalf)+sssHalf; + float nv = (dot(n, v)); + nv = nv*(1.0-sssHalf)+sssHalf; + + + float ga = dot(v - n * nv, n - n * nl); + + return max(0.0, nl) * mix(1.0, (a + b * max(0.0, ga) * sqrt((1.0 - nv * nv) * (1.0 - nl * nl)) / max(nl, nv)), roughness); +} + +float DICE_SSS(vec3 l, vec3 n, vec3 v){ + vec3 vLTLight = (l+n*sssDistortion); + float fLTDot = pow(max(dot(v,-vLTLight),0.0),sssPower)*sssScale; + float flt = 1.0/length(l) * fLTDot * sssDepth; + return flt; +} + +void POINT_LIGHT() +{ + float lightDot = smoothstep(1.0,density,dot(-fNormal, TO_LIGHT_DIR)); + float shadow = mix(SHADOW_CONTRIB,1.0,lightDot*sssDepth); + diff += LIGHT_COLOR * LIGHT_ATTENUATION * shadow * DisneyDiffuse(TO_LIGHT_DIR, fNormal, fView); + spec += LIGHT_COLOR * LIGHT_ATTENUATION * shadow * PixarBRDF(fNormal, TO_LIGHT_DIR, fView ); + sss += LIGHT_COLOR * LIGHT_ATTENUATION * shadow * DICE_SSS(TO_LIGHT_DIR, fNormal, fView); +} + +void DIRECTIONAL_LIGHT() +{ + float lightDot = smoothstep(1.0,density,dot(-fNormal, TO_LIGHT_DIR)); + float shadow = mix(SHADOW_CONTRIB,1.0,lightDot*sssDepth); + diff += LIGHT_COLOR * shadow * DisneyDiffuse(TO_LIGHT_DIR, fNormal, fView); + spec += LIGHT_COLOR * shadow * PixarBRDF(fNormal, TO_LIGHT_DIR, fView ); + sss += LIGHT_COLOR * shadow * DICE_SSS(TO_LIGHT_DIR, fNormal, fView); +} + + + +void POST_PROCESS() +{ + vec3 specularAcc = SPECULAR.rgb+spec; + vec3 diffuseAcc = albedo.rgb*(DIFFUSE.rgb+diff); + vec3 totalLight = (mix(diffuseAcc, mix(specularAcc,mix(albedo.rgb*specularAcc,specularAcc+diffuseAcc*fresnel,fresnel),metalness), specVal) + subsurfaceColor.rgb*(sss)* (1.0-density)*0.5); + COLOR_SUM = vec4((totalLight+specularAcc*fresnelBase*clearcoat)*vColor.rgb + EMISSIVE, opacity); +} diff --git a/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/shaders/SSS.vert b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/shaders/SSS.vert new file mode 100644 index 0000000000000000000000000000000000000000..159c2d56306d290b8c51d6384a0bfd683185967b --- /dev/null +++ b/examples/Flashlight/asset_imports/ComponentBundles/MaterialBundle/shaders/SSS.vert @@ -0,0 +1,16 @@ +precision lowp int; +precision lowp float; + +VARYING vec3 vColor; +VARYING vec3 vPos; +VARYING vec3 vNormal; +VARYING vec3 vViewVec; +VARYING vec2 vTexcoord; + +void MAIN(){ + vColor = COLOR.rgb; + vPos = VERTEX.xyz; + vNormal = normalize(NORMAL); + vTexcoord = UV0; + vViewVec = normalize(CAMERA_POSITION - (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz); +} \ No newline at end of file diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/ComputerScene.hints b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/ComputerScene.hints new file mode 100644 index 0000000000000000000000000000000000000000..5ef26ba572cced6f6e2f7763913d34940b7281ce --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/ComputerScene.hints @@ -0,0 +1,3 @@ +visibleInNavigator: true +canBeDroppedInFormEditor: false +canBeDroppedInView3D: true diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/ComputerScene.qml b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/ComputerScene.qml new file mode 100644 index 0000000000000000000000000000000000000000..da97ffe5704e9d4fe2dc2968925def68b13660fb --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/ComputerScene.qml @@ -0,0 +1,582 @@ +import QtQuick +import QtQuick3D +import ComponentBundles.MaterialBundle + +Node { + id: node + property bool computerOn + scale.x: 20 + scale.y: 20 + scale.z: 20 + + // Resources + property url textureData: "maps/textureData.png" + Texture { + id: _0_texture + generateMipmaps: true + mipFilter: Texture.Linear + source: node.textureData + } + + // Nodes: + Node { + id: root + objectName: "ROOT" + Model { + id: shelf + objectName: "shelf" + x: 0.8612052202224731 + y: 2.2086312770843506 + z: 14.904927253723145 + rotation: Qt.quaternion(0.962235, 0, 0.272219, 0) + scale.x: 3.49546 + scale.y: 0.306295 + scale.z: 3.42443 + source: "meshes/cube_009_mesh.mesh" + receivesShadows: true + materials: darkWood + } + + Model { + id: stool + objectName: "stool" + x: 23.590526580810547 + y: 8.943203926086426 + z: 29.924942016601562 + rotation: Qt.quaternion(0.989037, 0, 0.147666, 0) + scale.x: 3.2509 + scale.y: 0.548692 + scale.z: 3.2509 + source: "meshes/stool_mesh.mesh" + receivesShadows: true + materials: [fabric,darkWood] + } + + Model { + id: bigCandle + objectName: "bigCandle" + x: -6.650283336639404 + y: 31.326107025146484 + z: 15.047586441040039 + scale.x: 0.779315 + scale.y: 0.965801 + scale.z: 0.858924 + source: "meshes/bigCandle_mesh.mesh" + receivesShadows: true + materials: [waxCopy,ceramic] + } + + Model { + id: tallCandle + objectName: "tallCandle" + x: 38.54404830932617 + y: 14.028493881225586 + z: 16.586271286010742 + rotation: Qt.quaternion(0.646027, 0, 0.763315, 0) + scale.x: 1.60416 + scale.y: 0.0372449 + scale.z: 1.51943 + source: "meshes/tallCandle_mesh.mesh" + receivesShadows: true + materials: [wax,copper] + } + + Model { + id: table + objectName: "table" + x: 26.997087478637695 + y: 2.30503249168396 + z: 18.224262237548828 + rotation: Qt.quaternion(0.166655, 0, 0.986015, 0) + scale.x: 7.18176 + scale.y: 0.207605 + scale.z: 4.38158 + source: "meshes/cube_001_mesh.mesh" + receivesShadows: true + materials: darkWood + } + + Model { + id: coffeeCup + objectName: "coffeeCup" + x: 15.513427734375 + y: 14.027426719665527 + z: 20.39453125 + rotation: Qt.quaternion(-0.18195, 0, 0.983308, 0) + scale.x: 0.639906 + scale.y: 0.0234309 + scale.z: 0.639891 + source: "meshes/coffeeCup_mesh.mesh" + receivesShadows: true + materials: [ceramic,rubber] + } + + Model { + id: book + objectName: "book" + x: 5.756752014160156 + y: 19.152517318725586 + z: 8.733080863952637 + rotation: Qt.quaternion(0.448905, -0.132351, 0.858767, 0.208533) + scale.x: 0.583392 + scale.y: 0.583392 + scale.z: 0.583392 + source: "meshes/book_mesh.mesh" + receivesShadows: true + materials: [paper1,acrylicPaint1] + } + + Model { + id: book_002 + objectName: "book.002" + x: 3.990490198135376 + y: 18.987133026123047 + z: 10.860294342041016 + rotation: Qt.quaternion(0.474645, -0.0354606, 0.87945, 0.00473273) + scale.x: 0.583392 + scale.y: 0.583392 + scale.z: 0.583392 + source: "meshes/book_002_mesh.mesh" + receivesShadows: true + materials: [paper1,acrylicPaint1] + } + + Model { + id: book_003 + objectName: "book.003" + x: -2.5132369995117188 + y: 17.08222198486328 + z: 14.278441429138184 + rotation: Qt.quaternion(0.462656, 0.188434, 0.792117, -0.350703) + scale.x: 0.583392 + scale.y: 0.583392 + scale.z: 0.583392 + source: "meshes/book_003_mesh.mesh" + receivesShadows: true + materials: [paper,acrylicPaint3] + } + Model { + id: book_004 + objectName: "book.004" + x: 3.107 + y: 10.332 + z: 10.85843 + scale.x: 0.363335 + scale.y: 0.363335 + scale.z: 0.363335 + source: "meshes/book_004_mesh.mesh" + receivesShadows: true + eulerRotation.z: -6.56897 + eulerRotation.y: -112.64462 + eulerRotation.x: 43.92728 + materials: [paper2,acrylicPaint3] + } + Model { + id: book_005 + objectName: "book.005" + x: -5.086559772491455 + y: 10.270957946777344 + z: 14.614971160888672 + rotation: Qt.quaternion(-0.368716, 0.861019, 0.161606, 0.31077) + scale.x: 0.44612 + scale.y: 0.44612 + scale.z: 0.44612 + source: "meshes/book_005_mesh.mesh" + receivesShadows: true + materials: [paper2,acrylicPaint1] + } + + Model { + id: book_006 + objectName: "book.006" + x: -6.760748863220215 + y: 11.327892303466797 + z: 16.434104919433594 + rotation: Qt.quaternion(0.447866, -0.0917207, 0.88152, 0.11801) + scale.x: 0.363335 + scale.y: 0.363335 + scale.z: 0.363335 + source: "meshes/book_006_mesh.mesh" + receivesShadows: true + materials: [paper2,acrylicPaint3] + } + + Model { + id: book_007 + objectName: "book.007" + x: -1.0116069316864014 + y: 3.480590343475342 + z: 14.002421379089355 + rotation: Qt.quaternion(-0.368716, 0.861019, 0.161606, 0.31077) + scale.x: 0.44612 + scale.y: 0.44612 + scale.z: 0.44612 + source: "meshes/book_007_mesh.mesh" + receivesShadows: true + materials: [paper1,acrylicPaint3] + } + + Model { + id: book_008 + objectName: "book.008" + x: 0.27849817276000977 + y: 4.36872673034668 + z: 11.34302806854248 + rotation: Qt.quaternion(-0.165277, 0.912121, 0.0721117, 0.368128) + scale.x: 0.44612 + scale.y: 0.44612 + scale.z: 0.44612 + source: "meshes/book_008_mesh.mesh" + receivesShadows: true + materials: [paper2,acrylicPaint2] + } + + Model { + id: book_009 + objectName: "book.009" + x: 5.809816837310791 + y: 5.0655107498168945 + z: 8.126066207885742 + rotation: Qt.quaternion(-0.166529, -0.55137, -0.295772, 0.762088) + scale.x: 0.44612 + scale.y: 0.44612 + scale.z: 0.44612 + source: "meshes/book_009_mesh.mesh" + receivesShadows: true + materials: [paper2,acrylicPaint1] + } + + Model { + id: keyboard + objectName: "keyboard" + x: 21.7282657623291 + y: 14.471997261047363 + z: 23.340158462524414 + rotation: Qt.quaternion(0.996854, 0.0792551, 0, 0) + scale.x: 4.03661 + scale.y: 1.43318 + scale.z: 1.43318 + source: "meshes/keyboard_mesh.mesh" + receivesShadows: true + materials: [plasticMatte,plasticTextured] + } + + Model { + id: monitor + objectName: "monitor" + x: 26.503435134887695 + y: 20.149261474609375 + z: 16.700363159179688 + rotation: Qt.quaternion(0.631042, -0.086077, -0.76772, 0.0705843) + scale.x: 3.28239 + scale.y: 2.67299 + scale.z: 3.28239 + source: "meshes/monitor_mesh.mesh" + receivesShadows: true + materials: [ledMaterial,plasticTextured,monitorScreenMaterial] + } + + Model { + id: mouse + objectName: "mouse" + x: 32.512664794921875 + y: 14.60537052154541 + z: 24.130369186401367 + rotation: Qt.quaternion(0.991673, 0, 0.128784, 0) + scale.x: 0.845858 + scale.y: 0.845857 + scale.z: 0.845858 + source: "meshes/mouse_mesh.mesh" + receivesShadows: true + materials: [plasticShiny,plasticTextured] + } + + Model { + id: mousePad + objectName: "mousePad" + x: 33.37522506713867 + y: 14.169995307922363 + z: 24.25016212463379 + rotation: Qt.quaternion(0, 0.93693, 0, 0.349517) + scale.x: 4.02394 + scale.y: 0.0572671 + scale.z: 2.7114 + source: "meshes/cube_011_mesh.mesh" + receivesShadows: true + materials: fabricRough1 + } + + Model { + id: suzanne + objectName: "Suzanne" + x: 4.074446201324463 + y: 24.36581802368164 + z: 9.318511009216309 + rotation: Qt.quaternion(0.94618, -0.308675, -0.0922936, -0.0307485) + scale.x: 2.13511 + scale.y: 2.13511 + scale.z: 2.13511 + source: "meshes/suzanne_mesh.mesh" + receivesShadows: true + materials: plasticShiny1 + } + + Model { + id: computer + objectName: "computer" + x: 26.898 + y: 15.700957298278809 + z: 15.311223030090332 + rotation: Qt.quaternion(0.976636, 0, -0.2149, 0) + scale.x: 4.96433 + scale.y: 1.65478 + scale.z: 5.79172 + source: "meshes/computer_mesh.mesh" + receivesShadows: true + materials: [plasticMatte,plasticTextured,plasticShiny,ledMaterial,plasticMatte,ledMaterial,ledMaterial] + } + + Model { + id: wall + objectName: "wall" + x: 1.2337802648544312 + y: 1.3406834602355957 + z: 0.6662785410881042 + rotation: Qt.quaternion(0, 0, 1, 0) + scale.x: 20.7687 + scale.y: 0.977228 + scale.z: 20.756 + source: "meshes/cube_mesh.mesh" + receivesShadows: true + materials: woodPlanks + } + + Model { + id: floor + objectName: "floor" + x: 1.2337802648544312 + y: 1.3406834602355957 + z: 0.6662785410881042 + rotation: Qt.quaternion(0, 0, 1, 0) + scale.x: 20.7687 + scale.y: 0.977228 + scale.z: 20.756 + source: "meshes/cube_012_mesh.mesh" + receivesShadows: true + materials: woodParquet + } + + Model { + id: backWall + objectName: "backWall" + x: 1.2337802648544312 + y: 1.3406834602355957 + z: 0.6662785410881042 + rotation: Qt.quaternion(0, 0, 1, 0) + scale.x: 20.7687 + scale.y: 0.977228 + scale.z: 20.756 + source: "meshes/cube_013_mesh.mesh" + receivesShadows: true + materials: woodPlanks + } + + Model { + id: window + objectName: "window" + x: 1.2337802648544312 + y: 1.3406834602355957 + z: 0.6662785410881042 + rotation: Qt.quaternion(0, 0, 1, 0) + scale.x: 20.7687 + scale.y: 0.977228 + scale.z: 20.756 + source: "meshes/cube_010_mesh.mesh" + receivesShadows: true + materials: windowMaterial + } + } + + Node { + id: __materialLibrary__ + + PrincipledMaterial { + id: monitorScreenMaterial + baseColor: "#ffffff" + attenuationColor: "#ffffff" + objectName: "monitorScreenMaterial" + baseColorMap: _0_texture + roughness: 0.5 + cullMode: PrincipledMaterial.NoCulling + alphaMode: PrincipledMaterial.Opaque + emissiveFactor: computerOn ? Qt.vector3d(1, 2, 3) : Qt.vector3d(0, 0, 0) + } + + PrincipledMaterial { + id: windowMaterial + opacity: 0.35 + roughness: 0.6 + clearcoatRoughnessAmount: 0.02 + clearcoatAmount: 0.3 + objectName: "windowMaterial" + baseColor: "#383838" + metalness: 0.2 + cullMode: PrincipledMaterial.NoCulling + alphaMode: PrincipledMaterial.Blend + indexOfRefraction: 1.5 + } + + WoodMaterial { + id: wood + objectName: "Wood" + } + + WoodParquetMaterial { + id: woodParquet + objectName: "Wood Parquet" + } + + WoodPlanksMaterial { + id: woodPlanks + objectName: "Wood Planks" + } + + WaxMaterial { + id: wax + objectName: "Wax" + } + + PlasticTexturedMaterial { + id: plasticTextured + baseColor: "#615858" + objectName: "Plastic Textured" + } + + PlasticMatteMaterial { + id: plasticMatte + baseColor: "#8a8585" + objectName: "Plastic Matte" + } + + PlasticShinyMaterial { + id: plasticShiny + baseColor: "#c2bcbc" + objectName: "Plastic Shiny" + } + + AcrylicPaintMaterial { + id: acrylicPaint + objectName: "Acrylic Paint" + } + + FabricRoughMaterial { + id: fabricRough + objectName: "Fabric Rough" + } + + FabricMaterial { + id: fabric + baseColor: "#7390b6" + objectName: "Fabric" + } + + CopperMaterial { + id: copper + objectName: "Copper" + } + + WoodMaterial { + id: darkWood + baseColor: "#9e6a2a" + objectName: "darkWood" + } + + WaxMaterial { + id: waxCopy + subsurfaceColor: "#c44f07" + baseColor: "#c20909" + objectName: "Wax copy" + } + + CeramicMaterial { + id: ceramic + baseColor: "#2a4f79" + objectName: "Ceramic" + } + + FabricRoughMaterial { + id: fabricRough1 + baseColor: "#05510a" + objectName: "Fabric Rough" + } + + PaperMaterial { + id: paper + objectName: "Paper" + } + + PaperMaterial { + id: paper1 + baseColor: "#736e6e" + objectName: "Paper" + } + + PaperMaterial { + id: paper2 + baseColor: "#e0d385" + objectName: "Paper" + } + + AcrylicPaintMaterial { + id: acrylicPaint1 + objectName: "Acrylic Paint" + } + + AcrylicPaintMaterial { + id: acrylicPaint2 + baseColor: "#f15609" + objectName: "Acrylic Paint 2" + } + + AcrylicPaintMaterial { + id: acrylicPaint3 + objectName: "Acrylic Paint 3" + baseColor: "#b90000" + } + + RubberMaterial { + id: rubber + objectName: "Rubber" + } + + PaperMaterial { + id: paper3 + objectName: "Paper" + } + + PrincipledMaterial { + id: ledMaterial + emissiveFactor.y: computerOn ? 7.7053 : 0 + objectName: "ledMaterial" + } + + RubberMaterial { + id: rubber1 + objectName: "Rubber" + } + + PlasticShinyMaterial { + id: plasticShiny1 + baseColor: "#ffd400" + objectName: "Plastic Shiny" + } + } + + // Animations: +} + +/*##^## +Designer { + D{i:0;cameraSpeed3d:25;cameraSpeed3dMultiplier:1;matPrevEnvDoc:"SkyBox";matPrevEnvValueDoc:"preview_studio";matPrevModelDoc:"#Sphere"} +} +##^##*/ diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/_importdata.json b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/_importdata.json new file mode 100644 index 0000000000000000000000000000000000000000..c8e6584d5490e1b482e4df33642506d74543efc1 --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/_importdata.json @@ -0,0 +1,268 @@ +{ + "import_options": { + "calculateTangentSpace": { + "description": "Calculates the tangents and bitangents for the imported meshes.", + "name": "Calculate Tangent Space", + "type": "Boolean", + "value": false + }, + "designStudioWorkarounds": { + "description": "Enable options that are needed to create Design Studio compatible components.", + "name": "Design Studio Compatibility Mode", + "type": "Boolean", + "value": true + }, + "dropNormals": { + "description": "Drops normals for all faces of all meshes.", + "name": "Drop Normals", + "type": "Boolean", + "value": false + }, + "expandValueComponents": { + "description": "When enabled value types like vector3d and quaternion will be expanded.", + "name": "Expand value components", + "type": "Boolean", + "value": false + }, + "fbxPreservePivots": { + "description": "Set whether the fbx importer will preserve pivot points (as extra nodes)", + "name": "FBX: Preserve Pivot Points", + "type": "Boolean", + "value": false + }, + "findDegenerates": { + "description": "This step searches all meshes for degenerate primitives and converts them to proper lines or points.", + "name": "Find Degenerates", + "type": "Boolean", + "value": true + }, + "findInstances": { + "description": "This step searches for duplicate meshes and replaces them with references to the first mesh.", + "name": "Find Instances", + "type": "Boolean", + "value": false + }, + "findInvalidData": { + "description": "This step searches all meshes for invalid data, such as zeroed normal vectors or invalid UV coords and removes/fixes them. This is intended to get rid of some common exporter errors.", + "name": "Find Invalid Data", + "type": "Boolean", + "value": true + }, + "fixInfacingNormals": { + "description": "Tries to determine which meshes have normal vectors that are facing inwards and inverts them.", + "name": "Fix Infacing Normals", + "type": "Boolean", + "value": false + }, + "generateLightmapUV": { + "description": "Unwrap mesh to generate lightmap UV channel", + "name": "Generate Lightmap UVs", + "type": "Boolean", + "value": false + }, + "generateMeshLevelsOfDetail": { + "description": "When possible, create mesh Levels of Detail by automatically simplifying the source mesh", + "name": "Generate Mesh Levels of Detail", + "type": "Boolean", + "value": false + }, + "generateMipMaps": { + "description": "Force all imported texture components to generate mip maps for mip map texture filtering", + "name": "Generate Mip Maps", + "type": "Boolean", + "value": true + }, + "generateNormals": { + "description": "Generates normals for all faces of all meshes", + "name": "Generate Normals", + "type": "Boolean", + "value": false + }, + "generateSmoothNormals": { + "description": "Generates smooth normals for all vertices in the mesh.", + "name": "Generate Smooth Normals", + "type": "Boolean", + "value": true + }, + "globalScale": { + "description": "This step will perform a global scale of the model.", + "name": "Enable Global Scale", + "type": "Boolean", + "value": true + }, + "globalScaleValue": { + "conditions": [ + { + "mode": "Equals", + "property": "globalScale", + "value": true + } + ], + "description": "Global Scale factor.", + "name": "Global Scale Value", + "type": "Real", + "value": 20 + }, + "improveCacheLocality": { + "description": "Reorders triangles for better vertex cache locality.", + "name": "Improve Cache Locality", + "type": "Boolean", + "value": true + }, + "joinIdenticalVertices": { + "description": "Identifies and joins identical vertex data sets within all imported meshes.", + "name": "Join Identical Vertices", + "type": "Boolean", + "value": true + }, + "lightmapBaseResolution": { + "conditions": [ + { + "mode": "Equals", + "property": "generateLightmapUV", + "value": true + } + ], + "description": "Approx. size (width and height) which lightmap images should target.", + "name": "Lightmap Base Resolution", + "type": "Real", + "value": 1024 + }, + "manualAnimations": { + "description": "No TimelineAnimations are generated for Timelines so that they can be manually controlled", + "name": "Use Manual Animations", + "type": "Boolean", + "value": false + }, + "optimizeGraph": { + "description": "A postprocessing step to optimize the scene hierarchy.", + "name": "Optimize Graph", + "type": "Boolean", + "value": false + }, + "optimizeMeshes": { + "description": "A postprocessing step to reduce the number of meshes.", + "name": "Optimize Meshes", + "type": "Boolean", + "value": false + }, + "preTransformVertices": { + "description": "Removes the node graph and pre-transforms all vertices with the local transformation matrices of their nodes.", + "name": "Pre-transform Vertices", + "type": "Boolean", + "value": false + }, + "recalculateLodNormals": { + "conditions": [ + { + "mode": "Equals", + "property": "generateMeshLevelsOfDetail", + "value": true + } + ], + "description": "Calculate new normals when necessary for Generated Mesh Levels of detail", + "name": "Recalculate Normals for Generated Mesh LODs", + "type": "Boolean", + "value": true + }, + "recalculateLodNormalsMergeAngle": { + "conditions": [ + { + "mode": "Equals", + "property": "recalculateLodNormals", + "value": true + } + ], + "description": "Maximum angle in degrees to consider for normal smoothing/merging", + "name": "Merge Angle for Mesh LODs", + "type": "Real", + "value": 60 + }, + "recalculateLodNormalsSplitAngle": { + "conditions": [ + { + "mode": "Equals", + "property": "recalculateLodNormals", + "value": true + } + ], + "description": "Maximum angle in degrees to consider for normal spliting, which creates new vertex data", + "name": "Split Angle for Mesh LODs", + "type": "Real", + "value": 25 + }, + "removeComponentAnimations": { + "description": "Removes any animation components from meshes.", + "name": "Remove Animation Components", + "type": "Boolean", + "value": false + }, + "removeComponentBoneWeights": { + "description": "Removes any bone weights from meshes.", + "name": "Remove Bone Weight components", + "type": "Boolean", + "value": false + }, + "removeComponentColors": { + "description": "Removes any Color components from meshes.", + "name": "Remove Color Components", + "type": "Boolean", + "value": false + }, + "removeComponentNormals": { + "description": "Removes Normal component from meshes.", + "name": "Remove Normal Components", + "type": "Boolean", + "value": false + }, + "removeComponentTangentsAndBitangents": { + "description": "Removes Tangents and Bitangents components from meshes.", + "name": "Remove Tangent Components", + "type": "Boolean", + "value": false + }, + "removeComponentTextures": { + "description": "Removes any embedded texture components from meshes.", + "name": "Remove Texture Components", + "type": "Boolean", + "value": false + }, + "removeComponentUVs": { + "description": "Removes any UV components from meshes.", + "name": "Remove UV Components", + "type": "Boolean", + "value": false + }, + "removeRedundantMaterials": { + "description": "Searches for redundant/unreferenced materials and removes them.", + "name": "Remove Redundant Materials", + "type": "Boolean", + "value": false + }, + "splitLargeMeshes": { + "description": "Splits large meshes into smaller sub-meshes.", + "name": "Split Large Meshes", + "type": "Boolean", + "value": true + }, + "transformUVCoordinates": { + "description": "This step applies per-texture UV transformations and bakes them into stand-alone vtexture coordinate channels.", + "name": "Transform UV Coordinates", + "type": "Boolean", + "value": false + }, + "useBinaryKeyframes": { + "description": "Record keyframe data as binary files", + "name": "Use Binary Keyframes", + "type": "Boolean", + "value": true + }, + "useFloatJointIndices": { + "description": "Stores joint indices as floating point numbers for GLES 2.0.", + "name": "Use Float Joint Indices", + "type": "Boolean", + "value": false + } + }, + "source_scene": "/home/rauno/workspace/materials/3dmodels/legacy/flashlight_example/flashlight/glb/computerScene.glb" +} diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/maps/textureData.png b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/maps/textureData.png new file mode 100644 index 0000000000000000000000000000000000000000..665e140c749c78e39e0482dd3289ca8e97dfce38 --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/maps/textureData.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5eeb0b9afce283095bffaa4a483d34fffdca574f830fce41435dfa4fc2161b6 +size 71795 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/bigCandle_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/bigCandle_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..6fef40dfc99dd81333a4a8692ec49ca63ca0097f --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/bigCandle_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8de210ed03cf3889356a298b754ab1bbb8233254ae796eb6d1abdf7903e6dd41 +size 3202300 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_002_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_002_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..c89bf679490f9ed361c37aaf555538fec0bada8e --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_002_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2480be4bc2942b306831e6fd55a1c1325fb25dfab3a370118e7c69e7824708b3 +size 34988 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_003_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_003_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..c89bf679490f9ed361c37aaf555538fec0bada8e --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_003_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2480be4bc2942b306831e6fd55a1c1325fb25dfab3a370118e7c69e7824708b3 +size 34988 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_004_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_004_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..c89bf679490f9ed361c37aaf555538fec0bada8e --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_004_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2480be4bc2942b306831e6fd55a1c1325fb25dfab3a370118e7c69e7824708b3 +size 34988 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_005_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_005_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..c89bf679490f9ed361c37aaf555538fec0bada8e --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_005_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2480be4bc2942b306831e6fd55a1c1325fb25dfab3a370118e7c69e7824708b3 +size 34988 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_006_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_006_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..c89bf679490f9ed361c37aaf555538fec0bada8e --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_006_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2480be4bc2942b306831e6fd55a1c1325fb25dfab3a370118e7c69e7824708b3 +size 34988 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_007_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_007_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..c89bf679490f9ed361c37aaf555538fec0bada8e --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_007_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2480be4bc2942b306831e6fd55a1c1325fb25dfab3a370118e7c69e7824708b3 +size 34988 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_008_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_008_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..c89bf679490f9ed361c37aaf555538fec0bada8e --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_008_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2480be4bc2942b306831e6fd55a1c1325fb25dfab3a370118e7c69e7824708b3 +size 34988 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_009_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_009_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..c89bf679490f9ed361c37aaf555538fec0bada8e --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_009_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2480be4bc2942b306831e6fd55a1c1325fb25dfab3a370118e7c69e7824708b3 +size 34988 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..c89bf679490f9ed361c37aaf555538fec0bada8e --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/book_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2480be4bc2942b306831e6fd55a1c1325fb25dfab3a370118e7c69e7824708b3 +size 34988 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/coffeeCup_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/coffeeCup_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..bdacccf6ed5bfef14f6b0a850343646766ee2abd --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/coffeeCup_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06f294214cbfd159acdb5ef4b0e05bff67590bdb4e67c4ff7d2f94d8eda6cbf8 +size 131436 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/computer_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/computer_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..4793651d870ca8e36f5af34d3184572313e44bcc --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/computer_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a597931a0932ed819bb75be3b987460029a85c2845f26430d1775aa83205b33 +size 72876 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_001_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_001_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..16ad45950342cd6ec9db08c3a03b457258cb6b3d --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_001_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bdf34af54debe64debccae8cd3b9cbc274e10c27dbd1a614ef42ac482ec9ccb7 +size 22892 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_009_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_009_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..b3b1748f64e09bf1226356786f8a4b4538991da6 --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_009_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cbae5504568a755fd74ff4dc738cbe1f047eb90497e60e5c7ca82d018887913e +size 14700 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_010_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_010_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..7b2926ee7df03ca55025838ff8aee1b3721b1794 --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_010_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8acc8a9bcc291e2d59c7d5f52e5889d3786c2aadf48e05e7b409b12579058ec7 +size 1212 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_011_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_011_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..43811ad1ee0ab3099c797d8b9e04d44f720ca6a9 --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_011_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:619ac29e0e415145cd88ee80b7562e36db7e77914ba7b430f98b8fe6c1717856 +size 44988 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_012_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_012_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..80860096b46b34a7c9fdb129fd836e375c2f7595 --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_012_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c815f175bc380712a5977f18530353e574592f3df5d97540ef83e3542c053b1 +size 2956 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_013_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_013_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..8a697670f96a5373a599f7c9901628f7d99462d6 --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_013_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec2373c2d3494a63cc1522e8778c13e524183299d84f7a89d7bc5e99b17f1f68 +size 1212 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..486e7fc0a195d9f5982fd6281642e421a30abe44 --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/cube_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ee5b86f73a342743bd661cc00f4318950a2eb6436334aaf1810c3e86d4c8d73 +size 4332 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/keyboard_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/keyboard_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..318a078d2a71705b71a4eca999f6ed31069c2c60 --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/keyboard_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8460ef7a1be920e396ed5b352719e8cce8d5cb3ba038613fbbb25c8dc54b4a1e +size 314780 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/monitor_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/monitor_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..3a86c73970ee8e9f68a8b9fe5fa606ec14d7f924 --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/monitor_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcda6a8cadedfeee409308b3d5af4a1fed33fa8bbde97f8c729f000df27e9b06 +size 71148 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/mouse_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/mouse_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..875742b6f5ce3d85cd1987c6a548d9a85a2d8c87 --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/mouse_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49c521f429234f3ef6131f43b6536e22fac2a93d9d59009f79f5098a94ecb072 +size 25548 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/stool_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/stool_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..bc8326a0aa03f17d4e5e44fd03519ec554f1875f --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/stool_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa4155775a31e3ccffaa28036be5706f35439dc7ae55e2cffef8f94371474228 +size 58588 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/suzanne_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/suzanne_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..56a8fb3696c2a15339455ed1cf2f51a5c6f75ccf --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/suzanne_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ca3929a53701ce92ea1ad2d330d8adde5116fd5f63768394e1e6f1a0fc1a7f8 +size 113228 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/tallCandle_mesh.mesh b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/tallCandle_mesh.mesh new file mode 100644 index 0000000000000000000000000000000000000000..745788572ad22add13861bd226744f62ba5f2b2b --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/meshes/tallCandle_mesh.mesh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ce970ae7e2736d51863d9848c63469baf8b9b6689c6264843d502e26058e3d6 +size 759100 diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/qmldir b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/qmldir new file mode 100644 index 0000000000000000000000000000000000000000..470cbbde59e2d8303b63354f392e1fa196a2d823 --- /dev/null +++ b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/qmldir @@ -0,0 +1,2 @@ +module Quick3DAssets.ComputerScene +ComputerScene 1.0 ComputerScene.qml diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/source scene/computerScene.glb b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/source scene/computerScene.glb new file mode 100644 index 0000000000000000000000000000000000000000..e393cb327a1b0b9b1366d4094f4acb990ec55817 Binary files /dev/null and b/examples/Flashlight/asset_imports/Quick3DAssets/ComputerScene/source scene/computerScene.glb differ diff --git a/examples/Flashlight/asset_imports/Quick3DAssets/Flashlight/Flashlight.qml b/examples/Flashlight/asset_imports/Quick3DAssets/Flashlight/Flashlight.qml index f6c2bb06115e7600a78431f85d936c656d4a3f39..075441331e14a7d0bb7e8be469ea6ef52be50d68 100644 --- a/examples/Flashlight/asset_imports/Quick3DAssets/Flashlight/Flashlight.qml +++ b/examples/Flashlight/asset_imports/Quick3DAssets/Flashlight/Flashlight.qml @@ -1,17 +1,19 @@ import QtQuick import QtQuick3D -import ComponentBundles.MaterialBundle 1.0 -import QtQuick.Timeline 1.0 +import ComponentBundles.MaterialBundle +import QtQuick.Timeline Node { id: node - property Item property0: null + property double lampBrightness + // Resources // Nodes: Node { id: root objectName: "ROOT" + Model { id: lamp objectName: "lamp" @@ -26,6 +28,7 @@ Node { chrome_material ] } + Model { id: button objectName: "button" @@ -58,9 +61,9 @@ Node { PrincipledMaterial { id: lamp_material - emissiveFactor.z: 0.5 - emissiveFactor.y: 3 - emissiveFactor.x: 3 + emissiveFactor.z: node.lampBrightness - 2.5 + emissiveFactor.y: node.lampBrightness + emissiveFactor.x: node.lampBrightness objectName: "lamp" baseColor: "#ffffff" roughness: 0.5 @@ -111,56 +114,6 @@ Node { } } - Timeline { - id: timeline - currentFrame: property0.value - startFrame: 0 - endFrame: 1000 - enabled: true - - KeyframeGroup { - target: lamp_material - property: "emissiveFactor.x" - Keyframe { - value: 3 - frame: 0 - } - - Keyframe { - value: 0 - frame: 1000 - } - } - - KeyframeGroup { - target: lamp_material - property: "emissiveFactor.y" - Keyframe { - value: 3 - frame: 0 - } - - Keyframe { - value: 0 - frame: 1000 - } - } - - KeyframeGroup { - target: lamp_material - property: "emissiveFactor.z" - Keyframe { - value: 0.5 - frame: 0 - } - - Keyframe { - value: 0 - frame: 1000 - } - } - } - Model { id: cylinder x: -20.903 @@ -182,6 +135,6 @@ Node { /*##^## Designer { - D{i:0;cameraSpeed3d:25;cameraSpeed3dMultiplier:1}D{i:20;invisible:true} + D{i:0;cameraSpeed3d:25;cameraSpeed3dMultiplier:1;matPrevEnvDoc:"SkyBox";matPrevEnvValueDoc:"preview_studio";matPrevModelDoc:"#Sphere"} } ##^##*/ diff --git a/examples/Flashlight/content/App.qml b/examples/Flashlight/content/App.qml index 2174d0d09f14dceb8062f181515c38a409b20091..fa9638c6f2eb8a6149b916ef0f96fc31e8df7b67 100644 --- a/examples/Flashlight/content/App.qml +++ b/examples/Flashlight/content/App.qml @@ -5,15 +5,13 @@ import QtQuick import Flashlight Window { - width: mainScreen.width - height: mainScreen.height - + width: Constants.width + height: Constants.height visible: true title: "Flashlight" Screen01 { id: mainScreen + anchors.fill: parent } - } - diff --git a/examples/Flashlight/content/ArcballController.qml b/examples/Flashlight/content/ArcballController.qml new file mode 100644 index 0000000000000000000000000000000000000000..d2e7dec33e5505268b6748e7c41a9bf386483876 --- /dev/null +++ b/examples/Flashlight/content/ArcballController.qml @@ -0,0 +1,74 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +import QtQuick +import QtQuick3D + +// The rotation math is based on the paper +// ARCBALL: +// A User Interface for Specifying Three-Dimensional Orientation Using a Mouse +// by Ken Shoemake, 1992 +Item { + id: root + visible: false + + required property Node controlledObject + property vector3d lastPos: Qt.vector3d(0, 0, 0) + property bool moving: false + + // From Shoemake 1992: + // pt.x <- (screen.x - center.x)/radius; + // pt.y <- (screen.y - center.y)/radius; + // r <- pt.x*pt.x + pt.y*pt.y; + // IF r > 1.0 + // THEN s <- 1.0/Sqrt[r]; + // pt.x <- s*pt.x; + // pt.y <- s*pt.y; + // pt.z <- 0.0; + // ELSE pt.z <- Sqrt[1.0 - r] ; + function pos2DToPos3D(posNDC) { + var pt = Qt.vector3d(posNDC.x, posNDC.y, 0) + let r = posNDC.x * posNDC.x + posNDC.y * posNDC.y + if (r > 1.0) { + let s = 1.0 / Math.sqrt(r) + pt.x = s * pt.x + pt.y = s * pt.y + pt.z = 0.0 + } else { + pt.z = Math.sqrt(1.0 - r) + } + + return pt + } + + function mousePressed(posNDC) { + lastPos = pos2DToPos3D(posNDC) + moving = true + } + + function mouseReleased(posNDC) { + moving = false + } + + function mouseMoved(posNDC) { + if (!moving) + return + + let currentPos = pos2DToPos3D(posNDC) + + // From Shoemake 1992: + // [q.x, q.y, q.z] <- V3_Cross[pO, p1]; + // q.w <- V3_Dot[pO, p1]; + // qnow <- QuatMul[q, qstart]; + let p0 = lastPos + let p1 = currentPos + let p0p1 = p0.crossProduct(p1) + let q = Qt.quaternion(p0.dotProduct(p1), p0p1.x, p0p1.y, p0p1.z) + let qnow = q.times(controlledObject.rotation) + controlledObject.rotation = qnow + lastPos = currentPos + } + + Item { + id: __materialLibrary__ + } +} diff --git a/examples/Flashlight/content/MouseRotatorAndWASD.qml b/examples/Flashlight/content/MouseRotatorAndWASD.qml new file mode 100644 index 0000000000000000000000000000000000000000..6666ce97c8275a1f722725b2e2be4206fa77f450 --- /dev/null +++ b/examples/Flashlight/content/MouseRotatorAndWASD.qml @@ -0,0 +1,322 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick3D + +Item { + id: root + + property Node controlledObject + + property real speed: 1 + property real shiftSpeed: 3 + + property real forwardSpeed: 5 + property real backSpeed: 5 + property real rightSpeed: 5 + property real leftSpeed: 5 + property real upSpeed: 5 + property real downSpeed: 5 + property real xSpeed: 0.1 + property real ySpeed: 0.1 + + property bool xInvert: true + property bool yInvert: false + + property bool mouseEnabled: true + property bool keysEnabled: true + + readonly property bool inputsNeedProcessing: status.moveForward | status.moveBack + | status.moveLeft | status.moveRight + | status.moveUp | status.moveDown + | status.useMouse + + property alias acceptedButtons: dragHandler.acceptedButtons + + implicitWidth: parent.width + implicitHeight: parent.height + focus: keysEnabled + + DragHandler { + id: dragHandler + + target: null + enabled: mouseEnabled + onCentroidChanged: { + mouseMoved(Qt.vector2d(centroid.position.x, centroid.position.y)); + } + + onActiveChanged: { + if (active) + mousePressed(Qt.vector2d(centroid.position.x, centroid.position.y)); + else + mouseReleased(Qt.vector2d(centroid.position.x, centroid.position.y)); + } + } + + TapHandler { + onTapped: root.forceActiveFocus() + } + + Keys.onPressed: (event) => { if (keysEnabled) handleKeyPress(event) } + Keys.onReleased: (event) => { if (keysEnabled) handleKeyRelease(event) } + + function mousePressed(newPos) { + root.forceActiveFocus() + status.currentPos = newPos + status.lastPos = newPos + status.useMouse = true; + } + + function mouseReleased(newPos) { + status.useMouse = false; + } + + function mouseMoved(newPos) { + status.currentPos = newPos; + } + + function forwardPressed() { + status.moveForward = true + status.moveBack = false + } + + function forwardReleased() { + status.moveForward = false + } + + function backPressed() { + status.moveBack = true + status.moveForward = false + } + + function backReleased() { + status.moveBack = false + } + + function rightPressed() { + status.moveRight = true + status.moveLeft = false + } + + function rightReleased() { + status.moveRight = false + } + + function leftPressed() { + status.moveLeft = true + status.moveRight = false + } + + function leftReleased() { + status.moveLeft = false + } + + function upPressed() { + status.moveUp = true + status.moveDown = false + } + + function upReleased() { + status.moveUp = false + } + + function downPressed() { + status.moveDown = true + status.moveUp = false + } + + function downReleased() { + status.moveDown = false + } + + function shiftPressed() { + status.shiftDown = true + } + + function shiftReleased() { + status.shiftDown = false + } + + function handleKeyPress(event) { + switch (event.key) { + case Qt.Key_W: + case Qt.Key_Up: + if (controlledObject === monkeyModel) + backPressed(); + else + forwardPressed(); + break; + case Qt.Key_S: + case Qt.Key_Down: + if (controlledObject === monkeyModel) + forwardPressed(); + else + backPressed(); + break; + case Qt.Key_A: + case Qt.Key_Left: + leftPressed(); + break; + case Qt.Key_D: + case Qt.Key_Right: + rightPressed(); + break; + case Qt.Key_R: + case Qt.Key_PageUp: + upPressed(); + break; + case Qt.Key_F: + case Qt.Key_PageDown: + downPressed(); + break; + case Qt.Key_Shift: + shiftPressed(); + break; + } + } + + function handleKeyRelease(event) { + switch (event.key) { + case Qt.Key_W: + case Qt.Key_Up: + if (controlledObject === monkeyModel) + backReleased(); + else + forwardReleased(); + break; + case Qt.Key_S: + case Qt.Key_Down: + if (controlledObject === monkeyModel) + forwardReleased(); + else + backReleased(); + break; + case Qt.Key_A: + case Qt.Key_Left: + leftReleased(); + break; + case Qt.Key_D: + case Qt.Key_Right: + rightReleased(); + break; + case Qt.Key_R: + case Qt.Key_PageUp: + upReleased(); + break; + case Qt.Key_F: + case Qt.Key_PageDown: + downReleased(); + break; + case Qt.Key_Shift: + shiftReleased(); + break; + } + } + + WheelHandler { + id: wheelHandler + orientation: Qt.Vertical + target: null + acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad + onWheel: event => { + let delta = -event.angleDelta.y * 0.01 + sceneCamera.z += sceneCamera.z * 0.1 * delta + } + } + + Timer { + id: updateTimer + + interval: 16 + repeat: true + running: root.inputsNeedProcessing + onTriggered: { + processInputs(); + } + } + + function processInputs() { + if (root.inputsNeedProcessing) + status.processInput(); + } + + QtObject { + id: status + + property bool moveForward: false + property bool moveBack: false + property bool moveLeft: false + property bool moveRight: false + property bool moveUp: false + property bool moveDown: false + property bool shiftDown: false + property bool useMouse: false + + property vector2d lastPos: Qt.vector2d(0, 0) + property vector2d currentPos: Qt.vector2d(0, 0) + + function updatePosition(vector, speed, position) { + if (shiftDown) + speed *= shiftSpeed; + else + speed *= root.speed + + var direction = vector; + var velocity = Qt.vector3d(direction.x * speed, + direction.y * speed, + direction.z * speed) + controlledObject.position = Qt.vector3d(position.x + velocity.x, + position.y + velocity.y, + position.z + velocity.z) + } + + function negate(vector) { + return Qt.vector3d(-vector.x, -vector.y, -vector.z) + } + + function processInput() { + if (controlledObject == undefined) + return; + + if (moveForward) + updatePosition(controlledObject.forward, forwardSpeed, controlledObject.position) + else if (moveBack) + updatePosition(negate(controlledObject.forward), backSpeed, controlledObject.position) + + if (moveRight) + updatePosition(controlledObject.right, rightSpeed, controlledObject.position) + else if (moveLeft) + updatePosition(negate(controlledObject.right), leftSpeed, controlledObject.position) + + if (moveDown) + updatePosition(negate(controlledObject.up), downSpeed, controlledObject.position) + else if (moveUp) + updatePosition(controlledObject.up, upSpeed, controlledObject.position) + + if (useMouse) { + // Get the delta + var rotationVector = controlledObject.eulerRotation; + var delta = Qt.vector2d(lastPos.x - currentPos.x, + lastPos.y - currentPos.y); + // rotate x + var rotateX = delta.x * xSpeed + if (xInvert) + rotateX = -rotateX; + rotationVector.y += rotateX; + + // rotate y + var rotateY = delta.y * -ySpeed + if (yInvert) + rotateY = -rotateY; + if (rotationVector.x + rotateY <= 180 && rotationVector.x + rotateY >= -180.0 ) + rotationVector.x += rotateY; + + + controlledObject.setEulerRotation(rotationVector); + lastPos = currentPos; + } + } + } +} diff --git a/examples/Flashlight/content/Screen01.ui.qml b/examples/Flashlight/content/Screen01.ui.qml index 4abec8eb88bd6dc2b4e4875273b7fdc730e56698..6a2637c87f7f43724799c80752df7e418c8e2671 100644 --- a/examples/Flashlight/content/Screen01.ui.qml +++ b/examples/Flashlight/content/Screen01.ui.qml @@ -1,5 +1,4 @@ - /* This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only. It is supposed to be strictly declarative and only uses a subset of QML. If you edit @@ -11,24 +10,65 @@ import QtQuick.Controls import QtQuick3D import QtQuick3D.Effects import QtQuick3D.Helpers +import QtQuick3D.Particles3D import Flashlight import Quick3DAssets.Flashlight -import QtQuick.Timeline 1.0 -import ComponentBundles.MaterialBundle 1.0 +import QtQuick.Timeline +import ComponentBundles.MaterialBundle import Effects.Glow 1.0 import QtQuick.Layouts +import Quick3DAssets.ComputerScene Rectangle { id: rectangle width: Constants.width height: Constants.height - color: Constants.backgroundColor + OrbitCameraController { + origin: cameraNode + camera: sceneCamera + } + + ArcballController { + id: arcballController + controlledObject: flashlight + } + + DragHandler { + id: dragHandler + target: null + acceptedButtons: Qt.RightButton + } + + Connections { + target: dragHandler + onCentroidChanged: { + arcballController.mouseMoved(toNDC(dragHandler.centroid.position.x, + dragHandler.centroid.position.y)) + } + + onActiveChanged: { + if (dragHandler.active) { + view3D.forceActiveFocus() + arcballController.mousePressed( + toNDC(dragHandler.centroid.position.x, + dragHandler.centroid.position.y)) + } else + arcballController.mouseReleased( + toNDC(dragHandler.centroid.position.x, + dragHandler.centroid.position.y)) + } + + function toNDC(x, y) { + return Qt.vector2d((2.0 * x / width) - 1.0, + 1.0 - (2.0 * y / height)) + } + } + View3D { id: view3D anchors.fill: parent - environment: sceneEnvironment ExtendedSceneEnvironment { @@ -42,11 +82,11 @@ Rectangle { | (checkBox4.checked ? ExtendedSceneEnvironment.GlowLevel.Five : 0) | (checkBox5.checked ? ExtendedSceneEnvironment.GlowLevel.Six : 0) | (checkBox6.checked ? ExtendedSceneEnvironment.GlowLevel.Seven : 0) - probeExposure: slider_hdr_strength.value - glowBloom: slider_bloom.value - glowIntensity: slider_intensity.value - glowStrength: slider_strength.value - glowUseBicubicUpscale: switchBicubicUpsampling.checked + probeExposure: hdrStrengthSlider.value + glowBloom: bloomSlider.value + glowIntensity: intensitySlider.value + glowStrength: strengthSlider.value + glowUseBicubicUpscale: bicubicUpsamplingSwitch.checked glowHDRScale: 1 lutEnabled: false skyboxBlurAmount: 0 @@ -56,9 +96,6 @@ Rectangle { depthOfFieldEnabled: false aoStrength: 100 aoEnabled: false - lensFlareGhostDispersal: 0.2 - lensFlareBloomBias: 0.2 - lensFlareBloomScale: 1 lensFlareEnabled: false clearColor: "#0d0d0d" glowHDRMaximumValue: 10 @@ -74,42 +111,181 @@ Rectangle { Node { id: scene - PerspectiveCamera { - id: sceneCamera - fieldOfView: 30 - z: 350 + Node { + id: cameraNode + + PerspectiveCamera { + id: sceneCamera + x: -76.671 + y: 360.403 + z: 928.88629 + fieldOfView: 50 + } + } + + ComputerScene { + id: computerScene + x: -510.156 + y: -58.105 + z: -579.67474 + computerOn: computerCheckBox.checked } Flashlight { id: flashlight - property0: slider_lamp_brightness - x: 51 - y: 13 - eulerRotation.y: 45 - eulerRotation.z: 17.54678 - eulerRotation.x: 0 + lampBrightness: lampBrightnessSlider.value + x: -132.293 + y: 388.959 + z: 459.99136 + eulerRotation.y: -72.92974 + eulerRotation.z: 14.35545 + eulerRotation.x: 6.70334 scale.z: 10 scale.y: 10 scale.x: 10 - z: 0 + + SpotLight { + id: spotlight + x: -9.396 + y: -0.067 + z: 0.02136 + eulerRotation.z: -1.50592 + eulerRotation.y: 90.41776 + eulerRotation.x: 0.01524 + color: "#fce18e" + quadraticFade: 0.99977 + coneAngle: lampConeAngleSlider.value + innerConeAngle: lampConeAngleSlider.value - 100 + brightness: lampBrightnessSlider.value * 20 + castsShadow: true + } + } + + PointLight { + id: bigCandleLight + x: -641.195 + y: 616.32 + z: -278.44458 + color: "#ec7904" + brightness: candleCheckBox.checked ? 1.5 : 0 + castsShadow: true + } + + PointLight { + id: candleLight + x: 261.192 + y: 361.978 + z: -247.59242 + color: "#e0d385" + quadraticFade: 2.18894 + brightness: candleCheckBox.checked ? 3 : 0 + castsShadow: true + } + + PointLight { + id: monitorLight + x: 2.718 + y: 399.139 + color: "#88bbd9" + quadraticFade: 1.94466 + brightness: computerCheckBox.checked ? 1 : 0 + z: -162.31596 + } + } + + ParticleSystem3D { + id: psystem + x: -641.196 + y: 611.46 + z: -277.76849 + + SpriteParticle3D { + id: particleFire + sprite: Texture { + source: "images/sphere.png" + } + colorTable: Texture { + source: "images/colorTable.png" + } + maxAmount: 69 + color: "#ffffff" + colorVariation: Qt.vector4d(0.0, 0.6, 0.8, 0.0) + billboard: true + blendMode: SpriteParticle3D.Screen + fadeInDuration: 100 + castsReflections: true + } + + ParticleEmitter3D { + id: fireEmitter + particle: particleFire + enabled: candleCheckBox.checked + particleScale: 2 + particleEndScale: 0 + particleScaleVariation: 3 + particleEndScaleVariation: 5 + velocity: VectorDirection3D { + direction: Qt.vector3d(0, 45, 0) + directionVariation: Qt.vector3d(10, 30, 0) + } + emitRate: 200 + lifeSpan: 1000 + lifeSpanVariation: 500 + } + } + + ParticleSystem3D { + id: psystem1 + x: 259.261 + y: 350 + z: -247.30052 + SpriteParticle3D { + id: anotherParticleFire + sprite: Texture { + source: "images/sphere.png" + } + colorTable: Texture { + source: "images/colorTable.png" + } + maxAmount: 69 + color: "#ffffff" + colorVariation: Qt.vector4d(0.0, 0.6, 0.8, 0.0) + billboard: true + blendMode: SpriteParticle3D.Screen + fadeInDuration: 100 + castsReflections: true + } + + ParticleEmitter3D { + id: anotherFireEmitter + enabled: candleCheckBox.checked + particle: anotherParticleFire + particleScale: 0 + particleEndScale: 0 + particleScaleVariation: 5 + particleEndScaleVariation: 10 + velocity: VectorDirection3D { + direction: Qt.vector3d(0, 25, 0) + directionVariation: Qt.vector3d(10, 50, 0) + } + emitRate: 400 + lifeSpan: 1000 + lifeSpanVariation: 500 } } } ColumnLayout { - id: controlsID - anchors.left: parent.left - anchors.top: parent.top - anchors.leftMargin: 24 - anchors.topMargin: 24 - spacing: 24 + id: controlLayout + spacing: 8 + Pane { - id: pane_lamp + id: lampPane background: null + Column { id: columnLampBrightness Text { - id: lampBrightnessTextID color: "#ffffff" text: qsTr("Lamp brightness") font.pixelSize: 18 @@ -119,15 +295,37 @@ Rectangle { id: row spacing: 8 Slider { - id: slider_lamp_brightness - value: 0 - to: 0 - from: 1000 + id: lampBrightnessSlider + value: 3.5 + to: 10 + from: 0 + stepSize: 0.01 } Text { id: lampBrightnessValueID color: "#ffffff" - text: 1000 - (slider_lamp_brightness.value).toFixed(0) + text: lampBrightnessSlider.value.toFixed(1) + anchors.verticalCenter: parent.verticalCenter + font.pixelSize: 18 + } + } + Text { + color: "#ffffff" + text: qsTr("Lamp cone angle") + font.pixelSize: 18 + wrapMode: Text.NoWrap + } + Row { + Slider { + id: lampConeAngleSlider + value: 25 + to: 100 + from: 0 + stepSize: 0.1 + } + Text { + color: "#ffffff" + text: lampConeAngleSlider.value.toFixed(1) anchors.verticalCenter: parent.verticalCenter font.pixelSize: 18 } @@ -136,10 +334,9 @@ Rectangle { } Pane { - id: pane_hdr - - spacing: 24 + id: hdrPane background: null + ColumnLayout { Column { id: columnHDRBrightness @@ -155,10 +352,11 @@ Rectangle { Row { spacing: 8 Slider { - id: slider_hdr_strength - value: 0.3 + id: hdrStrengthSlider + from: 0 + value: 0.2 stepSize: 0.01 - to: 10 + to: 5 } Text { id: environmentBrightnessValueID @@ -198,7 +396,7 @@ Rectangle { } Pane { - id: pane_glow + id: glowPane background: null Column { @@ -213,7 +411,7 @@ Rectangle { } Row { Slider { - id: slider_strength + id: strengthSlider value: 0.8 stepSize: 0.01 to: 2 @@ -235,7 +433,7 @@ Rectangle { } Row { Slider { - id: slider_intensity + id: intensitySlider value: 2 stepSize: 0.01 to: 2 @@ -243,7 +441,6 @@ Rectangle { Text { id: textGlowIntensityValue - color: "#ffffff" text: (sceneEnvironment.glowIntensity).toFixed(2) font.pixelSize: 18 @@ -259,7 +456,7 @@ Rectangle { } Row { Slider { - id: slider_bloom + id: bloomSlider value: 0.2 stepSize: 0.01 } @@ -273,8 +470,8 @@ Rectangle { } Switch { - id: switchBicubicUpsampling - text: qsTr("Bicubic Upsampling") + id: bicubicUpsamplingSwitch + text: qsTr("Bicubic upsampling") checkable: true checked: false } @@ -282,7 +479,7 @@ Rectangle { } Pane { - id: pane_levels + id: levelsPane background: null Column { @@ -291,7 +488,7 @@ Rectangle { Text { id: text5 color: "#ffffff" - text: qsTr("Blur levels") + text: qsTr("Glow blur levels") font.pixelSize: 18 wrapMode: Text.NoWrap } @@ -347,39 +544,61 @@ Rectangle { } Pane { - id: pane_blend + id: blendPane background: null Column { id: columnBlend width: 200 height: 400 + spacing: 6 Text { id: text6 color: "#ffffff" - text: qsTr("Blend mode") + text: qsTr("Glow blend mode") font.pixelSize: 18 wrapMode: Text.NoWrap } ComboBox { id: comboBoxBlendMode - model: ["Additive", "Screen", "Soft Light", "Replace"] + model: ["Additive", "Screen", "Soft light", "Replace"] displayText: model[comboBoxBlendMode.currentIndex] } } } + + Pane { + id: helpPane + background: null + + Column { + + Row { + + CheckBox { + id: computerCheckBox + text: qsTr("Computer") + } + + CheckBox { + id: candleCheckBox + text: qsTr("Candles") + } + } + + Text { + id: helpText + color: "#ffffff" + text: qsTr("Left mouse button - Rotate camera\nRight mouse button - Move flashlight\nCtrl + left mouse button - Move camera") + } + } + } } Item { id: __materialLibrary__ - PrincipledMaterial { - id: defaultMaterial - roughness: 0.5 - objectName: "Default Material" - baseColor: "#4aee45" - } Texture { id: moonless_golf_4k @@ -391,28 +610,12 @@ Rectangle { source: "images/BasicLights3_4K.hdr" } } - - Timeline { - id: timeline - animations: [ - TimelineAnimation { - id: timelineAnimation - running: true - loops: 1 - duration: 1000 - to: 1000 - from: 0 - } - ] - startFrame: 0 - endFrame: 1000 - enabled: true - } } /*##^## Designer { - D{i:0}D{i:3;cameraSpeed3d:25;cameraSpeed3dMultiplier:1}D{i:53} + D{i:0;matPrevEnvDoc:"SkyBox";matPrevEnvValueDoc:"preview_studio";matPrevModelDoc:"#Sphere"} +D{i:5;cameraSpeed3d:25;cameraSpeed3dMultiplier:1} } ##^##*/ diff --git a/examples/Flashlight/content/images/colorTable.png b/examples/Flashlight/content/images/colorTable.png new file mode 100644 index 0000000000000000000000000000000000000000..4514771d6ddcbd3795d731689234d21cb2844990 --- /dev/null +++ b/examples/Flashlight/content/images/colorTable.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c1933b4282facd74f9186b725060c3050fe49e30a347e9dcf45a98e0f4a0e5d +size 14173 diff --git a/examples/Flashlight/content/images/sphere.png b/examples/Flashlight/content/images/sphere.png new file mode 100644 index 0000000000000000000000000000000000000000..96a2b018cc03e1ce0113b28d857fd23041539216 --- /dev/null +++ b/examples/Flashlight/content/images/sphere.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75d099fd3c6d5e6e07b39408a4f8158d00f0b73fc3b6e3302818642719211731 +size 1604 diff --git a/examples/dataImports/DataModels/images/flashlight_demo.png b/examples/dataImports/DataModels/images/flashlight_demo.png index 390aa7642f9beb001be7ae30aa1cf026fb33ee5c..5fd4ac34c9158ef479693212fd0a3475bbf982a4 100644 --- a/examples/dataImports/DataModels/images/flashlight_demo.png +++ b/examples/dataImports/DataModels/images/flashlight_demo.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:26d95044a1adbfa6005bf69abe2112e970176c11996a36bafc9c9af58f22b3db -size 36594 +oid sha256:27013b7b74c364f7ebfb65dc6181080a3e0a13a75476df0615521e3928d1cfa2 +size 38615