resources: enhance sprite_bullet shader

This commit is contained in:
Andrei Alexeyev 2023-07-17 00:58:14 +02:00
parent b57445900f
commit dfc3b22d2e
No known key found for this signature in database
GPG key ID: 72D26128040B9690

View file

@ -2,12 +2,15 @@
#include "lib/sprite_main.frag.glslh"
void spriteMain(out vec4 fragColor) {
vec4 texel = texture(tex, texCoord);
#include "lib/util.glslh"
if(texel.a == 0.0) {
void spriteMain(out vec4 fragColor) {
vec4 mask = texture(tex, texCoord);
if(mask.a == 0.0) {
discard;
}
fragColor = (color * texel.g + vec4(texel.b)) * customParams.r;
vec4 color2 = smoothstep(mask.g - 0.25, 1 + 0.5 * mask.r, 0.1 + 0.8 * color);
fragColor = (color * mask.g + mix(mask.r * color2, vec4(1.0), mask.b)) * customParams.r;
}