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