Created
August 10, 2018 12:52
-
-
Save numberZero/8f27ec3a1071462551a62aee2b309eca to your computer and use it in GitHub Desktop.
Trivial shaders for Minetest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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