2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2008-07-15 19:21:50 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2008, 2011 Martin Gräßlin <kde@martin-graesslin.com>
|
2008-07-15 19:21:50 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2013-05-21 08:18:00 +00:00
|
|
|
#version 140
|
2015-12-01 11:05:14 +00:00
|
|
|
uniform mat4 modelViewProjectionMatrix;
|
2008-07-15 19:21:50 +00:00
|
|
|
uniform float width;
|
|
|
|
uniform float cubeAngle;
|
|
|
|
uniform float xCoord;
|
2009-02-19 11:50:00 +00:00
|
|
|
uniform float timeLine;
|
2008-07-15 19:21:50 +00:00
|
|
|
|
2015-12-01 11:05:14 +00:00
|
|
|
in vec4 position;
|
|
|
|
in vec4 texcoord;
|
2011-01-09 20:20:36 +00:00
|
|
|
|
2015-12-01 11:05:14 +00:00
|
|
|
out vec2 texcoord0;
|
2011-01-09 20:20:36 +00:00
|
|
|
|
2008-07-15 19:21:50 +00:00
|
|
|
void main()
|
|
|
|
{
|
2015-12-01 11:05:14 +00:00
|
|
|
texcoord0 = texcoord.st;
|
|
|
|
vec4 transformedVertex = vec4(position.x - ( width - xCoord ), position.yzw);
|
2011-01-09 20:20:36 +00:00
|
|
|
float radian = radians(cubeAngle);
|
|
|
|
float radius = (width)*tan(radian);
|
|
|
|
float azimuthAngle = radians(transformedVertex.x/(width)*(90.0 - cubeAngle));
|
|
|
|
|
|
|
|
transformedVertex.x = width - xCoord + radius * sin( azimuthAngle );
|
2015-12-01 11:05:14 +00:00
|
|
|
transformedVertex.z = position.z + radius * cos( azimuthAngle ) - radius;
|
2011-01-09 20:20:36 +00:00
|
|
|
|
2015-12-01 11:05:14 +00:00
|
|
|
vec3 diff = (position.xyz - transformedVertex.xyz)*timeLine;
|
2011-01-09 20:20:36 +00:00
|
|
|
transformedVertex.xyz += diff;
|
|
|
|
|
2015-12-01 11:05:14 +00:00
|
|
|
gl_Position = modelViewProjectionMatrix*transformedVertex;
|
2008-07-15 19:21:50 +00:00
|
|
|
}
|