X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_render.h;h=846e2d83f7f53694147231ca09a02b2246a3caaf;hb=5fa590f62aa7e62a8b6b07e10556c2ecc54cdca6;hp=383706853a4aeb1325f32555da58d47069e0d27c;hpb=d171c9ad5de05c9ac8563fcf9f23760b93fb50f8;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_render.h b/world_render.h index 3837068..846e2d8 100644 --- a/world_render.h +++ b/world_render.h @@ -1,17 +1,16 @@ /* - * Copyright (C) 2021-2023 Mt.ZERO Software, Harry Godden - All Rights Reserved + * Copyright (C) 2021-2024 Mt.ZERO Software, Harry Godden - All Rights Reserved */ -#ifndef WORLD_RENDER_H -#define WORLD_RENDER_H +#pragma once #define WORLD_CUBEMAP_RES 32 -#include "camera.h" +#include "vg/vg_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" @@ -25,7 +24,8 @@ static const float k_world_light_cube_size = 8.0f; -struct world_render{ +struct world_render +{ GLuint tex_terrain_noise; /* rendering */ @@ -50,40 +50,45 @@ 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; -static void world_render_init(void); +extern world_render; + +void world_render_init(void); -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 ); -static void world_bind_light_array( world_instance *world, - GLuint shader, GLuint location, - int slot ); -static void world_bind_light_index( world_instance *world, - GLuint shader, GLuint location, - int slot ); -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 ); +void world_prerender( world_instance *world ); +void world_link_lighting_ub( world_instance *world, GLuint shader ); +void world_bind_position_texture( world_instance *world, + GLuint shader, GLuint location, + int slot ); +void world_bind_light_array( world_instance *world, + GLuint shader, GLuint location, + int slot ); +void world_bind_light_index( world_instance *world, + GLuint shader, GLuint location, + int slot ); +void render_world_position( world_instance *world, vg_camera *cam ); +void render_world_depth( world_instance *world, vg_camera *cam ); +void render_world( world_instance *world, vg_camera *cam, + int stenciled, int viewing_from_gate, + int with_water, int with_cubemaps ); +void render_world_cubemaps( world_instance *world ); +void bind_terrain_noise(void); +void render_world_override( world_instance *world, + world_instance *lighting_source, + m4x3f mmdl, + vg_camera *cam, + ent_spawn *dest_spawn, v4f map_info ); +void render_world_gates( world_instance *world, vg_camera *cam ); +void imgui_world_light_edit( world_instance *world ); #define WORLD_BIND_LIGHT_BUFFERS_UB0_TEX234( WORLD, SHADER ) \ world_link_lighting_ub( WORLD, _shader_##SHADER.id ); \ @@ -94,4 +99,3 @@ static void render_world_override( world_instance *world, world_bind_light_index( WORLD, _shader_##SHADER.id, \ _uniform_##SHADER##_uLightsIndex, 4 ); -#endif /* WORLD_RENDER_H */