review save method
[carveJwlIkooP6JGAAIwe30JlM.git] / world_render.h
1 /*
2 * Copyright (C) 2021-2023 Mt.ZERO Software, Harry Godden - All Rights Reserved
3 */
4
5 #ifndef WORLD_RENDER_H
6 #define WORLD_RENDER_H
7
8 #include "camera.h"
9 #include "world.h"
10
11 #include "shaders/scene_standard.h"
12 #include "shaders/scene_standard_alphatest.h"
13 #include "shaders/scene_vertex_blend.h"
14 #include "shaders/scene_terrain.h"
15 #include "shaders/scene_fxglow.h"
16 #include "shaders/scene_depth.h"
17 #include "shaders/scene_position.h"
18 #include "shaders/model_sky.h"
19
20 static const float k_world_light_cube_size = 8.0f;
21
22 struct world_render{
23 GLuint tex_terrain_noise;
24
25 /* rendering */
26 glmesh skydome;
27
28 double sky_time, sky_rate, sky_target_rate;
29
30 /* water rendering */
31 struct{
32 struct framebuffer fbreflect, fbdepth;
33 }
34 water;
35
36 v3f render_gate_pos;
37 struct timer_text{
38 char text[8];
39 m4x3f transform;
40 ent_gate *gate;
41 ent_route *route;
42 }
43 timer_texts[4];
44 u32 timer_text_count;
45
46 struct text_particle{
47 rb_object obj;
48 m4x3f mlocal;
49 ent_glyph *glyph;
50 v4f colour;
51
52 m4x3f mdl;
53 }
54 text_particles[6*4];
55 u32 text_particle_count;
56 }
57 static world_render;
58 VG_STATIC void world_render_init(void);
59
60 VG_STATIC void world_link_lighting_ub( world_instance *world, GLuint shader );
61 VG_STATIC void world_bind_position_texture( world_instance *world,
62 GLuint shader, GLuint location,
63 int slot );
64 VG_STATIC void world_bind_light_array( world_instance *world,
65 GLuint shader, GLuint location,
66 int slot );
67 VG_STATIC void world_bind_light_index( world_instance *world,
68 GLuint shader, GLuint location,
69 int slot );
70 VG_STATIC void render_world_position( world_instance *world, camera *cam );
71 VG_STATIC void render_world_depth( world_instance *world, camera *cam );
72 VG_STATIC void render_world( world_instance *world, camera *cam,
73 int layer_depth );
74
75 #endif /* WORLD_RENDER_H */