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