diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-12-12 18:43:11 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-12-12 18:43:11 +0400 |
commit | b76d465e3c775b8f7d09fe1f1d0e4fa50a08725b (patch) | |
tree | e8bc73c8d86954c043d93bddd04b12538d3e2a78 /source/blender/render | |
parent | 5616c7a0585521ca16f352ce2277cf4ac73eced2 (diff) |
Fix related to #33480: for blender internal volume rendering, the camera inside
volume wasn't accurate, it still isn't quite but hopefully a bit better by
taking clip start into account.
With clip start it's actually impossible to do a single 'inside' test, since
there will not be a single point where all camera rays start from, though for
small clip start they will be close together.
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/intern/source/convertblender.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 37fd213edd5..620f9d41818 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -3158,7 +3158,12 @@ static void init_camera_inside_volumes(Render *re) { ObjectInstanceRen *obi; VolumeOb *vo; - float co[3] = {0.f, 0.f, 0.f}; + /* coordinates are all in camera space, so camera coordinate is zero. we also + * add an offset for the clip start, however note that with clip start it's + * actually impossible to do a single 'inside' test, since there will not be + * a single point where all camera rays start from, though for small clip start + * they will be close together. */ + float co[3] = {0.f, 0.f, -re->clipsta}; for (vo= re->volumes.first; vo; vo= vo->next) { for (obi= re->instancetable.first; obi; obi= obi->next) { |