and more debugging

This commit is contained in:
Matt Ebb
2008-10-23 01:52:04 +00:00
parent ee1a143947
commit 5fabc7781b
2 changed files with 11 additions and 1 deletions

View File

@@ -3094,6 +3094,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
do_autosmooth= 1;
if ((ma->material_type == MA_VOLUME) && (ma->vol_shadeflag & MA_VOL_PRECACHESHADING)) {
printf("before add_vol_precache \n");
add_vol_precache(re, obr, ma);
}
}
@@ -4927,8 +4928,10 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view)
make_sss_tree(re);
if(!re->test_break())
if(re->r.mode & R_RAYTRACE)
if(re->r.mode & R_RAYTRACE) {
printf("before volume_precache \n");
volume_precache(re);
}
}
if(re->test_break())

View File

@@ -888,11 +888,14 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m
R = *re;
if (G.rt==5) printf("before create raytree \n");
/* create a raytree with just the faces of the instanced ObjectRen,
* used for checking if the cached point is inside or outside. */
tree = create_raytree_obi(obi, bbmin, bbmax);
if (!tree) return;
if (G.rt==5) printf("after create raytree \n");
/* Need a shadeinput to calculate scattering */
memset(&shi, 0, sizeof(ShadeInput));
shi.depth= 1;
@@ -918,6 +921,8 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m
return;
VecMulf(voxel, 1.0f/res);
if (G.rt==5) printf("before alloc \n");
obi->volume_precache = MEM_callocN(sizeof(float)*res_3*3, "volume light cache");
/* Iterate over the 3d voxel grid, and fill the voxels with scattering information
@@ -986,6 +991,8 @@ void volume_precache(Render *re)
ObjectInstanceRen *obi;
VolPrecache *vp;
if (G.rt==5) printf("precache obs: %d \n", BLI_countlist(&re->vol_precache_obs));
for(vp= re->vol_precache_obs.first; vp; vp= vp->next) {
for(obi= re->instancetable.first; obi; obi= obi->next) {
if (obi->obr == vp->obr)