mdl_node *mblob = mdl_node_from_name( mfoliage, "blob" );
mdl_submesh *sm_blob = mdl_node_submesh( mfoliage, mblob, 0 );
+ int count = 0;
+
for( int i=0;i<100000;i++ )
{
v3f pos;
ray_hit hit;
hit.dist = INFINITY;
- if( ray_world( pos, (v3f){0.0f,-1.0f,0.0f}, &hit ))
+ if( ray_world( pos, (v3f){0.0001f,-1.0f,0.0001f}, &hit ))
{
struct world_material *m1 = ray_hit_material( &hit );
if((hit.normal[1] > 0.8f) && (m1 == mat) && (hit.pos[1] > 0.0f+10.0f))
v3_copy( hit.pos, transform[3] );
scene_add_submesh( world.scene_no_collide, mfoliage,
sm_blob, transform);
+
+ count ++;
}
}
}
+
+ vg_info( "%d foliage models added\n", count );
}
VG_STATIC void world_ents_allocate(void)
glDisable(GL_DEPTH_TEST);
glDisable(GL_BLEND);
glDisable(GL_CULL_FACE);
- glBindFramebuffer( GL_FRAMEBUFFER, gpipeline.fb_depthmap );
- glViewport( 0, 0, 1024, 1024 );
+ render_fb_bind( gpipeline.fb_heightmap );
shader_blitcolour_use();
shader_blitcolour_uColour( (v4f){-9999.0f,-9999.0f,-9999.0f,-9999.0f} );
render_fsquad();