small compression
[carveJwlIkooP6JGAAIwe30JlM.git] / world_render.h
index d71b44e448fedbbe70dbdf463579f60717585008..3050a69e63213525dac25dac6627dfbd3aed6f7d 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "shaders/scene_standard.h"
 #include "shaders/scene_standard_alphatest.h"
+#include "shaders/scene_override.h"
 #include "shaders/scene_cubemapped.h"
 #include "shaders/scene_vertex_blend.h"
 #include "shaders/scene_terrain.h"
@@ -59,22 +60,32 @@ struct world_render{
    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, 
+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 layer_depth );
-VG_STATIC void render_world_cubemaps( world_instance *world );
+static void render_world_cubemaps( world_instance *world );
+static void bind_terrain_noise(void);
+
+#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 */