add FlatLumTexture.frag/FlatAlphaTexture.frag

This commit is contained in:
hyzboy 2020-08-04 02:22:35 +08:00
parent 8e31af94c8
commit f8af997de7
3 changed files with 36 additions and 0 deletions

BIN
screenshot/DrawText.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 KiB

View File

@ -0,0 +1,18 @@
#version 450 core
layout(binding = 2) uniform sampler2D tex;
layout(location = 0) in vec2 FragmentTexCoord;
layout(location = 0) out vec4 FragColor;
layout(binding = 1) uniform ColorMaterial
{
vec4 color;
} color_material;
void main()
{
float alpha=texture(tex,FragmentTexCoord).r;
FragColor=vec4(color_material.color.rgb,color_material.color.a*alpha);
}

View File

@ -0,0 +1,18 @@
#version 450 core
layout(binding = 2) uniform sampler2D tex;
layout(location = 0) in vec2 FragmentTexCoord;
layout(location = 0) out vec4 FragColor;
layout(binding = 1) uniform ColorMaterial
{
vec4 color;
} color_material;
void main()
{
float lum=texture(tex,FragmentTexCoord).r;
FragColor=vec4(color_material.color.rgb*lum,color_material.color.a);
}