Commit Graph

9 Commits

Author SHA1 Message Date
Campbell Barton
e86dbf6877 Code cleanup: avoid int/uint mixup in cycles 2014-05-05 01:30:02 +10:00
Campbell Barton
8d16869d83 Code cleanup: Add -Werror=float-conversion to Cycles 2014-05-03 07:31:46 +10:00
9ab259f55b 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
2014-04-21 19:34:25 +02:00
Sv. Lockal
e7c2578576 Cycles: avoid 1.0f/(1.0f/x) divisions, which msvc (only) can't optimize.
This makes bmw scene in msvc 12 builds 6% faster.
It also gives a minor speedup for SSE hair in all compilers.
2014-04-03 22:08:53 +04:00
393216a6df Cycles code refactor: move more code to geom folder, add some comments. 2014-03-29 13:03:48 +01:00
e8b1cfed0a Cycles code refactor: replace magic ~0 values in the code with defines. 2014-03-29 13:03:47 +01:00
99f5993088 Cycles code refactor: improve vertex motion attribute storage and export.
This now supports multiple steps and subframe sampling of motion.

There is one difference for object and camera transform motion blur. It still
only supports two steps there, but the transforms are now sampled at subframe
times instead of the previous and next frame and then interpolated/extrapolated.
This will give different render results in some cases but it's more accurate.

Part of the code is from the summer of code project by Gavin Howard, but it has
been significantly rewritten and extended.
2014-03-29 13:03:46 +01:00
41d1675053 Cycles code refactor: move more geometry code into per primitive files. 2014-03-29 13:03:45 +01:00
84470a1190 Cycles code refactor: move geometry related kernel files into own directory. 2014-03-29 13:03:45 +01:00