projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
spherecast predictions
[carveJwlIkooP6JGAAIwe30JlM.git]
/
world_gen.h
diff --git
a/world_gen.h
b/world_gen.h
index 4e96d96be15bda08408deff3205afe498e2bf5e2..47ed5ee9c9b64624c20bf060c90921f3bb7d8037 100644
(file)
--- a/
world_gen.h
+++ b/
world_gen.h
@@
-54,6
+54,8
@@
VG_STATIC void world_apply_procedural_foliage( struct world_material *mat )
mdl_node *mblob = mdl_node_from_name( mfoliage, "blob" );
mdl_submesh *sm_blob = mdl_node_submesh( mfoliage, mblob, 0 );
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;
for( int i=0;i<100000;i++ )
{
v3f pos;
@@
-64,7
+66,7
@@
VG_STATIC void world_apply_procedural_foliage( struct world_material *mat )
ray_hit hit;
hit.dist = INFINITY;
ray_hit hit;
hit.dist = INFINITY;
- if( ray_world( pos, (v3f){0.0
f,-1.0f,0.0
f}, &hit ))
+ if( ray_world( pos, (v3f){0.0
001f,-1.0f,0.0001
f}, &hit ))
{
struct world_material *m1 = ray_hit_material( &hit );
if((hit.normal[1] > 0.8f) && (m1 == mat) && (hit.pos[1] > 0.0f+10.0f))
{
struct world_material *m1 = ray_hit_material( &hit );
if((hit.normal[1] > 0.8f) && (m1 == mat) && (hit.pos[1] > 0.0f+10.0f))
@@
-83,9
+85,13
@@
VG_STATIC void world_apply_procedural_foliage( struct world_material *mat )
v3_copy( hit.pos, transform[3] );
scene_add_submesh( world.scene_no_collide, mfoliage,
sm_blob, transform);
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)
}
VG_STATIC void world_ents_allocate(void)
@@
-544,8
+550,7
@@
VG_STATIC void world_post_process(void)
glDisable(GL_DEPTH_TEST);
glDisable(GL_BLEND);
glDisable(GL_CULL_FACE);
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();
shader_blitcolour_use();
shader_blitcolour_uColour( (v4f){-9999.0f,-9999.0f,-9999.0f,-9999.0f} );
render_fsquad();