Skip to content

Instantly share code, notes, and snippets.

@tomcashman
Created October 31, 2015 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomcashman/1375174c1403b867d55a to your computer and use it in GitHub Desktop.
Save tomcashman/1375174c1403b867d55a to your computer and use it in GitHub Desktop.
LibGDX Default 2D Vertex Shader
// Based on https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/SpriteBatch.java#L127
// Licensed under the LibGDX license: https://github.com/libgdx/libgdx/blob/master/LICENSE
attribute vec4 a_position;
attribute vec4 a_color;
attribute vec2 a_texCoord0;
uniform mat4 u_projTrans;
varying vec4 v_color;
varying vec2 v_texCoords;
void main()
{
v_color = a_color;
v_color.a = v_color.a * (255.0/254.0);
v_texCoords = a_texCoord0;
gl_Position = u_projTrans * a_position;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment