diff --git a/data/shader/flame.gsh b/data/shader/flame.gsh index a5962bc..97ea9f5 100644 --- a/data/shader/flame.gsh +++ b/data/shader/flame.gsh @@ -4,35 +4,54 @@ uniform mat4 viewProjectionMatrix; uniform float time; layout(points) in; -layout(triangle_strip, max_vertices = 64) out; +layout(triangle_strip, max_vertices = 256) out; const float PI = 3.1415926; +const float transition_point = 1.178097; +const float sin_p1 = 0.4; +const float sin_p2 = 2; +const float ex_p1 = 1.093; +const float ex_p2 = 1.9996; +const float begin = 0; +const float end = 2.3; + +float radiusFunction(float x) { + if (x < transition_point) { + return sin_p1 * sin(sin_p2 * x); + } + else { + return exp(ex_p1 - ex_p2 * x); + } +} void main() { - float resolution = 5.0; - for (int i = 0; i