summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@qt.io>2017-12-07 10:51:38 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2017-12-07 14:07:35 +0000
commit8a71e623b1ddfeed455d89be1f188996836053a3 (patch)
treeeb9ed1780d7ae1e00e574995536cd76c127832db /res
parent71b625cdebae8f15a7e3a9c861a2628099254bb7 (diff)
Sync effectlib changes from Qt 3D Studio
There were not too many differences, but some notable ones are: Copyright headers are back. UIC -> QT3DS renames Removal of (f) from float literals (which was not valid GLSL) Task-number: QT3DS-367 Change-Id: Ieb21f0e5a46c9513f166d8fe3944af3271770acd Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'res')
-rw-r--r--res/effectlib/Fxaa3_11.glsllib30
-rw-r--r--res/effectlib/Fxaa3_8.glsllib34
-rw-r--r--res/effectlib/SMAA.glsllib30
-rw-r--r--res/effectlib/SSAOCustomMaterial.glsllib51
-rw-r--r--res/effectlib/abbeNumberIOR.glsllib31
-rw-r--r--res/effectlib/anisotropyConversion.glsllib32
-rw-r--r--res/effectlib/average.glsllib31
-rw-r--r--res/effectlib/blur.glsllib38
-rw-r--r--res/effectlib/calculateRoughness.glsllib31
-rw-r--r--res/effectlib/coordinateSource.glsllib31
-rw-r--r--res/effectlib/cube.glsllib31
-rw-r--r--res/effectlib/customCurveLayer.glsllib31
-rw-r--r--res/effectlib/customMaterial.glsllib30
-rw-r--r--res/effectlib/customMaterialFragBody.glsllib30
-rw-r--r--res/effectlib/customMaterialFragBodyAO.glsllib30
-rw-r--r--res/effectlib/defaultMaterialFileBumpTexture.glsllib40
-rw-r--r--res/effectlib/defaultMaterialFileDisplacementTexture.glsllib40
-rw-r--r--res/effectlib/defaultMaterialFileNormalTexture.glsllib40
-rw-r--r--res/effectlib/defaultMaterialFresnel.glsllib30
-rw-r--r--res/effectlib/defaultMaterialFresnelNoDvn.glsllib43
-rw-r--r--res/effectlib/defaultMaterialPhysGlossyBSDF.glsllib34
-rw-r--r--res/effectlib/depthpass.glsllib46
-rw-r--r--res/effectlib/dfTint.glsllib31
-rw-r--r--res/effectlib/diffuseReflectionBSDF.glsllib31
-rw-r--r--res/effectlib/diffuseTransmissionBSDF.glsllib30
-rw-r--r--res/effectlib/directionalFactor.glsllib30
-rw-r--r--res/effectlib/effect.glsllib41
-rw-r--r--res/effectlib/evalBakedShadowMap.glsllib30
-rw-r--r--res/effectlib/evalEnvironmentMap.glsllib30
-rw-r--r--res/effectlib/evalLightmaps.glsllib30
-rw-r--r--res/effectlib/fileBumpTexture.glsllib32
-rw-r--r--res/effectlib/fileDisplacementTexture.glsllib34
-rw-r--r--res/effectlib/fileTexture.glsllib31
-rw-r--r--res/effectlib/flakeNoiseBumpTexture.glsllib31
-rw-r--r--res/effectlib/flakeNoiseTexture.glsllib30
-rw-r--r--res/effectlib/fresnelLayer.glsllib32
-rw-r--r--res/effectlib/funcdiffuseReflectionBSDF.glsllib22
-rw-r--r--res/effectlib/funcdiffuseReflectionWrapBSDF.glsllib2
-rw-r--r--res/effectlib/funcspecularBSDF.glsllib14
-rw-r--r--res/effectlib/gradient3Recolor.glsllib31
-rw-r--r--res/effectlib/gradient3Texture.glsllib31
-rw-r--r--res/effectlib/gradientGetPosition.glsllib31
-rw-r--r--res/effectlib/luminance.glsllib30
-rw-r--r--res/effectlib/miNoise.glsllib31
-rw-r--r--res/effectlib/microfacetBSDF.glsllib32
-rw-r--r--res/effectlib/monoChannel.glsllib36
-rw-r--r--res/effectlib/normalizedMix.glsllib31
-rw-r--r--res/effectlib/perlinNoise.glsllib31
-rw-r--r--res/effectlib/perlinNoiseBumpTexture.glsllib31
-rw-r--r--res/effectlib/physGlossyBSDF.glsllib34
-rw-r--r--res/effectlib/random255.glsllib30
-rw-r--r--res/effectlib/refraction.glsllib52
-rw-r--r--res/effectlib/rotationTranslationScale.glsllib46
-rw-r--r--res/effectlib/sampleArea.glsllib31
-rw-r--r--res/effectlib/sampleLight.glsllib48
-rw-r--r--res/effectlib/sampleProbe.glsllib51
-rw-r--r--res/effectlib/screenSpaceAO.glsllib43
-rw-r--r--res/effectlib/screenSpaceDO.glsllib44
-rw-r--r--res/effectlib/shadowMapping.glsllib30
-rw-r--r--res/effectlib/simpleGlossyBSDF.glsllib32
-rw-r--r--res/effectlib/specularBSDF.glsllib30
-rw-r--r--res/effectlib/spotEdf.glsllib30
-rw-r--r--res/effectlib/square.glsllib31
-rw-r--r--res/effectlib/tangentSpaceNormalTexture.glsllib44
-rw-r--r--res/effectlib/tessellationLinear.glsllib31
-rw-r--r--res/effectlib/tessellationLinearCM.glsllib65
-rw-r--r--res/effectlib/tessellationNPatch.glsllib33
-rw-r--r--res/effectlib/tessellationNPatchCM.glsllib69
-rw-r--r--res/effectlib/tessellationPath.glsllib31
-rw-r--r--res/effectlib/tessellationPhong.glsllib33
-rw-r--r--res/effectlib/tessellationPhongCM.glsllib65
-rw-r--r--res/effectlib/textureCoordinateInfo.glsllib32
-rw-r--r--res/effectlib/transformCoordinate.glsllib36
-rw-r--r--res/effectlib/uicDefaultMaterialFileBumpTexture.glsllib10
-rw-r--r--res/effectlib/uicDefaultMaterialFileDisplacementTexture.glsllib10
-rw-r--r--res/effectlib/uicDefaultMaterialFileNormalTexture.glsllib10
-rw-r--r--res/effectlib/vertexFragmentBase.glsllib30
-rw-r--r--res/effectlib/viewProperties.glsllib30
-rw-r--r--res/effectlib/weightedLayer.glsllib31
-rw-r--r--res/effectlib/wireframeCM.glsllib65
80 files changed, 2463 insertions, 254 deletions
diff --git a/res/effectlib/Fxaa3_11.glsllib b/res/effectlib/Fxaa3_11.glsllib
index 55d5ddf..f5de208 100644
--- a/res/effectlib/Fxaa3_11.glsllib
+++ b/res/effectlib/Fxaa3_11.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
/*============================================================================
diff --git a/res/effectlib/Fxaa3_8.glsllib b/res/effectlib/Fxaa3_8.glsllib
index 9692988..7e76ecd 100644
--- a/res/effectlib/Fxaa3_8.glsllib
+++ b/res/effectlib/Fxaa3_8.glsllib
@@ -1,3 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 - 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
/*============================================================================
@@ -1387,3 +1418,6 @@ float4 FxaaPixelShader(
return float4(rgbF, lumaM); }
/*==========================================================================*/
#endif
+
+
+
diff --git a/res/effectlib/SMAA.glsllib b/res/effectlib/SMAA.glsllib
index d4c9031..1d5be44 100644
--- a/res/effectlib/SMAA.glsllib
+++ b/res/effectlib/SMAA.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
/**
* Copyright (C) 2011 Jorge Jimenez (jorge@iryoku.com)
* Copyright (C) 2011 Jose I. Echevarria (joseignacioechevarria@gmail.com)
diff --git a/res/effectlib/SSAOCustomMaterial.glsllib b/res/effectlib/SSAOCustomMaterial.glsllib
index 7c448cd..b39d72b 100644
--- a/res/effectlib/SSAOCustomMaterial.glsllib
+++ b/res/effectlib/SSAOCustomMaterial.glsllib
@@ -1,18 +1,39 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef SSAO_CUSTOM_MATERIAL_GLSLLIB
#define SSAO_CUSTOM_MATERIAL_GLSLLIB
-
-#ifndef UIC_ENABLE_SSAO
-#define UIC_ENABLE_SSAO 0
-#endif
-
-#ifndef UIC_ENABLE_SSDO
-#define UIC_ENABLE_SSDO 0
-#endif
-
-#if UIC_ENABLE_SSAO || UIC_ENABLE_SSDO
+#if QT3DS_ENABLE_SSAO || QT3DS_ENABLE_SSDO
#include "viewProperties.glsllib"
-#if UIC_ENABLE_SSDO
+#if QT3DS_ENABLE_SSDO
#include "screenSpaceDO.glsllib"
layout (std140) uniform cbAoShadow {
@@ -27,13 +48,13 @@ uniform sampler2D depth_sampler;
#endif
uniform sampler2D ao_sampler;
-#endif // UIC_ENABLE_SSAO || UIC_ENABLE_SSDO
+#endif // QT3DS_ENABLE_SSAO || QT3DS_ENABLE_SSDO
-#if UIC_ENABLE_SSAO
+#if QT3DS_ENABLE_SSAO
float customMaterialAO()
{
-#if UIC_ENABLE_SSDO
+#if QT3DS_ENABLE_SSDO
vec2 smpUV = (gl_FragCoord.xy) * aoScreenConst.zw;
#else
ivec2 iSize = textureSize(ao_sampler, 0);
@@ -51,7 +72,7 @@ float customMaterialAO()
#endif
-#if UIC_ENABLE_SSDO
+#if QT3DS_ENABLE_SSDO
float customMaterialShadow( vec3 lightDir, vec3 varWorldPos )
{
diff --git a/res/effectlib/abbeNumberIOR.glsllib b/res/effectlib/abbeNumberIOR.glsllib
index 77a310c..43ed79d 100644
--- a/res/effectlib/abbeNumberIOR.glsllib
+++ b/res/effectlib/abbeNumberIOR.glsllib
@@ -1,5 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
// TODO: compute spectral ior based on float ior and abbe number
vec3 abbeNumberIOR( in float ior, in float abbeNumber )
{
return( vec3( ior, ior, ior ) );
}
+
diff --git a/res/effectlib/anisotropyConversion.glsllib b/res/effectlib/anisotropyConversion.glsllib
index c18f722..b8aae1e 100644
--- a/res/effectlib/anisotropyConversion.glsllib
+++ b/res/effectlib/anisotropyConversion.glsllib
@@ -1,3 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2014-2015 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
// TODO: real implementation
anisotropy_return anisotropyConversion( in float roughness, in float anisotropy, in float anisotropyRotation, in vec3 tangentU, bool miaAnisotropySemantic )
{
@@ -12,3 +43,4 @@ anisotropy_return anisotropyConversion( in float roughness, in float anisotropy,
aniso.roughness_u = clamp( aniso.roughness_v * anisoFac, 0.0001, 1.0);
return( aniso );
}
+
diff --git a/res/effectlib/average.glsllib b/res/effectlib/average.glsllib
index f83c2be..8c3f3fc 100644
--- a/res/effectlib/average.glsllib
+++ b/res/effectlib/average.glsllib
@@ -1,4 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
float average( in vec3 v )
{
return( ( v.x + v.y + v.z ) / 3.0f );
}
+
diff --git a/res/effectlib/blur.glsllib b/res/effectlib/blur.glsllib
index e6cd8ad..1f3abc8 100644
--- a/res/effectlib/blur.glsllib
+++ b/res/effectlib/blur.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef BLUR_GLSLLIB
#define BLUR_GLSLLIB 1
#include "depthpass.glsllib"
@@ -82,12 +112,12 @@ void SetupHorizontalGaussianBlur( float inDestWidth, float inBlurAmount, vec2 in
{
float increment = inBlurAmount/inDestWidth;
TexCoord0 = vec2(inTexCoord.x + increment , inTexCoord.y );
- TexCoord1 = vec2(inTexCoord.x + increment * 2.0 , inTexCoord.y);
- TexCoord2 = vec2(inTexCoord.x + increment * 3.0 , inTexCoord.y);
+ TexCoord1 = vec2(inTexCoord.x + increment * 2.0 , inTexCoord.y);
+ TexCoord2 = vec2(inTexCoord.x + increment * 3.0 , inTexCoord.y);
TexCoord3 = vec2(inTexCoord.x , inTexCoord.y);
TexCoord4 = vec2(inTexCoord.x - increment , inTexCoord.y);
- TexCoord5 = vec2(inTexCoord.x - increment * 2.0 , inTexCoord.y);
- TexCoord6 = vec2(inTexCoord.x - increment * 3.0 , inTexCoord.y);
+ TexCoord5 = vec2(inTexCoord.x - increment * 2.0 , inTexCoord.y);
+ TexCoord6 = vec2(inTexCoord.x - increment * 3.0 , inTexCoord.y);
}
void SetupVerticalGaussianBlur( float inDestHeight, float inBlurAmount, vec2 inTexCoord )
diff --git a/res/effectlib/calculateRoughness.glsllib b/res/effectlib/calculateRoughness.glsllib
index 13ca823..d1e099b 100644
--- a/res/effectlib/calculateRoughness.glsllib
+++ b/res/effectlib/calculateRoughness.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
float calculateRoughness( in vec3 N, in float roughnessU, in float roughnessV, in vec3 tangentU )
{
float roughness = roughnessU;
@@ -30,3 +60,4 @@ float calculateRoughness( in vec3 N, in float roughnessU, in float roughnessV, i
}
return( roughness );
}
+
diff --git a/res/effectlib/coordinateSource.glsllib b/res/effectlib/coordinateSource.glsllib
index cfab74d..bc435d5 100644
--- a/res/effectlib/coordinateSource.glsllib
+++ b/res/effectlib/coordinateSource.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
texture_coordinate_info coordinateSource( in int coordinateSystem, in int textureSpace )
{
texture_coordinate_info tci;
@@ -22,3 +52,4 @@ texture_coordinate_info coordinateSource( in int coordinateSystem, in int textur
}
return( tci );
}
+
diff --git a/res/effectlib/cube.glsllib b/res/effectlib/cube.glsllib
index 28e82a7..74da833 100644
--- a/res/effectlib/cube.glsllib
+++ b/res/effectlib/cube.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
float cube( in float x )
{
return( x * x * x );
@@ -17,3 +47,4 @@ vec4 cube( in vec4 x )
{
return( x * x * x );
}
+
diff --git a/res/effectlib/customCurveLayer.glsllib b/res/effectlib/customCurveLayer.glsllib
index b866aeb..2bc1780 100644
--- a/res/effectlib/customCurveLayer.glsllib
+++ b/res/effectlib/customCurveLayer.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
vec4 customCurveLayer( in vec3 L, in float normal_reflectivity, in float grazing_reflectivity, in float exponent, float weight, in vec3 layercolor, vec4 layer, vec4 base, in float alpha )
{
vec3 H = normalize( viewDir + L );
@@ -9,3 +39,4 @@ vec4 customCurveLayer( in vec3 L, in float normal_reflectivity, in float grazing
return( vec4( mix( base.rgb, layercolor * layer.rgb, curveFactor ), mix(alpha, 1.0, curveFactor) ) );
}
+
diff --git a/res/effectlib/customMaterial.glsllib b/res/effectlib/customMaterial.glsllib
index 3ecbe86..e99fa6e 100644
--- a/res/effectlib/customMaterial.glsllib
+++ b/res/effectlib/customMaterial.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef CUSTOM_MATERIAL_GLSLLIB
#define CUSTOM_MATERIAL_GLSLLIB 1
diff --git a/res/effectlib/customMaterialFragBody.glsllib b/res/effectlib/customMaterialFragBody.glsllib
index e5a40a8..d237bc0 100644
--- a/res/effectlib/customMaterialFragBody.glsllib
+++ b/res/effectlib/customMaterialFragBody.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef CUSTOM_MATERIAL_FRAG_BODY_GLSLLIB
#define CUSTOM_MATERIAL_FRAG_BODY_GLSLLIB
diff --git a/res/effectlib/customMaterialFragBodyAO.glsllib b/res/effectlib/customMaterialFragBodyAO.glsllib
index 69804e8..1930219 100644
--- a/res/effectlib/customMaterialFragBodyAO.glsllib
+++ b/res/effectlib/customMaterialFragBodyAO.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef CUSTOM_MATERIAL_FRAG_BODY_AO_GLSLLIB
#define CUSTOM_MATERIAL_FRAG_BODY_AO_GLSLLIB
diff --git a/res/effectlib/defaultMaterialFileBumpTexture.glsllib b/res/effectlib/defaultMaterialFileBumpTexture.glsllib
new file mode 100644
index 0000000..ebe985f
--- /dev/null
+++ b/res/effectlib/defaultMaterialFileBumpTexture.glsllib
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3DS_DEFAULT_MATERIAL_FILE_BUMP_TEXTURE_GLSLLIB
+#define QT3DS_DEFAULT_MATERIAL_FILE_BUMP_TEXTURE_GLSLLIB
+
+#ifndef QT3DS_DEFINE_API
+#define QT3DS_DEFINE_API
+#endif
+
+#include "fileBumpTexture.glsllib"
+
+#endif
diff --git a/res/effectlib/defaultMaterialFileDisplacementTexture.glsllib b/res/effectlib/defaultMaterialFileDisplacementTexture.glsllib
new file mode 100644
index 0000000..8720b58
--- /dev/null
+++ b/res/effectlib/defaultMaterialFileDisplacementTexture.glsllib
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3DS_DEFAULT_MATERIAL_FILE_DISPLACEMENT_TEXTURE_GLSLLIB
+#define QT3DS_DEFAULT_MATERIAL_FILE_DISPLACEMENT_TEXTURE_GLSLLIB
+
+#ifndef QT3DS_DEFINE_API
+#define QT3DS_DEFINE_API
+#endif
+
+#include "fileDisplacementTexture.glsllib"
+
+#endif
diff --git a/res/effectlib/defaultMaterialFileNormalTexture.glsllib b/res/effectlib/defaultMaterialFileNormalTexture.glsllib
new file mode 100644
index 0000000..599b2ca
--- /dev/null
+++ b/res/effectlib/defaultMaterialFileNormalTexture.glsllib
@@ -0,0 +1,40 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT3DS_DEFAULT_MATERIAL_FILE_NORMAL_TEXTURE_GLSLLIB
+#define QT3DS_DEFAULT_MATERIAL_FILE_NORMAL_TEXTURE_GLSLLIB
+
+#ifndef QT3DS_DEFINE_API
+#define QT3DS_DEFINE_API
+#endif
+
+#include "tangentSpaceNormalTexture.glsllib"
+
+#endif
diff --git a/res/effectlib/defaultMaterialFresnel.glsllib b/res/effectlib/defaultMaterialFresnel.glsllib
index 0d474bc..303a55b 100644
--- a/res/effectlib/defaultMaterialFresnel.glsllib
+++ b/res/effectlib/defaultMaterialFresnel.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef DEFAULT_MATERIAL_FRESNEL_GLSLLIB
#define DEFAULT_MATERIAL_FRESNEL_GLSLLIB
diff --git a/res/effectlib/defaultMaterialFresnelNoDvn.glsllib b/res/effectlib/defaultMaterialFresnelNoDvn.glsllib
new file mode 100644
index 0000000..90958a3
--- /dev/null
+++ b/res/effectlib/defaultMaterialFresnelNoDvn.glsllib
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DEFAULT_MATERIAL_FRESNEL_NO_DVN_GLSLLIB
+#define DEFAULT_MATERIAL_FRESNEL_NO_DVN_GLSLLIB
+
+float defaultMaterialSimpleFresnel( in vec3 N, in vec3 viewDir, in float ior, float fresnelPower )
+{
+ float F = ((1.0-ior) * (1.0-ior)) / ((1.0+ior) * (1.0+ior));
+ float VdotN = dot(viewDir, N);
+ VdotN = clamp( VdotN, 0.0, 1.0 );
+ float ratio = F + (1.0 - F) * pow(1.0 - VdotN, fresnelPower);
+ return clamp( ratio * pow( VdotN, fresnelPower ), 0.0, 1.0 );
+}
+
+#endif
diff --git a/res/effectlib/defaultMaterialPhysGlossyBSDF.glsllib b/res/effectlib/defaultMaterialPhysGlossyBSDF.glsllib
index 2cff1a6..608e123 100644
--- a/res/effectlib/defaultMaterialPhysGlossyBSDF.glsllib
+++ b/res/effectlib/defaultMaterialPhysGlossyBSDF.glsllib
@@ -1,7 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef DEFAULT_MATERIAL_PHYS_GLOSSY_BSDF_GLSLLIB
#define DEFAULT_MATERIAL_PHYS_GLOSSY_BSDF_GLSLLIB
-#ifndef UIC_DEFINE_API
-#define UIC_DEFINE_API
+#ifndef QT3DS_DEFINE_API
+#define QT3DS_DEFINE_API
#endif
#include "luminance.glsllib"
diff --git a/res/effectlib/depthpass.glsllib b/res/effectlib/depthpass.glsllib
index 916a33c..cbd45c2 100644
--- a/res/effectlib/depthpass.glsllib
+++ b/res/effectlib/depthpass.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef DEPTHPASS_GLSLIB
#define DEPTHPASS_GLSLIB 1
@@ -7,18 +37,18 @@ float calculateVertexDepth( vec2 camera_properties, vec4 position )
return 1.0 - ((position.w - camera_properties.x) / (camera_range));
}
+#if __VERSION__ <= 120
+float modf(in float val, out float integer)
+{
+ integer = floor(val);
+ return val - integer;
+}
+#endif
+
vec4 outputDepth( float vert_depth )
{
float integer_portion = 0.0;
-
- float temp = vert_depth * 255.0;
-#if GLSL_100
- //modf not supported on gles2 systems.
- integer_portion = floor( vert_depth );
- float fraction = vert_depth - integer_portion;
-#else
float fraction = modf((vert_depth * 255.0), integer_portion);
-#endif
return vec4( integer_portion / 255.0, fraction, 0, 1.0 );
}
diff --git a/res/effectlib/dfTint.glsllib b/res/effectlib/dfTint.glsllib
index cf2ddf1..f1f4b7a 100644
--- a/res/effectlib/dfTint.glsllib
+++ b/res/effectlib/dfTint.glsllib
@@ -1,4 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
vec4 dfTint( in vec3 tint, in vec4 base )
{
return( vec4( tint * base.rgb, base.a ) );
}
+
diff --git a/res/effectlib/diffuseReflectionBSDF.glsllib b/res/effectlib/diffuseReflectionBSDF.glsllib
index 6a8882b..9a66aef 100644
--- a/res/effectlib/diffuseReflectionBSDF.glsllib
+++ b/res/effectlib/diffuseReflectionBSDF.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "funcdiffuseReflectionBSDF.glsllib"
#include "funcdiffuseReflectionWrapBSDF.glsllib"
@@ -9,6 +39,7 @@ vec4 lambertReflectionBSDF( in vec3 N, in vec3 L, in vec3 lightDiffuse )
return vec4( cosThetaI * lightDiffuse, 1.0f );
}
+
vec4 diffuseReflectionBSDFEnvironment( in vec3 N, in float roughness )
{
return( vec4( 0.0f, 0.0f, 0.0f, 1.0f ) );
diff --git a/res/effectlib/diffuseTransmissionBSDF.glsllib b/res/effectlib/diffuseTransmissionBSDF.glsllib
index 27b58fc..09d9a7e 100644
--- a/res/effectlib/diffuseTransmissionBSDF.glsllib
+++ b/res/effectlib/diffuseTransmissionBSDF.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
vec4 diffuseTransmissionBSDF( in vec3 N, in vec3 L, in vec3 viewDir, in vec3 lightDiffuse, in vec4 transmissiveColor, in float translucentFalloff, float lightWrap )
{
float cosThetaI = max( 0.0f, (dot( N, L ) + lightWrap) / (1.0 + lightWrap) );
diff --git a/res/effectlib/directionalFactor.glsllib b/res/effectlib/directionalFactor.glsllib
index 4413e1a..78af883 100644
--- a/res/effectlib/directionalFactor.glsllib
+++ b/res/effectlib/directionalFactor.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
vec4 directionalFactor( in vec3 normal, in vec3 viewDir, in vec3 normal_col, in vec3 grazing_col, in float exponent, in vec4 base )
{
float f;
diff --git a/res/effectlib/effect.glsllib b/res/effectlib/effect.glsllib
index a05e9d9..802a846 100644
--- a/res/effectlib/effect.glsllib
+++ b/res/effectlib/effect.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef EFFECT_GLSLLIB
#define EFFECT_GLSLLIB 1
@@ -37,17 +67,6 @@ vec4 GetTextureValuePreMult( sampler2D sampler, vec2 inUVCoords )
//texFormat = one of: rgb, rgba, lum, lum_alpha
//texFilter = one of: nearest, linear
//texWrap = one of: repeat, clamp
-#define SNAPPER_SAMPLER2D(propName, propNiceName, texFilter, texWrap, showUI )\
-uniform sampler2D propName; \
-uniform int flag##propName; \
-uniform vec4 propName##Info; \
-vec4 texture2D_##propName(vec2 uv) \
-{ \
- return GetTextureValue( propName, uv, propName##Info.z ); \
-}
-
-#define SNAPPER_SAMPLER2DWITHDEFAULT(propName, propNiceName, texFilter, texWrap, defaultPath, showUI ) SNAPPER_SAMPLER2D( propName, propNiceName, texFilter, texWrap, showUI );
-#define SNAPPER_SAMPLERCUBE(propName, propNiceName, texFilter, texWrap ) uniform samplerCube propName; uniform vec2 propName##UVRange; uniform int flag##propName; uniform vec2 propName##Size;
#define SNAPPER_EXTERNAL_PARAMETER(propName, datatype, rangeMin, rangeMax, propNiceName, defaultValue)
#define SNAPPER_EXTERNAL_ANGLE(propName, propNiceName, defaultValueAsFloat)
diff --git a/res/effectlib/evalBakedShadowMap.glsllib b/res/effectlib/evalBakedShadowMap.glsllib
index 6f1950e..a283d8a 100644
--- a/res/effectlib/evalBakedShadowMap.glsllib
+++ b/res/effectlib/evalBakedShadowMap.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
vec4 evalBakedShadowMap( in vec3 inCoords )
{
vec4 shadowCol = (uShadowMappingEnabled) ? texture( uBakedShadowTexture, inCoords.xy ) : vec4( 1.0, 1.0, 1.0, 1.0 );
diff --git a/res/effectlib/evalEnvironmentMap.glsllib b/res/effectlib/evalEnvironmentMap.glsllib
index 71778ae..18431c7 100644
--- a/res/effectlib/evalEnvironmentMap.glsllib
+++ b/res/effectlib/evalEnvironmentMap.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
vec3 evalEnvironmentMap( in vec3 R, float roughness )
{
// convert R to spherical texture coordinates
diff --git a/res/effectlib/evalLightmaps.glsllib b/res/effectlib/evalLightmaps.glsllib
index 08801e6..b27bdeb 100644
--- a/res/effectlib/evalLightmaps.glsllib
+++ b/res/effectlib/evalLightmaps.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
vec4 evalLightmap( in sampler2D sampler, in vec3 inCoords, in vec4 rotScale, in vec3 offset )
{
vec3 uTransform = vec3(rotScale.x, rotScale.y, offset.x);
diff --git a/res/effectlib/fileBumpTexture.glsllib b/res/effectlib/fileBumpTexture.glsllib
index a0d73d8..0f27fd8 100644
--- a/res/effectlib/fileBumpTexture.glsllib
+++ b/res/effectlib/fileBumpTexture.glsllib
@@ -1,7 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef FILE_BUMP_TEXTURE_GLSLLIB
#define FILE_BUMP_TEXTURE_GLSLLIB
-#ifdef UIC_DEFINE_API
+#ifdef QT3DS_DEFINE_API
#include "luminance.glsllib"
#include "monoChannel.glsllib"
diff --git a/res/effectlib/fileDisplacementTexture.glsllib b/res/effectlib/fileDisplacementTexture.glsllib
index f574565..c2f559d 100644
--- a/res/effectlib/fileDisplacementTexture.glsllib
+++ b/res/effectlib/fileDisplacementTexture.glsllib
@@ -1,7 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef FILE_DISPLACEMENT_TEXTURE_GLSLLIB
#define FILE_DISPLACEMENT_TEXTURE_GLSLLIB
-#ifdef UIC_DEFINE_API
+#ifdef QT3DS_DEFINE_API
#include "luminance.glsllib"
#include "monoChannel.glsllib"
@@ -30,7 +60,7 @@ vec3 fileDisplacementTexture( in sampler2D sampler, in float factor, in int disp
//default material path version
-vec3 uicDefaultMaterialFileDisplacementTexture( in sampler2D sampler, in float factor, vec2 texCoord, in vec3 normal, vec3 pos )
+vec3 defaultMaterialFileDisplacementTexture( in sampler2D sampler, in float factor, vec2 texCoord, in vec3 normal, vec3 pos )
{
return fileDisplacementTexture( sampler, factor, mono_luminance
, textureCoordinateInfo( vec3( texCoord.x, texCoord.y, 0.0 ), vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0) )
diff --git a/res/effectlib/fileTexture.glsllib b/res/effectlib/fileTexture.glsllib
index 76a71ee..6b9f6ab 100644
--- a/res/effectlib/fileTexture.glsllib
+++ b/res/effectlib/fileTexture.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
texture_return fileTexture( in sampler2D sampler, in vec3 colorOffset, in vec3 colorScale, in int monoSource, in texture_coordinate_info uvw
, in vec2 cropU, in vec2 cropV, in int wrapU, in int wrapV, in int gammaMode )
{
@@ -15,3 +45,4 @@ texture_return fileTexture( in sampler2D sampler, in vec3 colorOffset, in vec3 c
tr.mono = monoChannel( vec4( t3, t4.w ), monoSource );
return( tr );
}
+
diff --git a/res/effectlib/flakeNoiseBumpTexture.glsllib b/res/effectlib/flakeNoiseBumpTexture.glsllib
index 2673edf..6bd5f7e 100644
--- a/res/effectlib/flakeNoiseBumpTexture.glsllib
+++ b/res/effectlib/flakeNoiseBumpTexture.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
vec3 flakeNoiseBumpTexture( in texture_coordinate_info uvw, in float scale, in float strength, in vec3 normal )
{
vec3 tex = uvw.position / scale;
@@ -13,3 +43,4 @@ vec3 flakeNoiseBumpTexture( in texture_coordinate_info uvw, in float scale, in f
n = n.x*uvw.tangent_u + n.y*uvw.tangent_v + n.z*normal;
return normalize(normal + n);
}
+
diff --git a/res/effectlib/flakeNoiseTexture.glsllib b/res/effectlib/flakeNoiseTexture.glsllib
index 95efdd6..7a73968 100644
--- a/res/effectlib/flakeNoiseTexture.glsllib
+++ b/res/effectlib/flakeNoiseTexture.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
texture_return flakeNoiseTexture( in texture_coordinate_info uvw, in float intensity, in float scale, in float density )
{
vec3 tex = uvw.position / scale;
diff --git a/res/effectlib/fresnelLayer.glsllib b/res/effectlib/fresnelLayer.glsllib
index 69a4786..a9b4087 100644
--- a/res/effectlib/fresnelLayer.glsllib
+++ b/res/effectlib/fresnelLayer.glsllib
@@ -1,3 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
float simpleFresnel( in vec3 N, in float ior, float fresnelPower )
{
float F = ((1.0-ior) * (1.0-ior)) / ((1.0+ior) * (1.0+ior));
@@ -75,3 +106,4 @@ vec4 fresnelLayer( in vec3 N, in vec3 ior, in float weight, in vec3 layercolor,
return( vec4( mix( base.rgb, layer.rgb, fresColor ), mix(alpha, 1.0, luminance(fresColor)) ) );
}
+
diff --git a/res/effectlib/funcdiffuseReflectionBSDF.glsllib b/res/effectlib/funcdiffuseReflectionBSDF.glsllib
index 250056a..bda0ea6 100644
--- a/res/effectlib/funcdiffuseReflectionBSDF.glsllib
+++ b/res/effectlib/funcdiffuseReflectionBSDF.glsllib
@@ -1,31 +1,31 @@
#ifndef PI
-#define PI 3.14159265358979f
+#define PI 3.14159265358979
#define PI_SQUARE ( PI * PI )
#endif
vec4 diffuseReflectionBSDF(in vec3 N, in vec3 L, in vec3 viewDir,
in vec3 lightDiffuse, in float roughness)
{
- float cosThetaI = max( 0.0f, dot( N, L ) );
+ float cosThetaI = max( 0.0, dot( N, L ) );
float factor = cosThetaI;
- if ( ( 0.0f < factor ) && ( 0.0f < roughness ) )
+ if ( ( 0.0 < factor ) && ( 0.0 < roughness ) )
{
// see http://en.wikipedia.org/wiki/Oren%E2%80%93Nayar_reflectance_model
- float sigmaSquare = 0.25f * PI_SQUARE * roughness * roughness;
- float A = 1.0f - 0.5f * sigmaSquare / ( sigmaSquare + 0.33f );
- float B = 0.45f * sigmaSquare / ( sigmaSquare + 0.09f );
+ float sigmaSquare = 0.25 * PI_SQUARE * roughness * roughness;
+ float A = 1.0 - 0.5 * sigmaSquare / ( sigmaSquare + 0.33 );
+ float B = 0.45 * sigmaSquare / ( sigmaSquare + 0.09 );
// project L and viewDir on surface to get the azimuthal angle between them
// as we don't really need the projections, but the angle between them,
// it's enough to just use the cross instead
vec3 pl = normalize( cross( L, N ) );
vec3 pv = normalize( cross( viewDir, N ) );
- float cosPhi = max( 0.0f, dot( pl, pv ) );
+ float cosPhi = max( 0.0, dot( pl, pv ) );
float sinAlpha, tanBeta;
- float cosThetaO = max( 0.0f, dot( N, viewDir ) );
- float sinThetaI = sqrt( max( 0.0f, 1.0f - cosThetaI * cosThetaI ) );
- float sinThetaO = sqrt( max( 0.0f, 1.0f - cosThetaO * cosThetaO ) );
+ float cosThetaO = max( 0.0, dot( N, viewDir ) );
+ float sinThetaI = sqrt( max( 0.0, 1.0 - cosThetaI * cosThetaI ) );
+ float sinThetaO = sqrt( max( 0.0, 1.0 - cosThetaO * cosThetaO ) );
if ( cosThetaI < cosThetaO )
{ // -> thetaO < thetaI
sinAlpha = sinThetaI;
@@ -39,5 +39,5 @@ vec4 diffuseReflectionBSDF(in vec3 N, in vec3 L, in vec3 viewDir,
factor *= A + B * cosPhi * sinAlpha * tanBeta;
}
- return( vec4( factor * lightDiffuse, 1.0f ) );
+ return( vec4( factor * lightDiffuse, 1.0 ) );
}
diff --git a/res/effectlib/funcdiffuseReflectionWrapBSDF.glsllib b/res/effectlib/funcdiffuseReflectionWrapBSDF.glsllib
index 3b8f2d9..9afc58b 100644
--- a/res/effectlib/funcdiffuseReflectionWrapBSDF.glsllib
+++ b/res/effectlib/funcdiffuseReflectionWrapBSDF.glsllib
@@ -1,5 +1,5 @@
vec4 diffuseReflectionWrapBSDF(vec3 normalDir, in vec3 L, in vec3 lightDiffuse, float wrap)
{
float I = max( 0.0, ((dot(L, normalDir) + wrap)/ (1.0 + wrap)) ); //diffuseIntensity
- return vec4( I * lightDiffuse, 1.0f );
+ return vec4( I * lightDiffuse, 1.0 );
}
diff --git a/res/effectlib/funcspecularBSDF.glsllib b/res/effectlib/funcspecularBSDF.glsllib
index 44e8196..e9450bf 100644
--- a/res/effectlib/funcspecularBSDF.glsllib
+++ b/res/effectlib/funcspecularBSDF.glsllib
@@ -9,14 +9,14 @@
vec4 specularBSDF(in vec3 N, in vec3 L, in vec3 viewDir, in vec3 lightSpecular,
in float ior, in float shininess, in vec3 tint, int mode)
{
- vec4 rgba = vec4( 0.0f, 0.0f, 0.0f, 1.0f );
+ vec4 rgba = vec4( 0.0, 0.0, 0.0, 1.0 );
float cosTheta = dot( N, L );
- if ( 0.0f < cosTheta )
+ if ( 0.0 < cosTheta )
{
if ( ( mode == scatter_reflect ) || ( mode == scatter_reflect_transmit ) )
{
vec3 R = reflect( -L, N );
- float cosAlpha = max( 0.0f, dot( R, viewDir ) );
+ float cosAlpha = max( 0.0, dot( R, viewDir ) );
float shine = pow( cosAlpha, shininess );
rgba.rgb = shine * lightSpecular;
}
@@ -25,17 +25,17 @@ vec4 specularBSDF(in vec3 N, in vec3 L, in vec3 viewDir, in vec3 lightSpecular,
{
// check against total reflection
vec3 R = refract( -viewDir, N, ior );
- if ( R == vec3( 0.0f, 0.0f, 0.0f ) )
+ if ( R == vec3( 0.0, 0.0, 0.0 ) )
{
- rgba.a = 1.0f;
+ rgba.a = 1.0;
}
else if ( mode == scatter_transmit )
{
- rgba.a = 0.0f;
+ rgba.a = 0.0;
}
else
{
- rgba.a = 1.0f - luminance( tint );
+ rgba.a = 1.0 - luminance( tint );
}
}
return( rgba );
diff --git a/res/effectlib/gradient3Recolor.glsllib b/res/effectlib/gradient3Recolor.glsllib
index f69c262..18556f3 100644
--- a/res/effectlib/gradient3Recolor.glsllib
+++ b/res/effectlib/gradient3Recolor.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
float gradientInterpolate( in int interpolationMode, in float value )
{
switch( interpolationMode )
@@ -40,3 +70,4 @@ texture_return gradient3Recolor( in float gradientPositions[3], in vec3 gradient
tr.mono = 0.0f;
return( tr );
}
+
diff --git a/res/effectlib/gradient3Texture.glsllib b/res/effectlib/gradient3Texture.glsllib
index b4b894e..7bd6cec 100644
--- a/res/effectlib/gradient3Texture.glsllib
+++ b/res/effectlib/gradient3Texture.glsllib
@@ -1,5 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
texture_return gradient3Texture( in int gradientMode, in float gradientPositions[3], in vec3 gradientColors[3], in int interpolationModes[3], in texture_coordinate_info uvw, in float distortion )
{
float position = gradientGetPosition( gradientMode, uvw.position.xy );
return( gradient3Recolor( gradientPositions, gradientColors, interpolationModes, 0, distortion, position ) );
}
+
diff --git a/res/effectlib/gradientGetPosition.glsllib b/res/effectlib/gradientGetPosition.glsllib
index 569b4d7..26b687d 100644
--- a/res/effectlib/gradientGetPosition.glsllib
+++ b/res/effectlib/gradientGetPosition.glsllib
@@ -1,3 +1,34 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
// calculate the length of the hypotenuse of a right-angle triangle
float hypot( in float x, in float y )
{
diff --git a/res/effectlib/luminance.glsllib b/res/effectlib/luminance.glsllib
index bb7c08f..9a37878 100644
--- a/res/effectlib/luminance.glsllib
+++ b/res/effectlib/luminance.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef LUMINANCE_GLSLLIB
#define LUMINANCE_GLSLLIB
diff --git a/res/effectlib/miNoise.glsllib b/res/effectlib/miNoise.glsllib
index 4827152..f2daa81 100644
--- a/res/effectlib/miNoise.glsllib
+++ b/res/effectlib/miNoise.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
vec4 miNoise( in vec3 xyz )
{
const float div = 1.0f / 256.0f;
@@ -80,3 +110,4 @@ vec4 miNoise( in vec3 xyz )
}
return( ret );
}
+
diff --git a/res/effectlib/microfacetBSDF.glsllib b/res/effectlib/microfacetBSDF.glsllib
index 4453162..e164fca 100644
--- a/res/effectlib/microfacetBSDF.glsllib
+++ b/res/effectlib/microfacetBSDF.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef MICROFACET_BSDF_GLSLLIB
#define MICROFACET_BSDF_GLSLLIB 1
@@ -94,7 +124,7 @@ vec4 microfacetBSDF( in mat3 tanFrame, in vec3 L, in vec3 V, in vec3 lightSpecul
vec4 microfacetBSDFEnvironment( in mat3 tanFrame, in vec3 viewDir, in float roughnessU, in float roughnessV, int mode )
{
vec3 rgb = vec3( 0.0f, 0.0f, 0.0f );
-#if !UIC_ENABLE_LIGHT_PROBE
+#if !QT3DS_ENABLE_LIGHT_PROBE
if ( uEnvironmentMappingEnabled )
{
float roughness = calculateRoughness( tanFrame[2], roughnessU, roughnessV, tanFrame[0] );
diff --git a/res/effectlib/monoChannel.glsllib b/res/effectlib/monoChannel.glsllib
index 07d6452..5c03a97 100644
--- a/res/effectlib/monoChannel.glsllib
+++ b/res/effectlib/monoChannel.glsllib
@@ -1,7 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef MONO_CHANNEL_GLSLLIB
#define MONO_CHANNEL_GLSLLIB
-#ifdef UIC_DEFINE_API
+#ifdef QT3DS_DEFINE_API
#define mono_alpha 0
#define mono_average 1
#define mono_luminance 2
@@ -15,13 +45,13 @@ float monoChannel( in vec4 t, in int monoSource )
case mono_alpha :
return( t.w );
case mono_average :
- return( ( t.x + t.y + t.z ) / 3.0f );
+ return( ( t.x + t.y + t.z ) / 3.0 );
case mono_luminance :
return( luminance( t.xyz ) );
case mono_maximum :
return( max( t.x, max( t.y, t.z ) ) );
default :
- return( 1.0f );
+ return( 1.0 );
}
}
diff --git a/res/effectlib/normalizedMix.glsllib b/res/effectlib/normalizedMix.glsllib
index 7dc8edb..7a44022 100644
--- a/res/effectlib/normalizedMix.glsllib
+++ b/res/effectlib/normalizedMix.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
vec4 normalizedMix( in bsdf_component components[1] )
{
return( components[0].component );
@@ -9,3 +39,4 @@ vec4 normalizedMix( in bsdf_component components[2] )
float invSum = ( sum <= 1.0f ) ? 1.0f : 1.0f / sum;
return( invSum * ( components[0].weight * components[0].component + components[1].weight * components[1].component ) );
}
+
diff --git a/res/effectlib/perlinNoise.glsllib b/res/effectlib/perlinNoise.glsllib
index 412e79b..1fef880 100644
--- a/res/effectlib/perlinNoise.glsllib
+++ b/res/effectlib/perlinNoise.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
// check out implementation from GPU Gems 1 and 2
float fade( in float x )
@@ -201,3 +231,4 @@ float perlinNoise( in vec3 pos, in float time, in int terms, in vec3 turbulenceW
}
return( noise );
}
+
diff --git a/res/effectlib/perlinNoiseBumpTexture.glsllib b/res/effectlib/perlinNoiseBumpTexture.glsllib
index 66204c7..6e0982f 100644
--- a/res/effectlib/perlinNoiseBumpTexture.glsllib
+++ b/res/effectlib/perlinNoiseBumpTexture.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
vec3 perlinNoiseBumpTexture( in texture_coordinate_info uvw, in float factor, in float size, in bool applyMarble
, in bool applyDent, in float noisePhase, in int noiseLevels, in bool absoluteNoise, in vec3 noiseDistortion
, in float noiseThresholdHigh, in float noiseThresholdLow, in float noiseBands, in vec3 normal )
@@ -16,3 +46,4 @@ vec3 perlinNoiseBumpTexture( in texture_coordinate_info uvw, in float factor, in
return( normalize( normal - factor * ( ( r1 - r0 ) * uvw.tangent_u + ( r2 - r0 ) * uvw.tangent_v + ( r3 - r0 ) * normal ) ) );
}
+
diff --git a/res/effectlib/physGlossyBSDF.glsllib b/res/effectlib/physGlossyBSDF.glsllib
index eabd6c5..ff0eb8c 100644
--- a/res/effectlib/physGlossyBSDF.glsllib
+++ b/res/effectlib/physGlossyBSDF.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef PHYS_GLOSSY_BSDF_GLSLLIB
#define PHYS_GLOSSY_BSDF_GLSLLIB 1
@@ -23,7 +53,7 @@ float Gterm( float cosTheta, float roughness )
vec4 kggxGlossyBSDF( in mat3 tanFrame, in vec3 L, in vec3 V, in vec3 lightSpecular, float ior,
in float roughnessU, in float roughnessV, int mode )
{
- vec4 rgba = vec4( 0.0f, 0.0f, 0.0f, 1.0f );
+ vec4 rgba = vec4( 0.0, 0.0, 0.0, 1.0 );
vec3 H = normalize(L + V);
// NOTE : This BSDF allows roughness up to 2.0 which allows it
@@ -83,7 +113,7 @@ vec4 kggxGlossyDefaultMtl( in vec3 normal, in vec3 tangent, in vec3 L, in vec3 V
vec4 wardGlossyBSDF( in mat3 tanFrame, in vec3 L, in vec3 V, in vec3 lightSpecular, in float ior,
in float roughnessU, in float roughnessV, int mode )
{
- vec4 rgba = vec4( 0.0f, 0.0f, 0.0f, 1.0f );
+ vec4 rgba = vec4( 0.0, 0.0, 0.0, 1.0 );
vec3 H = normalize(L + V);
// specular
diff --git a/res/effectlib/random255.glsllib b/res/effectlib/random255.glsllib
index f5f1c9e..ef586a7 100644
--- a/res/effectlib/random255.glsllib
+++ b/res/effectlib/random255.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
// random [0..255] calculated by some simple Linear Congruential Generator (LCG)
// Verfied, that each function is just a permutation of {0,...,255}, that is, with 0<=x<=255, each value in [0,255] is returned once
int random255X( in int x )
diff --git a/res/effectlib/refraction.glsllib b/res/effectlib/refraction.glsllib
index c83ce42..f961c50 100644
--- a/res/effectlib/refraction.glsllib
+++ b/res/effectlib/refraction.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
// this is entirly phiysical incorrect
// We just use this to fake distortion when we have no environment available
// The displacement is calculated on ior
@@ -12,11 +42,11 @@ vec3 refraction( in sampler2D sampler, in float materialIOR )
vec2 newUV = vec2(gl_FragCoord.xy/texSize);
if ( xdir > ydir)
{
- newUV = ( viewDir.x > 0.0) ? newUV + displace.xy : newUV - displace.xy;
+ newUV = ( viewDir.x > 0.0) ? newUV + displace.xy : newUV - displace.xy;
}
else
{
- newUV = ( viewDir.y > 0.0) ? newUV - displace.xy : newUV + displace.xy;
+ newUV = ( viewDir.y > 0.0) ? newUV - displace.xy : newUV + displace.xy;
}
vec3 refractColor = texture( sampler, newUV ).rgb;
@@ -42,15 +72,15 @@ vec3 refractBlur( in sampler2D sampler, in vec3 viewDir, in float materialIOR, i
for (int y = -sz; y <= sz; ++y)
{
- for (int x = -sz; x <= sz; ++x)
- {
- float wt = float(x*x + y*y) / (blurWidth * 0.5);
- wt = exp2(-wt);
- //refractColor += wt * textureOffset( sampler, newUV, ivec2(x, y) ).rgb;
- vec2 uvOfs = vec2(x, y) * texSize;
- refractColor += wt * texture( sampler, newUV+uvOfs).rgb;
- wtsum += wt;
- }
+ for (int x = -sz; x <= sz; ++x)
+ {
+ float wt = float(x*x + y*y) / (blurWidth * 0.5);
+ wt = exp2(-wt);
+ //refractColor += wt * textureOffset( sampler, newUV, ivec2(x, y) ).rgb;
+ vec2 uvOfs = vec2(x, y) * texSize;
+ refractColor += wt * texture( sampler, newUV+uvOfs).rgb;
+ wtsum += wt;
+ }
}
return refractColor / wtsum;
diff --git a/res/effectlib/rotationTranslationScale.glsllib b/res/effectlib/rotationTranslationScale.glsllib
index defbb1c..78bb8dd 100644
--- a/res/effectlib/rotationTranslationScale.glsllib
+++ b/res/effectlib/rotationTranslationScale.glsllib
@@ -1,18 +1,48 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef ROTATION_TRANSLATION_SCALE_GLSLLIB
#define ROTATION_TRANSLATION_SCALE_GLSLLIB
mat4 rotationTranslationScale( in vec3 rotation, in vec3 translation, in vec3 scaling )
{
- mat4 st = mat4( scaling.x, 0.0f, 0.0f, 0.0f
- , 0.0f, scaling.y, 0.0f, 0.0f
- , 0.0f, 0.0f, scaling.z, 0.0f
- , translation.x - 0.5f, translation.y - 0.5f, translation.z - 0.5f, 1.0f );
+ mat4 st = mat4( scaling.x, 0.0, 0.0, 0.0
+ , 0.0, scaling.y, 0.0, 0.0
+ , 0.0, 0.0, scaling.z, 0.0
+ , translation.x - 0.5, translation.y - 0.5, translation.z - 0.5, 1.0 );
vec3 s = sin( rotation );
vec3 c = cos( rotation );
- mat4 r = mat4( c.y * c.z, -c.x * s.z + s.x * s.y * c.z, s.x * s.z + c.x * s.y * c.z, 0.0f
- , c.y * s.z, c.x * c.z + s.x * s.y * s.z, -s.x * c.z + c.x * s.y * s.z, 0.0f
- , -s.y , s.x * c.y , c.x * c.y , 0.0f
- , 0.5f , 0.5f , 0.5f , 1.0f );
+ mat4 r = mat4( c.y * c.z, -c.x * s.z + s.x * s.y * c.z, s.x * s.z + c.x * s.y * c.z, 0.0
+ , c.y * s.z, c.x * c.z + s.x * s.y * s.z, -s.x * c.z + c.x * s.y * s.z, 0.0
+ , -s.y , s.x * c.y , c.x * c.y , 0.0
+ , 0.5 , 0.5 , 0.5 , 1.0 );
return( st * r );
}
diff --git a/res/effectlib/sampleArea.glsllib b/res/effectlib/sampleArea.glsllib
index 7b1d142..70c7ae0 100644
--- a/res/effectlib/sampleArea.glsllib
+++ b/res/effectlib/sampleArea.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef SAMPLE_AREA_GLSLLIB
#define SAMPLE_AREA_GLSLLIB 1
@@ -75,6 +105,7 @@ float getUVHitBounds( in vec3 pos, in mat3 lightFrame, in vec3 lightPos, in floa
return wtsum;
}
+
// Shooting a narrow beam, and then scaling up that beam based on the actual roughness
vec4 sampleAreaGlossy( in mat3 tanFrame, in vec3 pos, in int lightIdx, in vec3 viewDir, in float roughU, in float roughV )
{
diff --git a/res/effectlib/sampleLight.glsllib b/res/effectlib/sampleLight.glsllib
index 74bd733..3218cdf 100644
--- a/res/effectlib/sampleLight.glsllib
+++ b/res/effectlib/sampleLight.glsllib
@@ -1,20 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef SAMPLE_LIGHT_GLSLLIB
#define SAMPLE_LIGHT_GLSLLIB
#define MAX_NUM_SHADOWS 8
-#ifndef UIC_ENABLE_SSM
-#define UIC_ENABLE_SSM 0
+#ifndef QT3DS_ENABLE_SSM
+#define QT3DS_ENABLE_SSM 0
#endif
#include "SSAOCustomMaterial.glsllib"
-#if UIC_ENABLE_SSM
+#if QT3DS_ENABLE_SSM
#include "shadowMapping.glsllib"
#endif
#include "funcsampleLightVars.glsllib"
-#if UIC_ENABLE_SSM
+#if QT3DS_ENABLE_SSM
uniform sampler2D shadowMaps[MAX_NUM_SHADOWS];
uniform samplerCube shadowCubes[MAX_NUM_SHADOWS];
uniform int uNumShadowMaps;
@@ -32,7 +62,7 @@ void sampleLight(in LightSource light,
if (light.position.w == 0.0f) // directional light
{
wi = normalize(light.position.xyz);
-#if UIC_ENABLE_SSM
+#if QT3DS_ENABLE_SSM
if ( light.shadowIdx >= 0 )
att *= sampleOrthographic( shadowMaps[light.shadowIdx], light.shadowControls, light.shadowView, pos, vec2(1.0, light.shadowControls.z) );
#endif
@@ -66,7 +96,7 @@ void sampleLight(in LightSource light,
att = length(wi) * 0.15915494309; // solid angle / 2*pi
wi = normalize(wi);
att *= clamp( dot( pos - light.position.xyz, light.direction.xyz ), 0.0, 1.0 );
-#if UIC_ENABLE_SSM
+#if QT3DS_ENABLE_SSM
if ( light.shadowIdx >= 0 )
att *= sampleCubemap( shadowCubes[light.shadowIdx], light.shadowControls, light.shadowView, light.position.xyz, pos, vec2(1.0, light.shadowControls.z) );
#endif
@@ -77,14 +107,14 @@ void sampleLight(in LightSource light,
float dist = length(wi);
wi = wi / dist; // == normalize(wi);
att = 1.0f / (light.constantAttenuation + (light.linearAttenuation + light.quadraticAttenuation * dist) * dist);
- /*
+ /*
if (light.spotCutoff < 180.0f) // spot light
{
float spot = max(0.0f, dot(wi, -light.direction.xyz));
att *= (spot >= cos(light.spotCutoff * PI / 180.0f)) ? pow(spot, light.spotExponent) : 0.0f;
}
- */
-#if UIC_ENABLE_SSM
+ */
+#if QT3DS_ENABLE_SSM
if ( light.shadowIdx >= 0 )
att *= sampleCubemap( shadowCubes[light.shadowIdx], light.shadowControls, light.shadowView, light.position.xyz, pos, vec2(1.0, light.shadowControls.z) );
#endif
diff --git a/res/effectlib/sampleProbe.glsllib b/res/effectlib/sampleProbe.glsllib
index 9f8c091..43024ec 100644
--- a/res/effectlib/sampleProbe.glsllib
+++ b/res/effectlib/sampleProbe.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef SAMPLE_PROBE_GLSLLIB
#define SAMPLE_PROBE_GLSLLIB 1
@@ -6,21 +36,12 @@ uniform vec4 light_probe_props;
uniform vec4 light_probe_rotation;
uniform vec4 light_probe_offset; // light_probe_offset.w = number of mipmaps
-// GLES preprocessors require everything used in #if to be explicitly defined with a value
-#ifndef UIC_ENABLE_LIGHT_PROBE_2
-#define UIC_ENABLE_LIGHT_PROBE_2 0
-#endif
-
-#if UIC_ENABLE_LIGHT_PROBE_2
+#if QT3DS_ENABLE_LIGHT_PROBE_2
uniform sampler2D light_probe2;
uniform vec4 light_probe2_props;
#endif
-#ifndef UIC_ENABLE_IBL_FOV
-#define UIC_ENABLE_IBL_FOV 0
-#endif
-
-#if UIC_ENABLE_IBL_FOV
+#if QT3DS_ENABLE_IBL_FOV
uniform vec4 light_probe_opts;
#endif
@@ -75,7 +96,7 @@ vec2 getProbeSampleUV( vec3 smpDir, vec4 probeRot, vec2 probeOfs )
{
vec2 smpUV;
-#if UIC_ENABLE_IBL_FOV
+#if QT3DS_ENABLE_IBL_FOV
smpUV.x = (2.0 * atan(-smpDir.z, smpDir.x) + 3.14159265358 ) / light_probe_opts.x;
smpUV.y = (2.0 * atan(-smpDir.z, smpDir.y) + 3.14159265358 ) / light_probe_opts.x;
#else
@@ -89,7 +110,7 @@ vec2 getProbeSampleUV( vec3 smpDir, vec4 probeRot, vec2 probeOfs )
vec4 getTopLayerSample( vec3 inDir, float lodShift, vec3 lodOffsets )
{
-#if UIC_ENABLE_LIGHT_PROBE_2
+#if QT3DS_ENABLE_LIGHT_PROBE_2
if ( light_probe2_props.w < 0.5 )
return vec4(0.0, 0.0, 0.0, 0.0);
@@ -121,7 +142,7 @@ vec3 getProbeWeightedSample( vec3 smpDir, float lodShift, float roughness, vec3
vec2 smpUV = getProbeSampleUV( smpDir, light_probe_rotation, light_probe_offset.xy );
float wt = 1.0;
-#if UIC_ENABLE_IBL_FOV
+#if QT3DS_ENABLE_IBL_FOV
wt = min(wt, smoothstep(roughness * -0.25, roughness * 0.25, smpUV.x));
wt = min(wt, smoothstep(roughness * -0.25, roughness * 0.25, smpUV.y));
wt = min(wt, 1.0 - smoothstep(1.0 - roughness*0.25, 1.0 + roughness*0.25, smpUV.x));
@@ -158,7 +179,7 @@ vec3 getProbeWeightedSample( vec3 smpDir, float lodShift, float roughness, vec3
retVal += 0.3 * textureLod( light_probe, smpUV , lodShift+lodOffsets.y ).xyz;
retVal += 0.1 * textureLod( light_probe, smpUV , lodShift+lodOffsets.z ).xyz;
-#if UIC_ENABLE_LIGHT_PROBE_2
+#if QT3DS_ENABLE_LIGHT_PROBE_2
vec4 topSmp = getTopLayerSample( smpDir, lodShift, lodOffsets );
vec3 tempVal = mix( retVal, topSmp.xyz, topSmp.w );
retVal = mix( retVal, tempVal, light_probe2_props.z );
diff --git a/res/effectlib/screenSpaceAO.glsllib b/res/effectlib/screenSpaceAO.glsllib
index 9c8c36a..54204a1 100644
--- a/res/effectlib/screenSpaceAO.glsllib
+++ b/res/effectlib/screenSpaceAO.glsllib
@@ -1,8 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef SCREEN_SPACE_AO_GLSLLIB
#define SCREEN_SPACE_AO_GLSLLIB 1
-#if GLSL_130
-
#include "depthpass.glsllib"
@@ -119,15 +147,4 @@ float SSambientOcclusion(sampler2D depthSampler, vec3 viewNorm, vec4 aoParams, v
return ret;
}
-//ambient occlusion and shadow occlusion will not work without 130 support.
-
-#else
-
-float ambientOcclusion(sampler2D depthSampler, vec3 worldNorm, vec3 worldPos, mat4 viewMat, mat4 viewProj, vec4 aoParams, vec4 aoParams2, vec2 camProps, vec4 aoScreen, vec4 UvToEye)
-{
- return 1.0;
-}
-
-#endif
-
#endif
diff --git a/res/effectlib/screenSpaceDO.glsllib b/res/effectlib/screenSpaceDO.glsllib
index 09963b9..2ccc69f 100644
--- a/res/effectlib/screenSpaceDO.glsllib
+++ b/res/effectlib/screenSpaceDO.glsllib
@@ -1,8 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef SCREEN_SPACE_DO_GLSLLIB
#define SCREEN_SPACE_DO_GLSLLIB 1
-#if GLSL_130
-
#include "depthpass.glsllib"
vec3 getViewSpacePos( sampler2D depthSampler, vec2 camProps, vec2 UV, vec4 UvToEye )
@@ -127,16 +155,4 @@ float glossyOcclusionBasis(sampler2D depthSampler, mat3 tanFrame, vec3 worldPos,
}
*/
-#else
-
-// SSDO won't work without 130 support
-
-float shadowOcclusion(sampler2D depthSampler, vec3 lightDir, vec3 worldPos, mat4 viewMat, mat4 viewProj, vec4 shadowParams, vec2 camProps, vec4 aoScreen, vec4 UvToEye)
-{
- return 1.0;
-}
-
-#endif // #if GLSL_130
-
-
#endif
diff --git a/res/effectlib/shadowMapping.glsllib b/res/effectlib/shadowMapping.glsllib
index 911eb58..06e9623 100644
--- a/res/effectlib/shadowMapping.glsllib
+++ b/res/effectlib/shadowMapping.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef SHADOW_MAPPING_GLSLLIB
#define SHADOW_MAPPING_GLSLLIB
diff --git a/res/effectlib/simpleGlossyBSDF.glsllib b/res/effectlib/simpleGlossyBSDF.glsllib
index bacd822..31a9ac5 100644
--- a/res/effectlib/simpleGlossyBSDF.glsllib
+++ b/res/effectlib/simpleGlossyBSDF.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
vec4 simpleGlossyBSDF( in mat3 tanFrame, in vec3 L, vec3 V, in vec3 lightSpecular, in float ior
, in float roughnessU, in float roughnessV, int mode )
{
@@ -36,7 +66,7 @@ vec4 simpleGlossyBSDF( in mat3 tanFrame, in vec3 L, vec3 V, in vec3 lightSpecula
vec4 simpleGlossyBSDFEnvironment( in mat3 tanFrame, in vec3 viewDir, in float roughnessU, in float roughnessV, int mode )
{
vec3 rgb = vec3( 0.0f, 0.0f, 0.0f );
-#if !UIC_ENABLE_LIGHT_PROBE
+#if !QT3DS_ENABLE_LIGHT_PROBE
if ( uEnvironmentMappingEnabled )
{
float roughness = calculateRoughness( tanFrame[2], roughnessU, roughnessV, tanFrame[0] );
diff --git a/res/effectlib/specularBSDF.glsllib b/res/effectlib/specularBSDF.glsllib
index 46a905c..9e31544 100644
--- a/res/effectlib/specularBSDF.glsllib
+++ b/res/effectlib/specularBSDF.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "funcspecularBSDF.glsllib"
#ifndef DEFAULT_MATERIAL_LIGHTING
diff --git a/res/effectlib/spotEdf.glsllib b/res/effectlib/spotEdf.glsllib
index 488aa1e..663bd8f 100644
--- a/res/effectlib/spotEdf.glsllib
+++ b/res/effectlib/spotEdf.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
float spotEdf( float exponent )
{
float att = 1.0;
diff --git a/res/effectlib/square.glsllib b/res/effectlib/square.glsllib
index ca94aa4..9685722 100644
--- a/res/effectlib/square.glsllib
+++ b/res/effectlib/square.glsllib
@@ -1,4 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
float square( in float x )
{
return( x * x );
}
+
diff --git a/res/effectlib/tangentSpaceNormalTexture.glsllib b/res/effectlib/tangentSpaceNormalTexture.glsllib
index 6f55e0c..1fcc429 100644
--- a/res/effectlib/tangentSpaceNormalTexture.glsllib
+++ b/res/effectlib/tangentSpaceNormalTexture.glsllib
@@ -1,7 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef FILE_NORMAL_TEXTURE_GLSLLIB
#define FILE_NORMAL_TEXTURE_GLSLLIB
-#ifdef UIC_DEFINE_API
+#ifdef QT3DS_DEFINE_API
#include "luminance.glsllib"
#include "monoChannel.glsllib"
@@ -23,19 +53,19 @@ vec3 tangentSpaceNormalTexture( in sampler2D tex, in float factor, in bool flipT
bool flipV = flipTangentV;
if ( wrapU == wrap_mirrored_repeat )
{
- if ( ( ( 0.0f < uvw.position.x ) && ( int( uvw.position.x ) % 2 == 1 ) )
- || ( ( uvw.position.x < 0.0f ) && ( int( uvw.position.x ) % 2 == 0 ) ) )
+ if ( ( ( 0.0 < uvw.position.x ) && ( int( uvw.position.x ) % 2 == 1 ) )
+ || ( ( uvw.position.x < 0.0 ) && ( int( uvw.position.x ) % 2 == 0 ) ) )
{
flipU = !flipU;
}
- if ( ( ( 0.0f < uvw.position.y ) && ( int( uvw.position.y ) % 2 == 1 ) )
- || ( ( uvw.position.y < 0.0f ) && ( int( uvw.position.y ) % 2 == 0 ) ) )
+ if ( ( ( 0.0 < uvw.position.y ) && ( int( uvw.position.y ) % 2 == 1 ) )
+ || ( ( uvw.position.y < 0.0 ) && ( int( uvw.position.y ) % 2 == 0 ) ) )
{
flipV = !flipV;
}
}
- vec3 tangent = 2.0f * texture( tex, uvw.position.xy ).xyz - 1.0f;
+ vec3 tangent = 2.0 * texture( tex, uvw.position.xy ).xyz - 1.0;
vec3 tangentU = normalize( flipU ? -uvw.tangent_u : uvw.tangent_u );
vec3 tangentV = normalize( flipV ? -uvw.tangent_v : uvw.tangent_v );
@@ -49,7 +79,7 @@ vec3 tangentSpaceNormalTexture( in sampler2D tex, in float factor, in bool flipT
//Simpler version built to run from UIC image data
//In our case, we have already generated the texture coordinate x,y position
//TODO - figure out if we need to manipulate tangent_u, tangent_v.
-vec3 uicDefaultMaterialFileNormalTexture( in sampler2D sampler, in float factor, vec2 texCoord, vec3 tangent, vec3 binormal )
+vec3 defaultMaterialFileNormalTexture( in sampler2D sampler, in float factor, vec2 texCoord, vec3 tangent, vec3 binormal )
{
// factor should be in [0,1] range
return tangentSpaceNormalTexture( sampler, clamp(factor, 0.0, 1.0), false, false
diff --git a/res/effectlib/tessellationLinear.glsllib b/res/effectlib/tessellationLinear.glsllib
index fc6595e..e1bb4dd 100644
--- a/res/effectlib/tessellationLinear.glsllib
+++ b/res/effectlib/tessellationLinear.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef TESSELLATION_LINEAR_GLSLLIB
#define TESSELLATION_LINEAR_GLSLLIB
@@ -71,3 +101,4 @@ vec4 tessShader ( )
#endif
#endif
+
diff --git a/res/effectlib/tessellationLinearCM.glsllib b/res/effectlib/tessellationLinearCM.glsllib
index ab75e8e..785df4d 100644
--- a/res/effectlib/tessellationLinearCM.glsllib
+++ b/res/effectlib/tessellationLinearCM.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef TESSELLATION_LINEAR_CM_GLSLLIB
#define TESSELLATION_LINEAR_CM_ GLSLLIB
@@ -14,33 +44,33 @@ attribute vec3 varObjPos[];
varying vec3 varNormalTC[];
varying vec3 varObjPosTC[];
-#if UIC_ENABLE_UV0
+#if QT3DS_ENABLE_UV0
attribute vec3 varTexCoord0[];
varying vec3 varTexCoord0TC[];
#endif
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
attribute vec3 varTangent[];
attribute vec3 varObjTangent[];
varying vec3 varTangentTC[];
varying vec3 varObjTangentTC[];
#endif
-#if UIC_ENABLE_BINORMAL
+#if QT3DS_ENABLE_BINORMAL
attribute vec3 varBinormal[];
attribute vec3 varObjBinormal[];
varying vec3 varBinormalTC[];
varying vec3 varObjBinormalTC[];
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
attribute vec3 varWorldPos[];
varying vec3 varWorldPosTC[];
#endif
void main() {
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
ctWorldPos[0] = varWorldPos[0];
ctWorldPos[1] = varWorldPos[1];
ctWorldPos[2] = varWorldPos[2];
@@ -52,18 +82,18 @@ void main() {
varObjPosTC[gl_InvocationID] = varObjPos[gl_InvocationID];
varNormalTC[gl_InvocationID] = varNormal[gl_InvocationID];
-#if UIC_ENABLE_UV0
+#if QT3DS_ENABLE_UV0
varTexCoord0TC[gl_InvocationID] = varTexCoord0[gl_InvocationID];
#endif
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
varTangentTC[gl_InvocationID] = varTangent[gl_InvocationID];
varObjTangentTC[gl_InvocationID] = varObjTangent[gl_InvocationID];
#endif
-#if UIC_ENABLE_BINORMAL
+#if QT3DS_ENABLE_BINORMAL
varBinormalTC[gl_InvocationID] = varBinormal[gl_InvocationID];
varObjBinormalTC[gl_InvocationID] = varObjBinormal[gl_InvocationID];
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
varWorldPosTC[gl_InvocationID] = varWorldPos[gl_InvocationID];
#endif
}
@@ -88,26 +118,26 @@ attribute vec3 varObjPosTC[];
varying vec3 VARYING_NAME(varNormal);
varying vec3 VARYING_NAME(varObjPos);
-#if UIC_ENABLE_UV0
+#if QT3DS_ENABLE_UV0
attribute vec3 varTexCoord0TC[];
varying vec3 VARYING_NAME(varTexCoord0);
#endif
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
attribute vec3 varTangentTC[];
attribute vec3 varObjTangentTC[];
varying vec3 VARYING_NAME(varTangent);
varying vec3 VARYING_NAME(varObjTangent);
#endif
-#if UIC_ENABLE_BINORMAL
+#if QT3DS_ENABLE_BINORMAL
attribute vec3 varBinormalTC[];
attribute vec3 varObjBinormalTC[];
varying vec3 VARYING_NAME(varBinormal);
varying vec3 VARYING_NAME(varObjBinormal);
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
attribute vec3 varWorldPosTC[];
varying vec3 VARYING_NAME(varWorldPos);
#endif
@@ -120,18 +150,18 @@ void main() {
VARYING_NAME(varObjPos) = gl_TessCoord.x * varObjPosTC[0] + gl_TessCoord.y * varObjPosTC[1] + gl_TessCoord.z * varObjPosTC[2];
VARYING_NAME(varNormal) = gl_TessCoord.x * varNormalTC[0] + gl_TessCoord.y * varNormalTC[1] + gl_TessCoord.z * varNormalTC[2];
-#if UIC_ENABLE_UV0
+#if QT3DS_ENABLE_UV0
VARYING_NAME(varTexCoord0) = gl_TessCoord.x * varTexCoord0TC[0] + gl_TessCoord.y * varTexCoord0TC[1] + gl_TessCoord.z * varTexCoord0TC[2];
#endif
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
VARYING_NAME(varTangent) = gl_TessCoord.x * varTangentTC[0] + gl_TessCoord.y * varTangentTC[1] + gl_TessCoord.z * varTangentTC[2];
VARYING_NAME(varObjTangent) = gl_TessCoord.x * varObjTangentTC[0] + gl_TessCoord.y * varObjTangentTC[1] + gl_TessCoord.z * varObjTangentTC[2];
#endif
-#if UIC_ENABLE_BINORMAL
+#if QT3DS_ENABLE_BINORMAL
VARYING_NAME(varBinormal) = gl_TessCoord.x * varBinormalTC[0] + gl_TessCoord.y * varBinormalTC[1] + gl_TessCoord.z * varBinormalTC[2];
VARYING_NAME(varObjBinormal) = gl_TessCoord.x * varObjBinormalTC[0] + gl_TessCoord.y * varObjBinormalTC[1] + gl_TessCoord.z * varObjBinormalTC[2];
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
VARYING_NAME(varWorldPos) = gl_TessCoord.x * varWorldPosTC[0] + gl_TessCoord.y * varWorldPosTC[1] + gl_TessCoord.z * varWorldPosTC[2];
#endif
@@ -141,3 +171,4 @@ void main() {
#endif
#endif
+
diff --git a/res/effectlib/tessellationNPatch.glsllib b/res/effectlib/tessellationNPatch.glsllib
index 506ef1f..9519c23 100644
--- a/res/effectlib/tessellationNPatch.glsllib
+++ b/res/effectlib/tessellationNPatch.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef TESSELLATION_NPATCH_GLSLLIB
#define TESSELLATION_NPATCH_GLSLLIB
@@ -21,7 +51,7 @@ struct NPatchTessPatch
#if TESSELLATION_CONTROL_SHADER
layout (vertices = 3) out;
-layout(location=15) out NPatchTessPatch tcTessPatch[3];
+layout(location=15) out NPatchTessPatch tcTessPatch[];
// global setup in main
vec3 ctWorldPos[3];
@@ -257,3 +287,4 @@ vec4 tessShader ( )
#endif
#endif
+
diff --git a/res/effectlib/tessellationNPatchCM.glsllib b/res/effectlib/tessellationNPatchCM.glsllib
index c883b64..1b81231 100644
--- a/res/effectlib/tessellationNPatchCM.glsllib
+++ b/res/effectlib/tessellationNPatchCM.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef TESSELLATION_NPATCH_CM_GLSLLIB
#define TESSELLATION_NPATCH_CM_GLSLLIB GLSLLIB
@@ -16,26 +46,26 @@ attribute vec3 varObjPos[];
varying vec3 varNormalTC[];
varying vec3 varObjPosTC[];
-#if UIC_ENABLE_UV0
+#if QT3DS_ENABLE_UV0
attribute vec3 varTexCoord0[];
varying vec3 varTexCoord0TC[];
#endif
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
attribute vec3 varTangent[];
attribute vec3 varObjTangent[];
varying vec3 varTangentTC[];
varying vec3 varObjTangentTC[];
#endif
-#if UIC_ENABLE_BINORMAL
+#if QT3DS_ENABLE_BINORMAL
attribute vec3 varBinormal[];
attribute vec3 varObjBinormal[];
varying vec3 varBinormalTC[];
varying vec3 varObjBinormalTC[];
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
attribute vec3 varWorldPos[];
varying vec3 varWorldPosTC[];
#endif
@@ -45,12 +75,12 @@ void main() {
ctNorm[0] = varNormal[0];
ctNorm[1] = varNormal[1];
ctNorm[2] = varNormal[2];
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
ctTangent[0] = varObjTangent[0];
ctTangent[1] = varObjTangent[1];
ctTangent[2] = varObjTangent[2];
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
ctWorldPos[0] = varWorldPos[0];
ctWorldPos[1] = varWorldPos[1];
ctWorldPos[2] = varWorldPos[2];
@@ -62,18 +92,18 @@ void main() {
varObjPosTC[gl_InvocationID] = varObjPos[gl_InvocationID];
varNormalTC[gl_InvocationID] = varNormal[gl_InvocationID];
-#if UIC_ENABLE_UV0
+#if QT3DS_ENABLE_UV0
varTexCoord0TC[gl_InvocationID] = varTexCoord0[gl_InvocationID];
#endif
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
varTangentTC[gl_InvocationID] = varTangent[gl_InvocationID];
varObjTangentTC[gl_InvocationID] = varObjTangent[gl_InvocationID];
#endif
-#if UIC_ENABLE_BINORMAL
+#if QT3DS_ENABLE_BINORMAL
varBinormalTC[gl_InvocationID] = varBinormal[gl_InvocationID];
varObjBinormalTC[gl_InvocationID] = varObjBinormal[gl_InvocationID];
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
varWorldPosTC[gl_InvocationID] = varWorldPos[gl_InvocationID];
#endif
}
@@ -98,26 +128,26 @@ attribute vec3 varObjPosTC[];
varying vec3 VARYING_NAME(varNormal);
varying vec3 VARYING_NAME(varObjPos);
-#if UIC_ENABLE_UV0
+#if QT3DS_ENABLE_UV0
attribute vec3 varTexCoord0TC[];
varying vec3 VARYING_NAME(varTexCoord0);
#endif
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
attribute vec3 varTangentTC[];
attribute vec3 varObjTangentTC[];
varying vec3 VARYING_NAME(varTangent);
varying vec3 VARYING_NAME(varObjTangent);
#endif
-#if UIC_ENABLE_BINORMAL
+#if QT3DS_ENABLE_BINORMAL
attribute vec3 varBinormalTC[];
attribute vec3 varObjBinormalTC[];
varying vec3 VARYING_NAME(varBinormal);
varying vec3 VARYING_NAME(varObjBinormal);
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
attribute vec3 varWorldPosTC[];
varying vec3 VARYING_NAME(varWorldPos);
#endif
@@ -127,7 +157,7 @@ void main() {
ctNorm[0] = varNormalTC[0];
ctNorm[1] = varNormalTC[1];
ctNorm[2] = varNormalTC[2];
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
ctTangent[0] = varObjTangentTC[0];
ctTangent[1] = varObjTangentTC[1];
ctTangent[2] = varObjTangentTC[2];
@@ -139,20 +169,20 @@ void main() {
VARYING_NAME(varObjPos) = gl_TessCoord.z * varObjPosTC[0] + gl_TessCoord.x * varObjPosTC[1] + gl_TessCoord.y * varObjPosTC[2];
-#if UIC_ENABLE_UV0
+#if QT3DS_ENABLE_UV0
VARYING_NAME(varTexCoord0) = gl_TessCoord.z * varTexCoord0TC[0] + gl_TessCoord.x * varTexCoord0TC[1] + gl_TessCoord.y * varTexCoord0TC[2];
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
VARYING_NAME(varWorldPos) = gl_TessCoord.z * varWorldPosTC[0] + gl_TessCoord.x * varWorldPosTC[1] + gl_TessCoord.y * varWorldPosTC[2];
#endif
VARYING_NAME(varNormal) = normalize(normal_matrix * teNorm);
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
VARYING_NAME(varTangent) = normalize(normal_matrix * teTangent);
VARYING_NAME(varObjTangent) = gl_TessCoord.z * varObjTangentTC[0] + gl_TessCoord.x * varObjTangentTC[1] + gl_TessCoord.y * varObjTangentTC[2];
#endif
-#if UIC_ENABLE_BINORMAL
+#if QT3DS_ENABLE_BINORMAL
VARYING_NAME(varBinormal) = normalize(normal_matrix * teBinormal);
VARYING_NAME(varObjBinormal) = gl_TessCoord.z * varObjBinormalTC[0] + gl_TessCoord.x * varObjBinormalTC[1] + gl_TessCoord.y * varObjBinormalTC[2];
#endif
@@ -161,3 +191,4 @@ void main() {
#endif
#endif
+
diff --git a/res/effectlib/tessellationPath.glsllib b/res/effectlib/tessellationPath.glsllib
index 4758a41..17b87b0 100644
--- a/res/effectlib/tessellationPath.glsllib
+++ b/res/effectlib/tessellationPath.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef TESSELLATION_PATH_GLSLLIB
#define TESSELLATION_PATH_GLSLLIB
@@ -150,3 +180,4 @@ STessShaderResult tessShader ( float inPathWidth )
#endif
#endif
+
diff --git a/res/effectlib/tessellationPhong.glsllib b/res/effectlib/tessellationPhong.glsllib
index 8a5351a..60edce6 100644
--- a/res/effectlib/tessellationPhong.glsllib
+++ b/res/effectlib/tessellationPhong.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef TESSELLATION_PHONG_GLSLLIB
#define TESSELLATION_PHONG_GLSLLIB
@@ -11,7 +41,7 @@ struct PhongTessPatch
#if TESSELLATION_CONTROL_SHADER
layout (vertices = 3) out;
-layout(location = 15) out PhongTessPatch tcTessPatch[3];
+layout(location = 15) out PhongTessPatch tcTessPatch[];
// global setup in main
vec3 ctWorldPos[3];
@@ -137,3 +167,4 @@ vec4 tessShader ( )
#endif
#endif
+
diff --git a/res/effectlib/tessellationPhongCM.glsllib b/res/effectlib/tessellationPhongCM.glsllib
index 2413cf0..0b2fbc7 100644
--- a/res/effectlib/tessellationPhongCM.glsllib
+++ b/res/effectlib/tessellationPhongCM.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef TESSELLATION_PHONG_CM_GLSLLIB
#define TESSELLATION_PHONG_CM_ GLSLLIB
@@ -16,33 +46,33 @@ attribute vec3 varObjPos[];
varying vec3 varNormalTC[];
varying vec3 varObjPosTC[];
-#if UIC_ENABLE_UV0
+#if QT3DS_ENABLE_UV0
attribute vec3 varTexCoord0[];
varying vec3 varTexCoord0TC[];
#endif
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
attribute vec3 varTangent[];
attribute vec3 varObjTangent[];
varying vec3 varTangentTC[];
varying vec3 varObjTangentTC[];
#endif
-#if UIC_ENABLE_BINORMAL
+#if QT3DS_ENABLE_BINORMAL
attribute vec3 varBinormal[];
attribute vec3 varObjBinormal[];
varying vec3 varBinormalTC[];
varying vec3 varObjBinormalTC[];
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
attribute vec3 varWorldPos[];
varying vec3 varWorldPosTC[];
#endif
void main() {
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
ctWorldPos[0] = varWorldPos[0];
ctWorldPos[1] = varWorldPos[1];
ctWorldPos[2] = varWorldPos[2];
@@ -57,18 +87,18 @@ void main() {
varObjPosTC[gl_InvocationID] = varObjPos[gl_InvocationID];
varNormalTC[gl_InvocationID] = varNormal[gl_InvocationID];
-#if UIC_ENABLE_UV0
+#if QT3DS_ENABLE_UV0
varTexCoord0TC[gl_InvocationID] = varTexCoord0[gl_InvocationID];
#endif
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
varTangentTC[gl_InvocationID] = varTangent[gl_InvocationID];
varObjTangentTC[gl_InvocationID] = varObjTangent[gl_InvocationID];
#endif
-#if UIC_ENABLE_BINORMAL
+#if QT3DS_ENABLE_BINORMAL
varBinormalTC[gl_InvocationID] = varBinormal[gl_InvocationID];
varObjBinormalTC[gl_InvocationID] = varObjBinormal[gl_InvocationID];
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
varWorldPosTC[gl_InvocationID] = varWorldPos[gl_InvocationID];
#endif
}
@@ -93,26 +123,26 @@ attribute vec3 varObjPosTC[];
varying vec3 VARYING_NAME(varNormal);
varying vec3 VARYING_NAME(varObjPos);
-#if UIC_ENABLE_UV0
+#if QT3DS_ENABLE_UV0
attribute vec3 varTexCoord0TC[];
varying vec3 VARYING_NAME(varTexCoord0);
#endif
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
attribute vec3 varTangentTC[];
attribute vec3 varObjTangentTC[];
varying vec3 VARYING_NAME(varTangent);
varying vec3 VARYING_NAME(varObjTangent);
#endif
-#if UIC_ENABLE_BINORMAL
+#if QT3DS_ENABLE_BINORMAL
attribute vec3 varBinormalTC[];
attribute vec3 varObjBinormalTC[];
varying vec3 VARYING_NAME(varBinormal);
varying vec3 VARYING_NAME(varObjBinormal);
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
attribute vec3 varWorldPosTC[];
varying vec3 VARYING_NAME(varWorldPos);
#endif
@@ -125,18 +155,18 @@ void main() {
VARYING_NAME(varObjPos) = gl_TessCoord.x * varObjPosTC[0] + gl_TessCoord.y * varObjPosTC[1] + gl_TessCoord.z * varObjPosTC[2];
VARYING_NAME(varNormal) = gl_TessCoord.x * varNormalTC[0] + gl_TessCoord.y * varNormalTC[1] + gl_TessCoord.z * varNormalTC[2];
-#if UIC_ENABLE_UV0
+#if QT3DS_ENABLE_UV0
VARYING_NAME(varTexCoord0) = gl_TessCoord.x * varTexCoord0TC[0] + gl_TessCoord.y * varTexCoord0TC[1] + gl_TessCoord.z * varTexCoord0TC[2];
#endif
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
VARYING_NAME(varTangent) = gl_TessCoord.x * varTangentTC[0] + gl_TessCoord.y * varTangentTC[1] + gl_TessCoord.z * varTangentTC[2];
VARYING_NAME(varObjTangent) = gl_TessCoord.x * varObjTangentTC[0] + gl_TessCoord.y * varObjTangentTC[1] + gl_TessCoord.z * varObjTangentTC[2];
#endif
-#if UIC_ENABLE_BINORMAL
+#if QT3DS_ENABLE_BINORMAL
VARYING_NAME(varBinormal) = gl_TessCoord.x * varBinormalTC[0] + gl_TessCoord.y * varBinormalTC[1] + gl_TessCoord.z * varBinormalTC[2];
VARYING_NAME(varObjBinormal) = gl_TessCoord.x * varObjBinormalTC[0] + gl_TessCoord.y * varObjBinormalTC[1] + gl_TessCoord.z * varObjBinormalTC[2];
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
VARYING_NAME(varWorldPos) = gl_TessCoord.x * varWorldPosTC[0] + gl_TessCoord.y * varWorldPosTC[1] + gl_TessCoord.z * varWorldPosTC[2];
#endif
@@ -146,3 +176,4 @@ void main() {
#endif
#endif
+
diff --git a/res/effectlib/textureCoordinateInfo.glsllib b/res/effectlib/textureCoordinateInfo.glsllib
index 39fc53f..6e8c48a 100644
--- a/res/effectlib/textureCoordinateInfo.glsllib
+++ b/res/effectlib/textureCoordinateInfo.glsllib
@@ -1,7 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef TEXTURE_COORDINATE_INFO_GLSLLIB
#define TEXTURE_COORDINATE_INFO_GLSLLIB
-#ifdef UIC_DEFINE_API
+#ifdef QT3DS_DEFINE_API
struct texture_coordinate_info
{
diff --git a/res/effectlib/transformCoordinate.glsllib b/res/effectlib/transformCoordinate.glsllib
index 5efcd46..ccdf7d0 100644
--- a/res/effectlib/transformCoordinate.glsllib
+++ b/res/effectlib/transformCoordinate.glsllib
@@ -1,12 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef TRANSFORM_COORDINATE_GLSLLIB
#define TRANSFORM_COORDINATE_GLSLLIB
texture_coordinate_info transformCoordinate( in mat4 transform, in texture_coordinate_info coordinate )
{
texture_coordinate_info tci;
- tci.position = ( transform * vec4( coordinate.position, 1.0f ) ).xyz;
- tci.tangent_u = ( transform * vec4( coordinate.tangent_u, 0.0f ) ).xyz;
- tci.tangent_v = ( transform * vec4( coordinate.tangent_v, 0.0f ) ).xyz;
+ tci.position = ( transform * vec4( coordinate.position, 1.0 ) ).xyz;
+ tci.tangent_u = ( transform * vec4( coordinate.tangent_u, 0.0 ) ).xyz;
+ tci.tangent_v = ( transform * vec4( coordinate.tangent_v, 0.0 ) ).xyz;
return( tci );
}
diff --git a/res/effectlib/uicDefaultMaterialFileBumpTexture.glsllib b/res/effectlib/uicDefaultMaterialFileBumpTexture.glsllib
deleted file mode 100644
index 577229f..0000000
--- a/res/effectlib/uicDefaultMaterialFileBumpTexture.glsllib
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef UIC_DEFAULT_MATERIAL_FILE_BUMP_TEXTURE_GLSLLIB
-#define UIC_DEFAULT_MATERIAL_FILE_BUMP_TEXTURE_GLSLLIB
-
-#ifndef UIC_DEFINE_API
-#define UIC_DEFINE_API
-#endif
-
-#include "fileBumpTexture.glsllib"
-
-#endif
diff --git a/res/effectlib/uicDefaultMaterialFileDisplacementTexture.glsllib b/res/effectlib/uicDefaultMaterialFileDisplacementTexture.glsllib
deleted file mode 100644
index 74b5f14..0000000
--- a/res/effectlib/uicDefaultMaterialFileDisplacementTexture.glsllib
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef UIC_DEFAULT_MATERIAL_FILE_DISPLACEMENT_TEXTURE_GLSLLIB
-#define UIC_DEFAULT_MATERIAL_FILE_DISPLACEMENT_TEXTURE_GLSLLIB
-
-#ifndef UIC_DEFINE_API
-#define UIC_DEFINE_API
-#endif
-
-#include "fileDisplacementTexture.glsllib"
-
-#endif
diff --git a/res/effectlib/uicDefaultMaterialFileNormalTexture.glsllib b/res/effectlib/uicDefaultMaterialFileNormalTexture.glsllib
deleted file mode 100644
index 0be9954..0000000
--- a/res/effectlib/uicDefaultMaterialFileNormalTexture.glsllib
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef UIC_DEFAULT_MATERIAL_FILE_NORMAL_TEXTURE_GLSLLIB
-#define UIC_DEFAULT_MATERIAL_FILE_NORMAL_TEXTURE_GLSLLIB
-
-#ifndef UIC_DEFINE_API
-#define UIC_DEFINE_API
-#endif
-
-#include "tangentSpaceNormalTexture.glsllib"
-
-#endif
diff --git a/res/effectlib/vertexFragmentBase.glsllib b/res/effectlib/vertexFragmentBase.glsllib
index 02d4f5b..dd428bb 100644
--- a/res/effectlib/vertexFragmentBase.glsllib
+++ b/res/effectlib/vertexFragmentBase.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef VERTEX_FRAGMENT_BASE_GLSLLIB
#define VERTEX_FRAGMENT_BASE_GLSLLIB
diff --git a/res/effectlib/viewProperties.glsllib b/res/effectlib/viewProperties.glsllib
index d81557c..6de20a6 100644
--- a/res/effectlib/viewProperties.glsllib
+++ b/res/effectlib/viewProperties.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef VIEW_PROPERTIES_GLSLLIB
#define VIEW_PROPERTIES_GLSLLIB
diff --git a/res/effectlib/weightedLayer.glsllib b/res/effectlib/weightedLayer.glsllib
index 5ae1501..781ffac 100644
--- a/res/effectlib/weightedLayer.glsllib
+++ b/res/effectlib/weightedLayer.glsllib
@@ -1,4 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
vec4 weightedLayer( in float weight, in vec3 layercolor, in vec4 layer, in vec4 base, in float alpha )
{
return vec4( mix( base.rgb, layer.rgb * layercolor, weight ), alpha );
}
+
diff --git a/res/effectlib/wireframeCM.glsllib b/res/effectlib/wireframeCM.glsllib
index d2ca556..fcbf7e9 100644
--- a/res/effectlib/wireframeCM.glsllib
+++ b/res/effectlib/wireframeCM.glsllib
@@ -1,3 +1,33 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 NVIDIA Corporation.
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt 3D Studio.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** 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 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** 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.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef WIREFRAME_CM_GLSLLIB
#define WIREFRAME_CM_GLSLLIB
@@ -12,33 +42,32 @@ precision highp int;
#define VARYING_NAME(varyingName) varyingName##VX
#endif
-
attribute vec3 VARYING_NAME(varNormal)[];
attribute vec3 VARYING_NAME(varObjPos)[];
varying vec3 varNormal;
varying vec3 varObjPos;
-#if UIC_ENABLE_UV0
+#if QT3DS_ENABLE_UV0
attribute vec3 VARYING_NAME(varTexCoord0)[];
varying vec3 varTexCoord0;
#endif
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
attribute vec3 VARYING_NAME(varTangent)[];
attribute vec3 VARYING_NAME(varObjTangent)[];
varying vec3 varTangent;
varying vec3 varObjTangent;
#endif
-#if UIC_ENABLE_BINORMAL
+#if QT3DS_ENABLE_BINORMAL
attribute vec3 VARYING_NAME(varBinormal)[];
attribute vec3 VARYING_NAME(varObjBinormal)[];
varying vec3 varBinormal;
varying vec3 varObjBinormal;
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
attribute vec3 VARYING_NAME(varWorldPos)[];
varying vec3 varWorldPos;
#endif
@@ -47,7 +76,6 @@ varying vec3 varEdgeDistance;
uniform mat4 viewport_matrix;
-
layout (triangles) in;
layout (triangle_strip, max_vertices = 3) out;
@@ -73,18 +101,18 @@ void main()
varEdgeDistance = vec3(ha*gl_in[0].gl_Position.w, 0.0, 0.0);
varNormal = VARYING_NAME(varNormal)[0];
varObjPos = VARYING_NAME(varObjPos)[0];
-#if UIC_ENABLE_UV0
+#if QT3DS_ENABLE_UV0
varTexCoord0 = VARYING_NAME(varTexCoord0)[0];
#endif
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
varTangent = VARYING_NAME(varTangent)[0];
varObjTangent = VARYING_NAME(varObjTangent)[0];
#endif
-#if UIC_ENABLE_BINORMAL
+#if QT3DS_ENABLE_BINORMAL
varBinormal = VARYING_NAME(varBinormal)[0];
varObjBinormal = VARYING_NAME(varObjBinormal)[0];
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
varWorldPos = VARYING_NAME(varWorldPos)[0];
#endif
@@ -95,18 +123,18 @@ void main()
varEdgeDistance = vec3(0.0, hb*gl_in[1].gl_Position.w, 0.0);
varNormal = VARYING_NAME(varNormal)[1];
varObjPos = VARYING_NAME(varObjPos)[1];
-#if UIC_ENABLE_UV0
+#if QT3DS_ENABLE_UV0
varTexCoord0 = VARYING_NAME(varTexCoord0)[1];
#endif
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
varTangent = VARYING_NAME(varTangent)[1];
varObjTangent = VARYING_NAME(varObjTangent)[1];
#endif
-#if UIC_ENABLE_BINORMAL
+#if QT3DS_ENABLE_BINORMAL
varBinormal = VARYING_NAME(varBinormal)[1];
varObjBinormal = VARYING_NAME(varObjBinormal)[1];
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
varWorldPos = VARYING_NAME(varWorldPos)[1];
#endif
@@ -117,18 +145,18 @@ void main()
varEdgeDistance = vec3(0.0, 0.0, hc*gl_in[2].gl_Position.w);
varNormal = VARYING_NAME(varNormal)[2];
varObjPos = VARYING_NAME(varObjPos)[2];
-#if UIC_ENABLE_UV0
+#if QT3DS_ENABLE_UV0
varTexCoord0 = VARYING_NAME(varTexCoord0)[2];
#endif
-#if UIC_ENABLE_TEXTAN
+#if QT3DS_ENABLE_TEXTAN
varTangent = VARYING_NAME(varTangent)[2];
varObjTangent = VARYING_NAME(varObjTangent)[2];
#endif
-#if UIC_ENABLE_BINORMAL
+#if QT3DS_ENABLE_BINORMAL
varBinormal = VARYING_NAME(varBinormal)[2];
varObjBinormal = VARYING_NAME(varObjBinormal)[2];
#endif
-#if UIC_ENABLE_WORLD_POSITION
+#if QT3DS_ENABLE_WORLD_POSITION
varWorldPos = VARYING_NAME(varWorldPos)[2];
#endif
@@ -138,5 +166,4 @@ void main()
EndPrimitive();
}
-
#endif