Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Uniform vars */
- uniform float uniformAngle; /* Rotation angle */
- uniform vec2 rotationCenter; /* Rotation centre */
- /* Attribute vars */
- attribute vec2 position; /* Position */
- attribute vec2 texCoordIn; /* Texture coordinates */
- /* Texture coordinate, used by pixel shader */
- varying vec2 texCoord;
- /* Main shader function */
- void main()
- {
- /* Translate UVs to rotation origin, rotate, translate back */
- position = position - rotationCenter;
- position = mat2(cos(uniformAngle), sin(uniformAngle), -sin(uniformAngle), cos(uniformAngle)) * position;
- position = position + rotationCenter;
- /* Set position */
- gl_Position = vec4(position, 0.0, 1.0);
- /* Pass texCoord */
- texCoord = texCoordIn;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement