commit 2afea6c75d063267d6c8b3ab0d345b40e2b0c05b parent d32234e627bd50f6bf2eed5584e128e6f615aa26 Author: Michael Savage <mikejsavage@gmail.com> Date: Thu Aug 31 22:55:38 +0300 Oops Diffstat:
terrain_manager.cc | | | 9 | ++------- |
diff --git a/terrain_manager.cc b/terrain_manager.cc @@ -219,8 +219,6 @@ void terrain_init( } tm->blue_noise = load_png_memory( blue_noise_png, blue_noise_png_len, TEXFMT_R_U8NORM, 1, false ); - tm->ub_view = renderer_new_ub(); - tm->ub_sun = renderer_new_ub(); tm->point_light_origins = renderer_new_tb( TEXFMT_RGB_FLOAT ); tm->point_light_colours = renderer_new_tb( TEXFMT_RGB_FLOAT ); @@ -333,9 +331,6 @@ void terrain_render( TerrainManager * tm, const m4 & V, const m4 & P, float sun_ tm->tile_states[ tx ][ ty ] = TILE_LOADED; } - renderer_ub_easy( tm->ub_view, V, P ); - renderer_ub_easy( tm->ub_sun, sun_dir, sun_angle ); - /* start lighting */ float tbo1[ 15 ] = { 500, float( 1500 + 500 * sin( current_time + 3.14 * 1 / 5 ) ), 15, @@ -359,8 +354,8 @@ void terrain_render( TerrainManager * tm, const m4 & V, const m4 & P, float sun_ RenderState render_state; render_state.shader = get_shader( SHADER_TERRAIN ); render_state.textures[ 2 ] = tm->blue_noise; - render_state.ubs[ UB_VIEW ] = tm->ub_view; - render_state.ubs[ UB_SUN ] = tm->ub_sun; + render_state.uniforms[ UB_VIEW ] = renderer_uniforms( V, P ); + render_state.uniforms[ UB_SUN ] = renderer_uniforms( sun_dir, sun_angle ); render_state.tbs[ 0 ] = tm->point_light_origins; render_state.tbs[ 1 ] = tm->point_light_colours;