2 * Copyright (C) 2021-2023 Mt.ZERO Software, Harry Godden - All Rights Reserved
8 #define WORLD_CUBEMAP_RES 32
13 #include "shaders/scene_standard.h"
14 #include "shaders/scene_standard_alphatest.h"
15 #include "shaders/scene_override.h"
16 #include "shaders/scene_cubemapped.h"
17 #include "shaders/scene_vertex_blend.h"
18 #include "shaders/scene_terrain.h"
19 #include "shaders/scene_fxglow.h"
20 #include "shaders/scene_depth.h"
21 #include "shaders/scene_position.h"
22 #include "shaders/scene_font.h"
23 #include "shaders/model_sky.h"
25 static const float k_world_light_cube_size
= 8.0f
;
28 GLuint tex_terrain_noise
;
33 double sky_time
, sky_rate
, sky_target_rate
;
37 struct framebuffer fbreflect
, fbdepth
;
60 u32 text_particle_count
;
63 static void world_render_init(void);
65 static void world_link_lighting_ub( world_instance
*world
, GLuint shader
);
66 static void world_bind_position_texture( world_instance
*world
,
67 GLuint shader
, GLuint location
,
69 static void world_bind_light_array( world_instance
*world
,
70 GLuint shader
, GLuint location
,
72 static void world_bind_light_index( world_instance
*world
,
73 GLuint shader
, GLuint location
,
75 static void render_world_position( world_instance
*world
, camera
*cam
);
76 static void render_world_depth( world_instance
*world
, camera
*cam
);
77 static void render_world( world_instance
*world
, camera
*cam
,
79 static void render_world_cubemaps( world_instance
*world
);
80 static void bind_terrain_noise(void);
82 #define WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( WORLD, SHADER ) \
83 world_link_lighting_ub( WORLD, _shader_##SHADER.id ); \
84 world_bind_position_texture( WORLD, _shader_##SHADER.id, \
85 _uniform_##SHADER##_g_world_depth, 2 ); \
86 world_bind_light_array( WORLD, _shader_##SHADER.id, \
87 _uniform_##SHADER##_uLightsArray, 3 ); \
88 world_bind_light_index( WORLD, _shader_##SHADER.id, \
89 _uniform_##SHADER##_uLightsIndex, 4 );
91 #endif /* WORLD_RENDER_H */