mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-29 08:52:06 +00:00
28 lines
628 B
GLSL
28 lines
628 B
GLSL
#version 330
|
|
|
|
precision mediump float;
|
|
|
|
// Input vertex attributes (from vertex shader)
|
|
varying vec2 fragTexCoord;
|
|
varying vec4 fragColor;
|
|
|
|
// Input uniform values
|
|
uniform sampler2D texture0;
|
|
uniform vec4 colDiffuse;
|
|
uniform float alpha;
|
|
|
|
// NOTE: Add here your custom variables
|
|
|
|
void main()
|
|
{
|
|
// Texel color fetching from texture sampler
|
|
vec4 texelColor = texture2D(texture0, fragTexCoord);
|
|
|
|
// Convert texel color to grayscale using NTSC conversion weights
|
|
|
|
texelColor.a = alpha;
|
|
|
|
gl_FragColor = texelColor;
|
|
// Calculate final fragment color
|
|
//gl_FragColor = vec4(gray, gray, gray, texelColor.a);
|
|
} |