X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_render.h;h=ecbd3d22ec093a78cb68dfb128df537b2a3f3340;hb=859178c6d4b2a9b9a95f8b01b113f589ce0f197f;hp=3590cf7480d7215131dc13ef5b073d27e30fce21;hpb=342fcbf6fda017bdd38d56ce0fa7c9e59e589f3b;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_render.h b/world_render.h index 3590cf7..ecbd3d2 100644 --- a/world_render.h +++ b/world_render.h @@ -5,16 +5,24 @@ #ifndef WORLD_RENDER_H #define WORLD_RENDER_H +#define WORLD_CUBEMAP_RES 32 + #include "camera.h" #include "world.h" #include "shaders/scene_standard.h" #include "shaders/scene_standard_alphatest.h" +#include "shaders/scene_foliage.h" +#include "shaders/scene_override.h" +#include "shaders/scene_cubemapped.h" #include "shaders/scene_vertex_blend.h" #include "shaders/scene_terrain.h" +#include "shaders/scene_fxglow.h" #include "shaders/scene_depth.h" #include "shaders/scene_position.h" +#include "shaders/scene_font.h" #include "shaders/model_sky.h" +#include "shaders/model_sky_space.h" static const float k_world_light_cube_size = 8.0f; @@ -43,32 +51,49 @@ struct world_render{ u32 timer_text_count; struct text_particle{ - rb_object obj; + rigidbody rb; m4x3f mlocal; ent_glyph *glyph; v4f colour; - m4x3f mdl; + f32 radius; } text_particles[6*4]; u32 text_particle_count; } static world_render; -VG_STATIC void world_render_init(void); +static void world_render_init(void); -VG_STATIC void world_link_lighting_ub( world_instance *world, GLuint shader ); -VG_STATIC void world_bind_position_texture( world_instance *world, +static void world_link_lighting_ub( world_instance *world, GLuint shader ); +static void world_bind_position_texture( world_instance *world, GLuint shader, GLuint location, int slot ); -VG_STATIC void world_bind_light_array( world_instance *world, +static void world_bind_light_array( world_instance *world, GLuint shader, GLuint location, int slot ); -VG_STATIC void world_bind_light_index( world_instance *world, +static void world_bind_light_index( world_instance *world, GLuint shader, GLuint location, int slot ); -VG_STATIC void render_world_position( world_instance *world, camera *cam ); -VG_STATIC void render_world_depth( world_instance *world, camera *cam ); -VG_STATIC void render_world( world_instance *world, camera *cam, - int layer_depth ); +static void render_world_position( world_instance *world, camera *cam ); +static void render_world_depth( world_instance *world, camera *cam ); +static void render_world( world_instance *world, camera *cam, + int stenciled, int viewing_from_gate, + int with_water, int with_cubemaps ); +static void render_world_cubemaps( world_instance *world ); +static void bind_terrain_noise(void); +static void render_world_override( world_instance *world, + world_instance *lighting_source, + m4x3f mmdl, + camera *cam, + ent_spawn *dest_spawn, v4f map_info ); + +#define WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( WORLD, SHADER ) \ + world_link_lighting_ub( WORLD, _shader_##SHADER.id ); \ + world_bind_position_texture( WORLD, _shader_##SHADER.id, \ + _uniform_##SHADER##_g_world_depth, 2 ); \ + world_bind_light_array( WORLD, _shader_##SHADER.id, \ + _uniform_##SHADER##_uLightsArray, 3 ); \ + world_bind_light_index( WORLD, _shader_##SHADER.id, \ + _uniform_##SHADER##_uLightsIndex, 4 ); #endif /* WORLD_RENDER_H */