diff options
author | Matt Ebb <matt@mke3.net> | 2008-11-14 09:01:06 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2008-11-14 09:01:06 +0300 |
commit | 8d5c14b20d61d990691ccaecefc3b5cbce449ef5 (patch) | |
tree | e2ff7702152f16dd3effffdc7af412378b73fabf | |
parent | a2da0911a6da23dc420f7a25fc258ae048913b7a (diff) |
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 :)
-rw-r--r-- | source/blender/render/intern/source/volumetric.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 1c0828d868c..83c25ad68c6 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -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); |