Sha256: f35e09ede4ccd843d7cf1070011d3241724e012ba09aab6b94b870b5b6dd805d

Contents?: true

Size: 734 Bytes

Versions: 13

Compression:

Stored size: 734 Bytes

Contents

#version 330

uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform float rotation;
uniform vec2 scale;
uniform vec2 uvOffset;
uniform vec2 uvScale;

in vec2 position;
in vec2 uv;

out vec2 vUV;

void main() {
  vUV = uvOffset + uv * uvScale;

  vec2 alignedPosition = position * scale;

  vec2 rotatedPosition;
  rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
  rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;

  vec4 finalPosition;

  finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
  finalPosition.xy += rotatedPosition;
  finalPosition = projectionMatrix * finalPosition;

  gl_Position = finalPosition;
}

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
mittsu-opengl-0.5.1 lib/mittsu/opengl/plugins/sprite_vertex.glsl
mittsu-0.4.1 lib/mittsu/renderers/opengl/plugins/sprite_vertex.glsl
mittsu-opengl-0.5.0 lib/mittsu/opengl/plugins/sprite_vertex.glsl
mittsu-0.4.0 lib/mittsu/renderers/opengl/plugins/sprite_vertex.glsl
mittsu-0.3.3 lib/mittsu/renderers/opengl/plugins/sprite_vertex.glsl
mittsu-0.3.2 lib/mittsu/renderers/opengl/plugins/sprite_vertex.glsl
mittsu-0.3.1 lib/mittsu/renderers/opengl/plugins/sprite_vertex.glsl
mittsu-0.3.0 lib/mittsu/renderers/opengl/plugins/sprite_vertex.glsl
mittsu-0.2.4 lib/mittsu/renderers/opengl/plugins/sprite_vertex.glsl
mittsu-0.2.3 lib/mittsu/renderers/opengl/plugins/sprite_vertex.glsl
mittsu-0.2.2 lib/mittsu/renderers/opengl/plugins/sprite_vertex.glsl
mittsu-0.2.1 lib/mittsu/renderers/opengl/plugins/sprite_vertex.glsl
mittsu-0.2.0 lib/mittsu/renderers/opengl/plugins/sprite_vertex.glsl