Page MenuHome

Cycles: Add support for cameras inside volume
ClosedPublic

Authored by Sergey Sharybin (sergey) on Sep 16 2014, 8:12 PM.
Tags
None
Tokens
"Love" token, awarded by gandalf3."Like" token, awarded by lordodin."Love" token, awarded by maverick."Love" token, awarded by lopataasdf.

Details

Summary

Basically the title says it all, volume stack initialization now is aware that
camera might be inside of the volume. This gives quite noticeable render time
regressions in cases camera is in the volume (didn't measure them yet) because
this requires quite a few of ray-casting per camera ray in order to check which
objects we're inside. Not quite sure if this might be optimized.

But the good thing is that we can do quite a good job on detecting whether
camera is outside of any of the volumes and in this case there should be no
time penalty at all (apart from some extra checks during the sync state).

For now we're only doing rather simple AABB checks between the viewplane and
volume objects. This could give some false-positives, but this should be good
starting point.

Need to mention panoramic cameras here, for them it's only check for whether
there are volumes in the scene, which would lead to speed regressions even if
the camera is outside of the volumes. Would need to figure out proper check
for such cameras.

There are still quite a few of TODOs in the code, but the patch is good enough
to start playing around with it checking whether there are some obvious mistakes
somewhere.

Diff Detail

Repository
rB Blender
Branch
cycles_camera_in_volume

Event Timeline

Sergey Sharybin (sergey) retitled this revision from to Cycles: Add support for cameras inside volume.
Sergey Sharybin (sergey) updated this object.

Awesome !

Hopefully it will work for panoramic cameras as well,
need this feature exactly for that type of camera.

Works great, here a small test video with a homogeneous and heterogeneous volume. http://youtu.be/0EGUK0Ngi8A

Couple of notes:

  • Panoramic cameras works, they're just currently gonna to be always slower.
  • Check around scene have volumes could be simplified, it's already done in ShaderManager and stored in Intergrator.use_volumes.
  • Some of the parts could be shared with fix for T39823, which parts exactly and when -- we'll see once this patch is committed or the fix is committed.
This revision was automatically updated to reflect the committed changes.