resources: enhance sprite_bullet shader
This commit is contained in:
parent
b57445900f
commit
dfc3b22d2e
1 changed files with 7 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue