The flame shader now only turns on when facing an enemy. Next is tagging enemies with specific shaders to apply at a specific time.

This commit is contained in:
Zed A. Shaw 2025-04-16 00:02:27 -04:00
parent 5ffa3b0d1e
commit 1b4f55804c
6 changed files with 29 additions and 13 deletions

View file

@ -7,11 +7,11 @@
"file_name": "assets/shaders/ui_error.frag",
"type": "fragment"
},
"flame": {
"rayview_sprites": {
"file_name": "assets/shaders/rayview_sprites.frag",
"type": "fragment"
},
"rayview_sprites": {
"flame": {
"file_name": "assets/shaders/flame_trash.frag",
"type": "fragment"
}

View file

@ -1,6 +1,6 @@
uniform vec2 u_resolution;
uniform float u_time;
uniform sampler2D texture;
uniform sampler2D source;
uniform float u_mouse;
uniform float value = 0.2;
@ -69,9 +69,9 @@ void main() {
color *= (f*f*f+0.5*f*f+0.6*f) * value;
vec4 pixel = texture2D(texture, gl_TexCoord[0].xy);
vec4 pixel = texture2D(source, gl_TexCoord[0].xy);
float mask = color.r * pixel.a;
gl_FragColor = gl_Color * vec4(color, pixel.a) + pixel;
gl_FragColor = gl_Color * vec4(color, mask) + pixel;
}