2 * Copyright (C) 2021-2024 Mt.ZERO Software, Harry Godden - All Rights Reserved
7 #define WORLD_CUBEMAP_RES 32
9 #include "vg/vg_camera.h"
11 #include "shaders/scene_standard.h"
12 #include "shaders/scene_standard_alphatest.h"
13 #include "shaders/scene_foliage.h"
14 #include "shaders/scene_override.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 #include "shaders/model_sky_space.h"
25 static const float k_world_light_cube_size
= 8.0f
;
29 GLuint tex_terrain_noise
;
34 double sky_time
, sky_rate
, sky_target_rate
;
38 struct framebuffer fbreflect
, fbdepth
;
61 u32 text_particle_count
;
65 void world_render_init(void);
67 void world_prerender( world_instance
*world
);
68 void world_link_lighting_ub( world_instance
*world
, GLuint shader
);
69 void world_bind_position_texture( world_instance
*world
,
70 GLuint shader
, GLuint location
,
72 void world_bind_light_array( world_instance
*world
,
73 GLuint shader
, GLuint location
,
75 void world_bind_light_index( world_instance
*world
,
76 GLuint shader
, GLuint location
,
78 void render_world_position( world_instance
*world
, vg_camera
*cam
);
79 void render_world_depth( world_instance
*world
, vg_camera
*cam
);
80 void render_world( world_instance
*world
, vg_camera
*cam
,
81 int stenciled
, int viewing_from_gate
,
82 int with_water
, int with_cubemaps
);
83 void render_world_cubemaps( world_instance
*world
);
84 void bind_terrain_noise(void);
85 void render_world_override( world_instance
*world
,
86 world_instance
*lighting_source
,
89 ent_spawn
*dest_spawn
, v4f map_info
);
90 void render_world_gates( world_instance
*world
, vg_camera
*cam
);
91 void imgui_world_light_edit( world_instance
*world
);
93 #define WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( WORLD, SHADER ) \
94 world_link_lighting_ub( WORLD, _shader_##SHADER.id ); \
95 world_bind_position_texture( WORLD, _shader_##SHADER.id, \
96 _uniform_##SHADER##_g_world_depth, 2 ); \
97 world_bind_light_array( WORLD, _shader_##SHADER.id, \
98 _uniform_##SHADER##_uLightsArray, 3 ); \
99 world_bind_light_index( WORLD, _shader_##SHADER.id, \
100 _uniform_##SHADER##_uLightsIndex, 4 );