summaryrefslogtreecommitdiffstats
path: root/tests/manual/shadow-map-qml/shaders/ads.vert
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/shadow-map-qml/shaders/ads.vert')
-rw-r--r--tests/manual/shadow-map-qml/shaders/ads.vert33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/manual/shadow-map-qml/shaders/ads.vert b/tests/manual/shadow-map-qml/shaders/ads.vert
new file mode 100644
index 000000000..017fa0082
--- /dev/null
+++ b/tests/manual/shadow-map-qml/shaders/ads.vert
@@ -0,0 +1,33 @@
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#version 150 core
+
+in vec3 vertexPosition;
+in vec3 vertexNormal;
+
+out vec4 positionInLightSpace;
+out vec3 position;
+out vec3 normal;
+
+uniform mat4 lightViewProjection;
+uniform mat4 modelMatrix;
+uniform mat4 modelView;
+uniform mat3 modelViewNormal;
+uniform mat4 mvp;
+
+void main()
+{
+ // positionInLightSpace = lightViewProjection * modelMatrix * vec4(vertexPosition, 1.0);
+ const mat4 shadowMatrix = mat4(0.5, 0.0, 0.0, 0.0,
+ 0.0, 0.5, 0.0, 0.0,
+ 0.0, 0.0, 0.5, 0.0,
+ 0.5, 0.5, 0.5, 1.0);
+
+ positionInLightSpace = shadowMatrix * lightViewProjection * modelMatrix * vec4(vertexPosition, 1.0);
+
+ normal = normalize(modelViewNormal * vertexNormal);
+ position = vec3(modelView * vec4(vertexPosition, 1.0));
+
+ gl_Position = mvp * vec4(vertexPosition, 1.0);
+}