projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
regular shaders
[carveJwlIkooP6JGAAIwe30JlM.git]
/
world_gen.h
diff --git
a/world_gen.h
b/world_gen.h
index 1648bdf490370113e0b954f1a2d26b8b1c6b7c53..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)