Shaders

Code of the vertex and fragment shaders of MrSnugglekins

Code of All Shaders for GLSL Version 1.1

//  by Max Foster
// License : http://creativecommons.org/licenses/by/3.0/

// alternate_texture_fragment_shader.fs
#version 110

varying vec3 fragAmbientColor;
varying vec3 fragDiffuseColor;
varying vec3 fragSpecularColor;
varying vec2 fragTexCoords;
varying float fragMtlNum;
varying float fragHasTexture;
varying float fragShininess;
varying float fragAlpha;

uniform sampler2D colorMap;
uniform sampler2D alternateColorMap;
uniform int useAlternateTexture;
uniform vec4 tint;
uniform int materialCount;

void main(void) {
  gl_FragColor = vec4(fragAmbientColor, fragAlpha)*0.8;
  gl_FragColor += vec4(fragDiffuseColor, fragAlpha);

  vec4 tempColor = mix(texture2D(colorMap, vec2(((1.0/float(materialCount))*fragTexCoords.s)+((1.0/float(materialCount))*fragMtlNum), fragTexCoords.t)), texture2D(alternateColorMap, vec2(((1.0/float(materialCount))*fragTexCoords.s)+((1.0/float(materialCount))*fragMtlNum), fragTexCoords.t)), float(useAlternateTexture));
  gl_FragColor *= mix(vec4(1.0), tempColor, fragHasTexture);
  gl_FragColor *= tint;

  /*if (bool(int(fragHasTexture))) {
    vec4 colorToUse;
    if (bool(useAlternateTexture)) colorToUse = texture2D(alternateColorMap, vec2(((1.0/float(materialCount))*fragTexCoords.s)+((1.0/float(materialCount))*fragMtlNum), fragTexCoords.t)); else colorToUse = texture2D(colorMap, vec2(((1.0/float(materialCount))*fragTexCoords.s)+((1.0/float(materialCount))*fragMtlNum), fragTexCoords.t));
    gl_FragColor *= colorToUse;
    gl_FragColor *= tint;
  }*/
}

// dissolve_fragment_shader.fs
#version 110

varying vec3 fragAmbientColor;
varying vec3 fragDiffuseColor;
varying vec3 fragSpecularColor;
varying vec2 fragTexCoords;
varying float fragMtlNum;
varying float fragHasTexture;
varying float fragShininess;
varying float fragAlpha;

uniform sampler2D colorMap;
uniform sampler2D dissolveMap;
uniform float percentage;
uniform int materialCount;

void main(void) {
  gl_FragColor = vec4(fragAmbientColor, fragAlpha)*0.8;
  gl_FragColor += vec4(fragDiffuseColor, fragAlpha);
  gl_FragColor = texture2D(colorMap, vec2(((1.0/float(materialCount))*fragTexCoords.s)+((1.0/float(materialCount))*fragMtlNum), fragTexCoords.t));
  vec4 tempFragColor = texture2D(dissolveMap, fragTexCoords.st);
  tempFragColor.r += percentage;
  if (tempFragColor.r > 0.9) discard; else if (tempFragColor.r > 0.8) gl_FragColor = vec4(tempFragColor.r-0.5, tempFragColor.r-0.5, 1.0, 1.0);
}

// drain_horizontal_fragment_shader.fs

#version 110
#extension GL_ARB_texture_rectangle : enable

varying vec2 texCoords;

uniform sampler2DRect colorMap;
uniform vec4 color;
uniform float cutoff;

void main(void) {
  if (texCoords.s < cutoff) discard;
  gl_FragColor = texture2DRect(colorMap, texCoords);
  if (gl_FragColor == vec4(0.0, 0.0, 0.0, 0.0)) discard;
  gl_FragColor *= color;
}

// drain_vertical_fragment_shader.fs
#version 110
#extension GL_ARB_texture_rectangle : enable

varying vec2 texCoords;

uniform sampler2DRect colorMap;
uniform vec4 color;
uniform float cutoff;

void main(void) {
  if (texCoords.t < cutoff) discard;
  gl_FragColor = texture2DRect(colorMap, texCoords);
  if (gl_FragColor == vec4(0.0, 0.0, 0.0, 0.0)) discard;
  gl_FragColor *= color;
}

// font_fragment_shader.fs
#version 110
#extension GL_ARB_texture_rectangle : enable

varying vec2 texCoords;

uniform sampler2DRect colorMap;
uniform vec4 color;

void main(void) {
  gl_FragColor = texture2DRect(colorMap, texCoords);
  if (gl_FragColor == vec4(0.0, 0.0, 0.0, 0.0)) discard;
  gl_FragColor *= color;
}

// line_fragment_shader.fs
#version 110

uniform vec4 color;

void main(void) {
  gl_FragColor = color;
}

// model_fragment_shader.fs
#version 110

varying vec3 fragAmbientColor;
varying vec3 fragDiffuseColor;
varying vec3 fragSpecularColor;
varying vec2 fragTexCoords;
varying float fragMtlNum;
varying float fragHasTexture;
varying float fragShininess;
varying float fragAlpha;

uniform sampler2D colorMap;
uniform int materialCount;

void main(void) {
  gl_FragColor = vec4(fragDiffuseColor.rgb, 1.0);
  gl_FragColor *= mix(vec4(1.0), texture2D(colorMap, vec2(fragTexCoords.s, fragTexCoords.t)), fragHasTexture);
  //if (bool(int(fragHasTexture))) gl_FragColor *= texture2D(colorMap, vec2(fragTexCoords.s, fragTexCoords.t));
}

// shadow_fragment_shader.fs
#version 110
#extension GL_ARB_texture_rectangle : enable

varying vec2 texCoords;

uniform sampler2DRect colorMap;

void main(void) {
  gl_FragColor = texture2DRect(colorMap, texCoords);
  if (gl_FragColor.a >= 0.2) gl_FragColor.a -= 0.2;
  if (gl_FragColor == vec4(0, 0, 0, 0)) discard;
}

// skeleton_fragment_shader.fs
#version 110

varying vec3 fragAmbientColor;
varying vec3 fragDiffuseColor;
varying vec3 fragSpecularColor;
varying vec2 fragTexCoords;
varying float fragMtlNum;
varying float fragHasTexture;
varying float fragShininess;
varying float fragAlpha;

uniform sampler2D colorMap;
uniform int materialCount;

void main(void) {
  gl_FragColor = vec4(fragAmbientColor, fragAlpha)*0.8;
  gl_FragColor += vec4(fragDiffuseColor, fragAlpha);
  gl_FragColor *= mix(vec4(1.0), texture2D(colorMap, vec2(((1.0/float(materialCount))*fragTexCoords.s)+((1.0/float(materialCount))*fragMtlNum), fragTexCoords.t)), fragHasTexture);
  //if (bool(int(fragHasTexture))) gl_FragColor *= texture2D(colorMap, vec2(((1.0/float(materialCount))*fragTexCoords.s)+((1.0/float(materialCount))*fragMtlNum), fragTexCoords.t));
}

// sprite_fragment_shader.fs
#version 110
#extension GL_ARB_texture_rectangle : enable

varying vec2 texCoords;

uniform sampler2DRect colorMap;

void main(void) {
  gl_FragColor = texture2DRect(colorMap, texCoords);
  if (gl_FragColor == vec4(0, 0, 0, 0)) discard;
}

// tint_and_wear_fragment_shader.fs
#version 110

varying vec3 fragAmbientColor;
varying vec3 fragDiffuseColor;
varying vec3 fragSpecularColor;
varying vec2 fragTexCoords;
varying float fragMtlNum;
varying float fragHasTexture;
varying float fragShininess;
varying float fragAlpha;

uniform sampler2D colorMap;
uniform vec4 tint;
uniform sampler2D wearMap;
uniform int severeWear;
uniform int materialCount;

void main(void) {
  gl_FragColor = vec4(fragAmbientColor, fragAlpha)*0.8;
  gl_FragColor += vec4(fragDiffuseColor, fragAlpha);
  gl_FragColor *= texture2D(colorMap, vec2(((1.0/float(materialCount))*fragTexCoords.s)+((1.0/float(materialCount))*fragMtlNum), fragTexCoords.t));
  gl_FragColor *= tint;
  gl_FragColor *= texture2D(wearMap, fragTexCoords.st);
  if (texture2D(wearMap, fragTexCoords.st).r < 0.5*float(severeWear)) discard;
}

// tint_fragment_shader.fs
#version 110

varying vec3 fragAmbientColor;
varying vec3 fragDiffuseColor;
varying vec3 fragSpecularColor;
varying vec2 fragTexCoords;
varying float fragMtlNum;
varying float fragHasTexture;
varying float fragShininess;
varying float fragAlpha;

uniform sampler2D colorMap;
uniform vec4 tint;
uniform int materialCount;

void main(void) {
  gl_FragColor = vec4(fragAmbientColor, fragAlpha)*0.8;
  gl_FragColor += vec4(fragDiffuseColor, fragAlpha);
  gl_FragColor *= mix(vec4(1.0), texture2D(colorMap, vec2(((1.0/float(materialCount))*fragTexCoords.s)+((1.0/float(materialCount))*fragMtlNum), fragTexCoords.t)), fragHasTexture);
  //if (bool(int(fragHasTexture))) gl_FragColor *= texture2D(colorMap, vec2(((1.0/float(materialCount))*fragTexCoords.s)+((1.0/float(materialCount))*fragMtlNum), fragTexCoords.t));
  gl_FragColor *= tint;
}

// line_vertex_shader.vs
#version 110

attribute vec4 vertex;

uniform mat4 modelviewMatrix;
uniform mat4 projectionMatrix;

void main(void) {
  gl_Position = projectionMatrix*(modelviewMatrix*vertex);
}

// model_vertex_shader.vs
#version 110

attribute vec4 vertex;
attribute vec3 normal;
attribute vec3 ambientColor;
attribute vec3 diffuseColor;
attribute vec3 specularColor;
attribute vec3 texCoords;
attribute float mtlNum;
attribute float hasTexture;
attribute float shininess;
attribute float alpha;

varying vec3 fragAmbientColor;
varying vec3 fragDiffuseColor;
varying vec3 fragSpecularColor;
varying vec2 fragTexCoords;
varying float fragMtlNum;
varying float fragHasTexture;
varying float fragShininess;
varying float fragAlpha;

uniform mat4 modelviewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 jointModelviewMatrix;

void main(void) {
  fragAmbientColor = ambientColor;
  fragDiffuseColor = diffuseColor;
  fragSpecularColor = specularColor;
  fragTexCoords = texCoords.st;
  fragMtlNum = mtlNum;
  fragHasTexture = hasTexture;
  fragShininess = shininess;
  fragAlpha = alpha;

  gl_Position = projectionMatrix*(modelviewMatrix*vec4(vertex.xyz, 1.0));
}

// skeleton_line_vertex_shader.vs
#version 110

attribute vec4 vertex;

uniform mat4 modelviewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 jointModelviewMatrix;

void main(void) {
  vec4 vertexToUse = vec4(vertex.xyz, 1.0);
  mat4 matrixToUse = (modelviewMatrix*(1.0-vertex.w))+(jointModelviewMatrix*vertex.w);
  vec4 vertexPos = matrixToUse*vertexToUse;
  gl_Position = projectionMatrix*vertexPos;
}

// skeleton_vertex_shader.vs
#version 110

attribute vec4 vertex;
attribute vec3 normal;
attribute vec3 ambientColor;
attribute vec3 diffuseColor;
attribute vec3 specularColor;
attribute vec3 texCoords;
attribute float mtlNum;
attribute float hasTexture;
attribute float shininess;
attribute float alpha;

varying vec3 fragAmbientColor;
varying vec3 fragDiffuseColor;
varying vec3 fragSpecularColor;
varying vec2 fragTexCoords;
varying float fragMtlNum;
varying float fragHasTexture;
varying float fragShininess;
varying float fragAlpha;

uniform mat4 modelviewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 jointModelviewMatrix;

void main(void) {
  vec4 vertexToUse = vec4(vertex.xyz, 1.0);
  mat4 matrixToUse = (modelviewMatrix*(1.0-vertex.w))+(jointModelviewMatrix*vertex.w);
  vec4 vertexPos = matrixToUse*vertexToUse;
  vec3 surfaceNormal = vec3(matrixToUse*vec4(normal, 0.0));
  float diff = max(0.0, dot(normalize(surfaceNormal), normalize(vec3(0.0, 100.0, 0.0))));

  fragAmbientColor = ambientColor;
  fragDiffuseColor = diffuseColor*diff;
  fragSpecularColor = specularColor;
  fragTexCoords = texCoords.st;
  fragMtlNum = mtlNum;
  fragHasTexture = hasTexture;
  fragShininess = shininess;
  fragAlpha = alpha;

  gl_Position = projectionMatrix*vertexPos;
}

// sprite_vertex_shader.vs
#version 110

attribute vec4 vertex;

varying vec2 texCoords;

uniform mat4 modelviewMatrix;
uniform mat4 projectionMatrix;

void main(void) {
  texCoords = vertex.xy;
  gl_Position = projectionMatrix*(modelviewMatrix*vertex);
}

    

Code of All Shaders for GLSL Versions >= 1.5

//  by Max Foster
// License : http://creativecommons.org/licenses/by/3.0/

// alternate_texture_fragment_shader.fs
#version 150

flat in vec3 fragAmbientColor;
smooth in vec3 fragDiffuseColor;
flat in vec3 fragSpecularColor;
smooth in vec2 fragTexCoords;
flat in float fragMtlNum;
flat in int fragHasTexture;
flat in float fragShininess;
flat in float fragAlpha;

out vec4 fragColor;

uniform sampler2DArray colorMap;
uniform sampler2DArray alternateColorMap;
uniform int useAlternateTexture;
uniform vec4 tint;

void main(void) {
  fragColor = vec4(fragAmbientColor, fragAlpha)*0.8;
  fragColor += vec4(fragDiffuseColor, fragAlpha);

  vec4 tempColor = mix(texture2DArray(colorMap, vec3(fragTexCoords.st, fragMtlNum)), texture2DArray(alternateColorMap, vec3(fragTexCoords.st, fragMtlNum)), useAlternateTexture);
  fragColor *= mix(vec4(1.0), tempColor, fragHasTexture);
  fragColor *= tint;

  /*if (bool(fragHasTexture)) {
    vec4 colorToUse;
    if (bool(useAlternateTexture)) colorToUse = texture2DArray(alternateColorMap, vec3(fragTexCoords.st, fragMtlNum)); else colorToUse = texture2DArray(colorMap, vec3(fragTexCoords.st, fragMtlNum));
    fragColor *= colorToUse;
    fragColor *= tint;
  }*/
}

// dissolve_fragment_shader.fs
#version 150

flat in vec3 fragAmbientColor;
smooth in vec3 fragDiffuseColor;
flat in vec3 fragSpecularColor;
smooth in vec2 fragTexCoords;
flat in float fragMtlNum;
flat in int fragHasTexture;
flat in float fragShininess;
flat in float fragAlpha;

out vec4 fragColor;

uniform sampler2DArray colorMap;
uniform sampler2D dissolveMap;
uniform float percentage;

void main(void) {
  fragColor = vec4(fragAmbientColor, fragAlpha)*0.8;
  fragColor += vec4(fragDiffuseColor, fragAlpha);
  fragColor = texture2DArray(colorMap, vec3(fragTexCoords.st, fragMtlNum));
  vec4 tempFragColor = texture2D(dissolveMap, fragTexCoords.st);
  tempFragColor.r += percentage;
  if (tempFragColor.r > 0.9) discard; else if (tempFragColor.r > 0.8) fragColor = vec4(tempFragColor.r-0.5, tempFragColor.r-0.5, 1.0, 1.0);
}

// drain_horizontal_fragment_shader.fs
#version 150

smooth in vec2 texCoords;

out vec4 fragColor;

uniform sampler2DRect colorMap;
uniform vec4 color;
uniform float cutoff;

void main(void) {
  if (texCoords.s < cutoff) discard;
  fragColor = texture2DRect(colorMap, texCoords);
  if (fragColor == vec4(0.0, 0.0, 0.0, 0.0)) discard;
  fragColor *= color;
}


// drain_vertical_fragment_shader.fs
#version 150

smooth in vec2 texCoords;

out vec4 fragColor;

uniform sampler2DRect colorMap;
uniform vec4 color;
uniform float cutoff;

void main(void) {
  if (texCoords.t < cutoff) discard;
  fragColor = texture2DRect(colorMap, texCoords);
  if (fragColor == vec4(0.0, 0.0, 0.0, 0.0)) discard;
  fragColor *= color;
}


// font_fragment_shader.fs
#version 150

smooth in vec2 texCoords;

out vec4 fragColor;

uniform sampler2DRect colorMap;
uniform vec4 color;

void main(void) {
  fragColor = texture2DRect(colorMap, texCoords);
  if (fragColor == vec4(0.0, 0.0, 0.0, 0.0)) discard;
  fragColor *= color;
}


// line_fragment_shader.fs
#version 150

out vec4 fragColor;

uniform vec4 color;

void main(void) {
  fragColor = color;
}

// model_fragment_shader.fs
#version 150

flat in vec3 fragAmbientColor;
flat in vec3 fragDiffuseColor;
flat in vec3 fragSpecularColor;
smooth in vec2 fragTexCoords;
flat in int fragMtlNum;
flat in int fragHasTexture;
flat in float fragShininess;
flat in float fragAlpha;

out vec4 fragColor;

uniform sampler2DArray colorMap;

void main(void) {
  fragColor = vec4(fragDiffuseColor.rgb, 1.0);
  fragColor *= mix(vec4(1.0), texture2DArray(colorMap, vec3(fragTexCoords, 0.0)), fragHasTexture);
  //if (bool(fragHasTexture)) fragColor *= texture2DArray(colorMap, vec3(fragTexCoords, 0));
}

// shadow_fragment_shader.fs
#version 150

smooth in vec2 texCoords;

out vec4 fragColor;

uniform sampler2DRect colorMap;

void main(void) {
  fragColor = texture2DRect(colorMap, texCoords);
  if (fragColor.a >= 0.2) fragColor.a -= 0.2;
  if (fragColor == vec4(0, 0, 0, 0)) discard;
}

// skeleton_fragment_shader.fs
#version 150

flat in vec3 fragAmbientColor;
smooth in vec3 fragDiffuseColor;
flat in vec3 fragSpecularColor;
smooth in vec2 fragTexCoords;
flat in float fragMtlNum;
flat in int fragHasTexture;
flat in float fragShininess;
flat in float fragAlpha;

out vec4 fragColor;

uniform sampler2DArray colorMap;

void main(void) {
  fragColor = vec4(fragAmbientColor, fragAlpha)*0.8;
  fragColor += vec4(fragDiffuseColor, fragAlpha);
  fragColor *= mix(vec4(1.0), texture2DArray(colorMap, vec3(fragTexCoords.st, fragMtlNum)), fragHasTexture);
  //if (fragHasTexture == 1) fragColor *= texture2DArray(colorMap, vec3(fragTexCoords.st, fragMtlNum));
}

// sprite_fragment_shader.fs
#version 150

smooth in vec2 texCoords;

out vec4 fragColor;

uniform sampler2DRect colorMap;

void main(void) {
  fragColor = texture2DRect(colorMap, texCoords);
  if (fragColor == vec4(0, 0, 0, 0)) discard;
}

// tint_and_wear_fragment_shader.fs
#version 150

flat in vec3 fragAmbientColor;
smooth in vec3 fragDiffuseColor;
flat in vec3 fragSpecularColor;
smooth in vec2 fragTexCoords;
flat in float fragMtlNum;
flat in int fragHasTexture;
flat in float fragShininess;
flat in float fragAlpha;

out vec4 fragColor;

uniform sampler2DArray colorMap;
uniform vec4 tint;
uniform sampler2D wearMap;
uniform int severeWear;

void main(void) {
  fragColor = vec4(fragAmbientColor, fragAlpha)*0.8;
  fragColor += vec4(fragDiffuseColor, fragAlpha);
  fragColor *= texture2DArray(colorMap, vec3(fragTexCoords.st, fragMtlNum));
  fragColor *= tint;
  fragColor *= texture2D(wearMap, fragTexCoords.st);
  if (texture2D(wearMap, fragTexCoords.st).r < 0.5*severeWear) discard;
}

// tint_fragment_shader.fs
#version 150

flat in vec3 fragAmbientColor;
smooth in vec3 fragDiffuseColor;
flat in vec3 fragSpecularColor;
smooth in vec2 fragTexCoords;
flat in float fragMtlNum;
flat in int fragHasTexture;
flat in float fragShininess;
flat in float fragAlpha;

out vec4 fragColor;

uniform sampler2DArray colorMap;
uniform vec4 tint;

void main(void) {
  fragColor = vec4(fragAmbientColor, fragAlpha)*0.8;
  fragColor += vec4(fragDiffuseColor, fragAlpha);
  fragColor *= mix(vec4(1.0), texture2DArray(colorMap, vec3(fragTexCoords.st, fragMtlNum)), fragHasTexture);
  //if (bool(fragHasTexture)) fragColor *= texture2DArray(colorMap, vec3(fragTexCoords.st, fragMtlNum));
  fragColor *= tint;
}


// line_vertex_shader.vs
#version 150

in vec4 vertex;

uniform mat4 modelviewMatrix;
uniform mat4 projectionMatrix;

void main(void) {
  gl_Position = projectionMatrix*(modelviewMatrix*vertex);
}

// model_vertex_shader.vs
#version 150

in vec4 vertex;
in vec3 normal;
in vec3 ambientColor;
in vec3 diffuseColor;
in vec3 specularColor;
in vec3 texCoords;
in float mtlNum;
in float hasTexture;
in float shininess;
in float alpha;

flat out vec3 fragAmbientColor;
flat out vec3 fragDiffuseColor;
flat out vec3 fragSpecularColor;
smooth out vec2 fragTexCoords;
flat out int fragMtlNum;
flat out int fragHasTexture;
flat out float fragShininess;
flat out float fragAlpha;

uniform mat4 modelviewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 jointModelviewMatrix;

void main(void) {
  fragAmbientColor = ambientColor;
  fragDiffuseColor = diffuseColor;
  fragSpecularColor = specularColor;
  fragTexCoords = texCoords.st;
  fragMtlNum = int(mtlNum);
  fragHasTexture = int(hasTexture);
  fragShininess = shininess;
  fragAlpha = alpha;

  gl_Position = projectionMatrix*(modelviewMatrix*vec4(vertex.xyz, 1.0));
}

// skeleton_line_vertex_shader.vs
#version 150

in vec4 vertex;

uniform mat4 modelviewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 jointModelviewMatrix;

void main(void) {
  vec4 vertexToUse = vec4(vertex.xyz, 1.0);
  mat4 matrixToUse = (modelviewMatrix*(1.0-vertex.w))+(jointModelviewMatrix*vertex.w);
  vec4 vertexPos = matrixToUse*vertexToUse;
  gl_Position = projectionMatrix*vertexPos;
}

// skeleton_vertex_shader.vs
#version 150

in vec4 vertex;
in vec3 normal;
in vec3 ambientColor;
in vec3 diffuseColor;
in vec3 specularColor;
in vec3 texCoords;
in float mtlNum;
in float hasTexture;
in float shininess;
in float alpha;

flat out vec3 fragAmbientColor;
smooth out vec3 fragDiffuseColor;
flat out vec3 fragSpecularColor;
smooth out vec2 fragTexCoords;
flat out float fragMtlNum;
flat out int fragHasTexture;
flat out float fragShininess;
flat out float fragAlpha;

uniform mat4 modelviewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 jointModelviewMatrix;

void main(void) {
  vec4 vertexToUse = vec4(vertex.xyz, 1.0);
  mat4 matrixToUse = (modelviewMatrix*(1.0-vertex.w))+(jointModelviewMatrix*vertex.w);
  vec4 vertexPos = matrixToUse*vertexToUse;
  vec3 surfaceNormal = vec3(matrixToUse*vec4(normal, 0.0));
  float diff = max(0.0, dot(normalize(surfaceNormal), normalize(vec3(0.0, 100.0, 0.0))));

  fragAmbientColor = ambientColor;
  fragDiffuseColor = diffuseColor*diff;
  fragSpecularColor = specularColor;
  fragTexCoords = texCoords.st;
  fragMtlNum = mtlNum;
  fragHasTexture = int(hasTexture);
  fragShininess = shininess;
  fragAlpha = alpha;

  gl_Position = projectionMatrix*vertexPos;
}

// sprite_vertex_shader.vs
#version 150

in vec4 vertex;

smooth out vec2 texCoords;

uniform mat4 modelviewMatrix;
uniform mat4 projectionMatrix;

void main(void) {
  texCoords = vertex.xy;
  gl_Position = projectionMatrix*(modelviewMatrix*vertex);
}


    
Programming - a skill for life!

by Max Foster: L6 Age ~17