Skip to content
Snippets Groups Projects
Unverified Commit 24765f10 authored by TheJackiMonster's avatar TheJackiMonster
Browse files

Normalized event colors and adjusted blending function

parent 9a29205b
No related branches found
No related tags found
1 merge request!106Created initial firework project
...@@ -122,7 +122,7 @@ void main() { ...@@ -122,7 +122,7 @@ void main() {
direction = events[event_id].direction; direction = events[event_id].direction;
} }
vec3 color = events[event_id].color; vec3 color = normalize(events[event_id].color);
const float v = events[event_id].velocity; const float v = events[event_id].velocity;
vec3 velocity = vec3(0.0f); vec3 velocity = vec3(0.0f);
......
...@@ -19,9 +19,12 @@ float smokeDensity(float size) { ...@@ -19,9 +19,12 @@ float smokeDensity(float size) {
} }
vec4 smokeBlend(vec4 dst, vec4 src) { vec4 smokeBlend(vec4 dst, vec4 src) {
const float f = max(1.0f - dst.a, 0.0f);
const float a = clamp(0.0f, 1.0f, src.a);
return vec4( return vec4(
dst.rgb + src.rgb * src.a * (1.0f - dst.a), dst.rgb + src.rgb * a * f,
dst.a + src.a * (1.0f - dst.a) dst.a + a * f
); );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment