- struct ub_world_lighting *winfo = &gpipeline.ub_world_lighting;
-
- v3f sundir = { 0.5f, 0.8f, 0.2f };
- v3_normalize( sundir );
- v3_copy( sundir, winfo->g_directional );
- v3_copy( (v3f){ 1.2f,1.152f,1.08f }, winfo->g_sun_colour );
- v3_copy( (v3f){ 0.15f,0.1f,0.2f }, winfo->g_shadow_colour );
- v4_copy( wrender.plane, winfo->g_water_plane );
-
- v4f bounds;
- bounds[0] = world.geo.bbx[0][0];
- bounds[1] = world.geo.bbx[0][2];
- bounds[2] = 1.0f/ (world.geo.bbx[1][0]-world.geo.bbx[0][0]);
- bounds[3] = 1.0f/ (world.geo.bbx[1][2]-world.geo.bbx[0][2]);
- v4_copy( bounds, winfo->g_depth_bounds );
-
- winfo->g_water_fog = 0.04f;
- render_update_lighting_ub();
-}
-
-static void world_init(void)
-{
- vg_tex2d_init( (vg_tex2d *[]){ &tex_terrain_colours,
- &tex_terrain_noise }, 2 );
-
-
- model *msky = vg_asset_read("models/rs_skydome.mdl");
- model_unpack( msky, &world.skydome );
-
- world.dome_lower = *submodel_get( msky, "dome_lower" );
- world.dome_upper = *submodel_get( msky, "dome_upper" );
-
- free(msky);
-}
-
-/*
- * Rendering
- */
-
-static void bind_terrain_textures(void)
-{
- vg_tex2d_bind( &tex_terrain_noise, 0 );
- vg_tex2d_bind( &tex_terrain_colours, 1 );
-}
-
-static void render_props( m4x4f projection, v3f camera )
-{
- m4x3f identity_matrix;
- m4x3_identity( identity_matrix );
-
- shader_vblend_use();
- shader_vblend_uTexGarbage(0);
- shader_vblend_uTexGradients(1);
- shader_link_standard_ub( _shader_vblend.id, 2 );
- bind_terrain_textures();
-
- shader_vblend_uPv( projection );
- shader_vblend_uMdl( identity_matrix );
- shader_vblend_uCamera( camera );
-
- scene_bind( &world.props );
- scene_draw( &world.props );
-}