fix quality profile water/shadows
[carveJwlIkooP6JGAAIwe30JlM.git] / particle.h
1 #ifndef PARTICLE_H
2 #define PARTICLE_H
3
4 #include "skaterift.h"
5
6 typedef struct particle_system particle_system;
7 typedef struct particle particle;
8 typedef struct particle_vert particle_vert;
9
10 struct particle_system {
11 struct particle {
12 v3f co, v;
13 f32 life;
14 u32 colour;
15 }
16 *array;
17
18 #pragma pack(push,1)
19 struct particle_vert {
20 v3f co;
21 u32 colour;
22 }
23 *vertices;
24 #pragma pack(pop)
25
26 u32 alive, max;
27 GLuint vao, vbo, ebo;
28
29 /* render settings */
30 f32 scale, velocity_scale, width;
31 }
32 static particles_grind = {
33 .scale = 0.02f,
34 .velocity_scale = 0.001f,
35 .width = 0.0125f
36 },
37 particles_env = {
38 .scale = 0.04f,
39 .velocity_scale = 0.001f,
40 .width = 0.25f
41 };
42
43 static void particle_alloc( particle_system *sys, u32 max );
44 static void particle_system_update( particle_system *sys, f32 dt );
45 static void particle_system_debug( particle_system *sys );
46 static void particle_system_prerender( particle_system *sys );
47 static void particle_system_render( particle_system *sys, camera *cam );
48
49 static void particle_spawn( particle_system *sys,
50 v3f co, v3f v, f32 lifetime, u32 colour );
51 static void particle_spawn_cone( particle_system *sys,
52 v3f co, v3f dir, f32 angle, f32 speed,
53 f32 lifetime, u32 colour );
54
55 #include "shaders/particle.h"
56
57 #endif /* PARTICLE_H */