anchor.diff:              [Constants.Render.GlslVersionPragma
                "#define VERTS 6"
                "uniform mat4 viewProjection;"
  -             "uniform vec2 positions[" + string Constants.Render.SpriteBatchSize + " * VERTS];"
  +             "uniform vec4 perimeters[" + string Constants.Render.SpriteBatchSize + "];"
  +             "uniform vec2 centers[" + string Constants.Render.SpriteBatchSize + "];"
  +             "uniform float rotations[" + string Constants.Render.SpriteBatchSize + "];"
                "uniform vec4 texCoordses[" + string Constants.Render.SpriteBatchSize + "];"
                "uniform vec4 colors[" + string Constants.Render.SpriteBatchSize + "];"
                "out vec2 texCoords;"
                "out vec4 color;"
  +             ""
  +             "vec2 rotate(vec2 v, float a)"
  +             "{"
  +             "  float s = sin(a);"
  +             "  float c = cos(a);"
  +             "  mat2 m = mat2(c, -s, s, c);"
  +             "  return m * v;"
  +             "}"
  +             ""
                "void main()"
                "{"
                "  int spriteId = gl_VertexID / VERTS;"
                "  int vertexId = gl_VertexID % VERTS;"
  -             "  vec2 position = positions[gl_VertexID];"
  -             "  gl_Position = viewProjection * vec4(position.x, position.y, 0, 1);"
  +             "  vec2 position;"
  +             "  vec4 perimeter = perimeters[spriteId];"
  +             "  vec2 center = centers[spriteId];"
  +             "  float rotation = rotations[spriteId];"
                "  vec4 texCoords4 = texCoordses[spriteId];"
                "  switch (vertexId)"
                "  {"
  -             "      case 0: case 4: texCoords = vec2(texCoords4.x, texCoords4.y); break;"
  -             "      case 1:         texCoords = vec2(texCoords4.x + texCoords4.z, texCoords4.y); break;"
  -             "      case 2: case 5: texCoords = vec2(texCoords4.x + texCoords4.z, texCoords4.y + texCoords4.w); break;"
  -             "      case 3:         texCoords = vec2(texCoords4.x, texCoords4.y + texCoords4.w); break;"
  +             "      case 0: case 4:"
  +             "          position = vec2(perimeter.x, perimeter.y);"
  +             "          texCoords = vec2(texCoords4.x, texCoords4.y);"
  +             "          break;"
  +             "      case 1:"
  +             "          position = vec2(perimeter.x + perimeter.z, perimeter.y);"
  +             "          texCoords = vec2(texCoords4.x + texCoords4.z, texCoords4.y);"
  +             "          break;"
  +             "      case 2: case 5:"
  +             "          position = vec2(perimeter.x + perimeter.z, perimeter.y + perimeter.w);"
  +             "          texCoords = vec2(texCoords4.x + texCoords4.z, texCoords4.y + texCoords4.w);"
  +             "          break;"
  +             "      case 3:"
  +             "          position = vec2(perimeter.x, perimeter.y + perimeter.w);"
  +             "          texCoords = vec2(texCoords4.x, texCoords4.y + texCoords4.w);"
  +             "          break;"
                "  }"
  +             "  vec2 positionRotated = center + rotate(position - center, rotation);"
  +             "  gl_Position = viewProjection * vec4(positionRotated.x, positionRotated.y, 0, 1);"
                "  color = colors[spriteId];"
                "}"] |> String.join "\n"
   
  
positive.code:               mutable ViewProjectionAbsolute : Matrix4x4
                mutable ViewProjectionRelative : Matrix4x4
                ViewProjectionUniform : int
                PositionsUniform : int
                TexCoordsesUniform : int
                ColorsUniform : int
                TexUniform : int
                Shader : uint
                Positions : single array
                TexCoordses : single array
                Colors : single array
                Vao : uint
  
negative.code: 
              // setup shader
              OpenGL.Gl.UseProgram env.Shader
              OpenGL.Gl.UniformMatrix4f (env.ViewProjectionUniform, 1, false, if env.State.Absolute then env.ViewProjectionAbsolute else env.ViewProjectionRelative)
              OpenGL.Gl.Uniform4 (env.PerimetersUniform, env.Perimeters)
              OpenGL.Gl.Uniform4 (env.TexCoordsesUniform, env.TexCoordses)
              OpenGL.Gl.Uniform2 (env.CentersUniform, env.Centers)
              OpenGL.Gl.Uniform1 (env.RotationsUniform, env.Rotations)
              OpenGL.Gl.Uniform4 (env.ColorsUniform, env.Colors)
              OpenGL.Gl.Uniform1i (env.TexUniform, 1, 0)
              OpenGL.Gl.ActiveTexture OpenGL.TextureUnit.Texture0
              OpenGL.Gl.BindTexture (OpenGL.TextureTarget.Texture2d, env.State.Texture)
              OpenGL.Gl.BlendEquation env.State.BlendingEquation
              OpenGL.Gl.BlendFunc (env.State.BlendingFactorSrc, env.State.BlendingFactorDst)
              OpenGL.Hl.Assert ()
  
  