Volume rendering:

* Use a slightly better (but still not exact) approximation for the view
vector when pre-shading the light cache. This still doesn't give exactly the
same results as non-light-cache shading, but it's better. Will investigate
getting a better view vector when there's more time - or if anyone has a
simple formula to derive shi->view from shi->co that would be great to 
hear about too :)
This commit is contained in:
Matt Ebb
2008-11-14 06:01:06 +00:00
parent a2da0911a6
commit 8d5c14b20d

View File

@@ -984,7 +984,7 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m
for (z=0; z < res; z++) {
co[2] = bbmin[2] + (voxel[2] * z);
time= PIL_check_seconds_timer();
i++;
@@ -1012,6 +1012,9 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m
obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = -1.0f;
continue;
}
VECCOPY(shi.view, co);
Normalize(shi.view);
density = vol_get_density(&shi, co);
vol_get_scattering(&shi, scatter_col, co, stepsize, density);