Skip to content

Instantly share code, notes, and snippets.

@numberZero
Created August 10, 2018 12:52
Show Gist options
  • Save numberZero/8f27ec3a1071462551a62aee2b309eca to your computer and use it in GitHub Desktop.
Save numberZero/8f27ec3a1071462551a62aee2b309eca to your computer and use it in GitHub Desktop.
Trivial shaders for Minetest
uniform sampler2D baseTexture;
void main(void)
{
vec2 uv = gl_TexCoord[0].st;
vec4 base = texture2D(baseTexture, uv);
gl_FragColor = vec4(base.rgb * gl_Color.rgb, base.a);
}
uniform mat4 mWorldViewProj;
varying vec3 vPosition;
varying vec3 worldPosition;
void main(void)
{
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = mWorldViewProj * gl_Vertex;
vec4 color;
color.rgb = clamp(2.0 * gl_Color.rgb, 0.0, 1.0);
color.a = 1;
gl_FrontColor = gl_BackColor = color;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment