Blender Git Commit Log
Git Commits -> Revision 9ab259f
Revision 9ab259f by Brecht Van Lommel (master) April 21, 2014, 17:34 (GMT) |
Cycles: shadow function optimization for transparent shadows (CPU only). Old algorithm: Raytrace from one transparent surface to the next step by step. To minimize overhead in cases where we don't need transparent shadows, we first trace a regular shadow ray. We check if the hit primitive was potentially transparent, and only in that case start marching. this gives extra ray cast for the cases were we do want transparency. New algorithm: We trace a single ray. If it hits any opaque surface, or more than a given number of transparent surfaces is hit, then we consider the geometry to be entirely blocked. If not, all transparent surfaces will be recorded and we will shade them one by one to determine how much light is blocked. This all happens in one scene intersection function. Recording all hits works well in some cases but may be slower in others. If we have many semi-transparent hairs, one intersection may be faster because you'd be reinteresecting the same hairs a lot with each step otherwise. If however there is mostly binary transparency then we may be recording many unnecessary intersections when one of the first surfaces blocks all light. We found that this helps quite nicely in some scenes, on koro.blend this can give a 50% reduction in render time, on the pabellon barcelona scene and a forest scene with transparent leaves it was 30%. Some other files rendered maybe 1% or 2% slower, but this seems a reasonable tradeoff. Differential Revision: https://developer.blender.org/D473 |
Commit Details:
Full Hash: 9ab259f55b67c6e3b8028d95b23e708c3bc0c6fd
Parent Commit: f6abc96
Lines Changed: +674, -48
1 Added Path:
/intern/cycles/kernel/geom/geom_bvh_shadow.h (+374, -0) (View)
6 Modified Paths:
/intern/cycles/kernel/geom/geom_bvh.h (+76, -0) (Diff)
/intern/cycles/kernel/geom/geom_bvh_subsurface.h (+5, -6) (Diff)
/intern/cycles/kernel/geom/geom_bvh_traversal.h (+5, -14) (Diff)
/intern/cycles/kernel/geom/geom_object.h (+29, -4) (Diff)
/intern/cycles/kernel/kernel_shadow.h (+184, -24) (Diff)
/intern/cycles/kernel/kernel_types.h (+1, -0) (Diff)
/intern/cycles/kernel/geom/geom_bvh_subsurface.h (+5, -6) (Diff)
/intern/cycles/kernel/geom/geom_bvh_traversal.h (+5, -14) (Diff)
/intern/cycles/kernel/geom/geom_object.h (+29, -4) (Diff)
/intern/cycles/kernel/kernel_shadow.h (+184, -24) (Diff)
/intern/cycles/kernel/kernel_types.h (+1, -0) (Diff)