X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=terrain.h;h=b5e7e5333b555efa6f851699242e6533a977578d;hb=4744d53642cca117c2e130d39cc58b2911336bf3;hp=81b311ac737d64c861d67a67fc6b841e3d8c0bc7;hpb=3bb0287d544a4cb75de9afe2927ac8e946f3a18e;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/terrain.h b/terrain.h index 81b311a..b5e7e53 100644 --- a/terrain.h +++ b/terrain.h @@ -3,6 +3,7 @@ static void render_terrain(m4x4f projection, v3f camera); static void render_sky(m4x3f camera); +#if 0 #ifndef TERRAIN_H #define TERRAIN_H @@ -50,6 +51,12 @@ static void terrain_init(void) free(msky); } +static void bind_terrain_textures(void) +{ + vg_tex2d_bind( &tex_terrain_noise, 0 ); + vg_tex2d_bind( &tex_terrain_colours, 1 ); +} + static void render_terrain(m4x4f projection, v3f camera) { shader_terrain_use(); @@ -65,6 +72,15 @@ static void render_terrain(m4x4f projection, v3f camera) shader_terrain_uMdl( identity_matrix ); shader_terrain_uCamera( camera ); shader_terrain_uPlane( (v4f){ 0.0f,1.0f,0.0f, wrender.height } ); + + glActiveTexture( GL_TEXTURE2 ); + glBindTexture( GL_TEXTURE_2D, wrender.depthmap ); + shader_terrain_uTexDepth( 2 ); + shader_terrain_uDepthBounds( (v4f){ + wrender.depthbounds[0][0], + wrender.depthbounds[0][2], + 1.0f/ (wrender.depthbounds[1][0]-wrender.depthbounds[0][0]), + 1.0f/ (wrender.depthbounds[1][2]-wrender.depthbounds[0][2])} ); } static void render_lowerdome( m4x3f camera ) @@ -124,3 +140,4 @@ static void render_sky(m4x3f camera) } #endif +#endif