commit 764b0daff15d8ab9639bc193e5bf1b6d7a95770d parent adbdf56124d121441990edd5338535ace802b32f Author: Michael Savage <mikejsavage@gmail.com> Date: Sat Sep 10 21:57:13 -0700 More sun stuff Diffstat:
terrain_manager.cc | | | 6 | ++---- |
terrain_manager.h | | | 2 | +- |
diff --git a/terrain_manager.cc b/terrain_manager.cc @@ -341,14 +341,12 @@ void terrain_update( TerrainManager * tm, glm::vec3 position ) { } } -void terrain_render( TerrainManager * tm, glm::mat4 V, glm::mat4 VP, float sun_slope ) { - glm::vec3 sun = glm::normalize( glm::vec3( 1, 0, -sun_slope ) ); - +void terrain_render( TerrainManager * tm, glm::mat4 V, glm::mat4 VP, float sun ) { glUseProgram( tm->shader ); glUniformMatrix4fv( tm->un_V, 1, GL_FALSE, glm::value_ptr( V ) ); glUniformMatrix4fv( tm->un_VP, 1, GL_FALSE, glm::value_ptr( VP ) ); - glUniform1f( tm->un_sun, 0.3 ); + glUniform1f( tm->un_sun, sun ); glUniform2f( tm->un_dimensions, TILE_SIZE, TILE_SIZE ); /* start lighting */ diff --git a/terrain_manager.h b/terrain_manager.h @@ -80,7 +80,7 @@ struct TerrainManager { void terrain_init( TerrainManager * tm, const char * tiles_dir, MemoryArena * arena, WorkQueue * background_tasks ); void terrain_teleport( TerrainManager * tm, glm::vec3 position ); void terrain_update( TerrainManager * tm, glm::vec3 position ); -void terrain_render( TerrainManager * tm, glm::mat4 V, glm::mat4 VP, float sun_slope ); +void terrain_render( TerrainManager * tm, glm::mat4 V, glm::mat4 VP, float sun ); float terrain_height( const TerrainManager * tm, glm::vec3 position ); #endif // _TERRAIN_MANAGER_H_