summaryrefslogtreecommitdiffstats
path: root/demos/qt3d/teaservice/per_pixel_lighting.vsh
diff options
context:
space:
mode:
Diffstat (limited to 'demos/qt3d/teaservice/per_pixel_lighting.vsh')
-rw-r--r--demos/qt3d/teaservice/per_pixel_lighting.vsh96
1 files changed, 0 insertions, 96 deletions
diff --git a/demos/qt3d/teaservice/per_pixel_lighting.vsh b/demos/qt3d/teaservice/per_pixel_lighting.vsh
deleted file mode 100644
index d5157840..00000000
--- a/demos/qt3d/teaservice/per_pixel_lighting.vsh
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation ([email protected])
-**
-** This file is part of the QtQuick3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// Per-pixel lighting - vertex shader side.
-
-attribute highp vec4 qt_Vertex;
-attribute mediump vec3 qt_Normal;
-uniform mediump mat4 qt_ModelViewMatrix;
-uniform mediump mat4 qt_ModelViewProjectionMatrix;
-uniform mediump mat3 qt_NormalMatrix;
-
-struct qt_MaterialParameters {
- mediump vec4 emission;
- mediump vec4 ambient;
- mediump vec4 diffuse;
- mediump vec4 specular;
- mediump float shininess;
-};
-uniform qt_MaterialParameters qt_Material;
-
-struct qt_SingleLightParameters {
- mediump vec4 position;
- mediump vec3 spotDirection;
- mediump float spotExponent;
- mediump float spotCutoff;
- mediump float spotCosCutoff;
- mediump float constantAttenuation;
- mediump float linearAttenuation;
- mediump float quadraticAttenuation;
-};
-uniform qt_SingleLightParameters qt_Light;
-
-varying mediump vec4 qAmbient;
-varying mediump vec4 qDiffuse;
-varying mediump vec3 qNormal;
-varying mediump vec3 qLightDirection;
-varying mediump vec3 qHalfVector;
-varying mediump vec3 qVertexToLight;
-
-void qLightVertex(vec4 vertex, vec3 normal)
-{
- vec3 toEye;
- qNormal = normal;
- qAmbient = qt_Material.emission + qt_Material.ambient;
- qDiffuse = qt_Material.diffuse;
- qLightDirection = normalize(qt_Light.position.xyz);
- toEye = vec3(0, 0, 1);
- qHalfVector = normalize(qLightDirection + toEye);
- qVertexToLight = vertex.xyz - qt_Light.position.xyz;
-}
-
-void main(void)
-{
- gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
- vec4 vertex = qt_ModelViewMatrix * qt_Vertex;
- vec3 normal = normalize(qt_NormalMatrix * qt_Normal);
- qLightVertex(vertex, normal);
-}