Commit Graph

4066 Commits

Author SHA1 Message Date
Brecht Van Lommel
bd03e4cfe8 Cycles volume: detect homogeneous volume automatically in common cases.
In practice this means that if you don't connect a texture to your volume nodes
it will figure that out and render the node faster, rather than you having to
specify it manually.

Main weakness is custom OSL nodes where we have to assume it is heterogeneous
because we don't know what kind of data the node accesses.
2014-04-03 22:13:05 +02:00
Sv. Lockal
ab32a1807d Cycles: SSE optimization for Voronoi cells texture
Gives 5-6% speedup for Caterpillar_PatazStudio.blend.

Reviewed By: brecht, dingto

Differential Revision: https://developer.blender.org/D419
2014-04-03 23:35:10 +04: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
Brecht Van Lommel
5e5ec4c138 Fix T39577: cycles issue mixing anisotropic BSDFs with branched path tracer. 2014-04-03 15:59:39 +02:00
Campbell Barton
f38331adef Code cleanup: style 2014-04-03 09:24:09 +11:00
Brecht Van Lommel
a58814acf5 Fix T39525: cycles volume render difference between branched/non-branched path. 2014-04-02 20:51:29 +02:00
Brecht Van Lommel
7ed9d1b402 Fix T39523: cycles cache BVH not working correct with deformation motion blur. 2014-04-02 20:51:29 +02:00
Kevin Dietrich
cb7cfd3ab6 Cycles: add dedicated UV Map node, easier to find and has convenient auto complete.
Fixes T37954.

Reviewed By: brecht, dingto

Differential Revision: https://developer.blender.org/D230
2014-04-02 11:53:44 +02:00
Campbell Barton
dc5fe5d25f Fix bpy.so linking on Mac OS X
D345 from Aleksandr Derbenev
2014-04-02 09:03:01 +11:00
Sv. Lockal
c682fe49f4 Cycles: fix 3-5% performance regression in msvc builds caused by a typo in stackchecking flags. 2014-03-31 21:44:02 +04:00
Brecht Van Lommel
c8862806ba Fix T39525: branched path + no lights + disabled use all lights option crash. 2014-03-31 13:54:15 +02:00
Brecht Van Lommel
e05d35bfaf Fix T39510, Fix T39523: camera motion blur not working correct after recent changes. 2014-03-31 13:43:19 +02:00
Sergey Sharybin
a9b82244de Code cleanup: fixes for function prototypes 2014-03-31 17:35:56 +06:00
Thomas Dinges
e001b5b33e Cycles: Deformation Motionblur works on GPU, so remove the checks in the UI. 2014-03-31 02:18:49 +02:00
Campbell Barton
c16bd951cd Enable GCC pedantic warnings with strict flags,
also modify MIN/MAX macros to prevent shadowing.
2014-03-30 15:04:20 +11:00
Campbell Barton
1f58bfb8be Code cleanup: de-duplicate cotangent weight function & add arg sizes 2014-03-30 11:08:33 +11:00
Thomas Dinges
a17c38f8e4 Cycles UI: Do not grey out Object Motion Blur buttons, when we use CPU fallback (User Preferences set to None). 2014-03-29 21:58:58 +01:00
Brecht Van Lommel
73299516fa Fix scons CUDA build and compile error with more strict compilers. 2014-03-29 15:57:27 +01:00
Brecht Van Lommel
f449542d6a Cycles volume: change heterogeneous volume sampling in branched path first hit.
This now uses decoupled ray marching, and removes the probalistic scattering.
What this means is that each AA sample will be slower but contain less noise,
hopefully giving less render time to reach the same noise levels.

For those following along, there's still a bunch of volume sampling improvements
to do: all-light sampling, multiple importance sampling, transmittance threshold,
better indirect light handling, multiple scatter approximation.
2014-03-29 13:03:50 +01:00
Brecht Van Lommel
3847d0c0df Cycles code internals: add initial implementation of decoupled ray marching.
This basically records all volumes steps, which can then later be used multiple
time to take scattering samples, without having to step through the volume
again. From the paper:

"Importance Sampling Techniques for Path Tracing in Participating Media"

This works only on the CPU, due to usage of malloc/free.
2014-03-29 13:03:50 +01:00
Brecht Van Lommel
47e7acf231 Cycles code refactor: minor refactoring and comments for volume code. 2014-03-29 13:03:49 +01:00
Brecht Van Lommel
7cb28f41f9 Cycles volume: change homogeneous volume sampling in branched path first hit.
Similar to surfaces, this will now always scatter rather than probabilistically
scattering or not depending on the transmittance.

This also makes calculation of branched path throughput non-probalistic, which
makes thing slower too. That's to be solved by decoupled ray marching later.
2014-03-29 13:03:49 +01:00
Brecht Van Lommel
9a77872b2b Cycles code refactor: shuffle homogeneous volume code to factor out hit/miss decision.
This removes a few optimizations to avoid exp() calls and division, they will be
added back later, at the moment it's more important to make the code easier to
understand and refactor.
2014-03-29 13:03:49 +01:00
Brecht Van Lommel
676e1cbe40 Cycles code refactor: move some more volume code into separate functions. 2014-03-29 13:03:49 +01:00
Brecht Van Lommel
b1615f0e0e Cycles volumes: don't average coefficients over volume step.
Rather use random point in each step instead of giving the steps random sizes.
Gives a bit more accurate results with large step sizes, but also convenient
convention for later changes.
2014-03-29 13:03:49 +01:00
Brecht Van Lommel
f5ab699fe8 Fix cycles error for heterogenous volumes, causing double step size to be used.
This gives longer render times due to smaller step size, double it to get
something more like the previous behavior.
2014-03-29 13:03:49 +01:00
Brecht Van Lommel
28954ce9c4 Cycles code refactor: move some volume code to separate functions. 2014-03-29 13:03:48 +01:00
Brecht Van Lommel
691c4c17ad Cycles: add "density", "flame" and "color" attributes for smoke domains.
These can currently be accessed by adding an Attribute node and specifying one
of those three names. A Smoke/Fire node should be added at some point to make
this more convenient.

These values might change still before the release, in particular for flame the
meaning seems unclear, it's just values in the 0..1 range. This is useful for
color ramps, but it might be good if this was also available as temperature in
kelvin so it can be plugged into the blackbody node. But I couldn't figure out
from the smoke code if or how this corresponds to a physical unit.

Here's a (quite poor) example file for a fire + smoke setup:
http://www.pasteall.org/blend/27990
2014-03-29 13:03:48 +01:00
Brecht Van Lommel
27043b8e40 Cycles code internals: add support for mesh voxel grid attributes.
These are internally stored as a 3D image textures, but accessible like e.g.
UV coordinates though the attribute node and getattribute().

This is convenient for rendering e.g. smoke objects where data like density is
really a property of the mesh, and it avoids having to specify the smoke object
in a texture node, instead the material will work with any smoke domain.
2014-03-29 13:03:48 +01:00
Brecht Van Lommel
393216a6df Cycles code refactor: move more code to geom folder, add some comments. 2014-03-29 13:03:48 +01:00
Brecht Van Lommel
663a750c7f Fix: cycles volume emission incorrectly enabling surface importance sampling. 2014-03-29 13:03:48 +01:00
Brecht Van Lommel
a2e4ebd36a Cycles code internals: add CPU kernel support for 3D image textures. 2014-03-29 13:03:48 +01:00
Brecht Van Lommel
e8b1cfed0a Cycles code refactor: replace magic ~0 values in the code with defines. 2014-03-29 13:03:47 +01:00
Brecht Van Lommel
6997908afc Cycles: add per object options to disable motion blur and set deformation motion steps.
Notes:

* The motion steps only affect deformation motion blur.
* The actual number of steps is 2^(steps - 1). This avoids having to sample at
  many different times for object with more/fewer steps, now the times overlap.
* Deformation motion blur is enabled by default in existing files that have
  motion blur enabled. If the object is not deforming, this will be detected at
  export time, so raytracing performance will not be affected.

Part of the code is from the summer of code project by Gavin Howard.
2014-03-29 13:03:47 +01:00
Brecht Van Lommel
e2184c653e Cycles: add support for curve deformation motion blur. 2014-03-29 13:03:47 +01:00
Brecht Van Lommel
6020d00990 Cycles: add support for mesh deformation motion blur. 2014-03-29 13:03:47 +01:00
Brecht Van Lommel
8f33538fab Cycles code refactor: add motion sampled normals attribute. 2014-03-29 13:03:46 +01:00
Brecht Van Lommel
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
Brecht Van Lommel
934767cf7f Cycles code refactor: change curve key to float4 for easier storage as attribute. 2014-03-29 13:03:46 +01:00
Brecht Van Lommel
0509553b5e Cycles code refactor: changes to make adding new primitive types easier. 2014-03-29 13:03:46 +01:00
Brecht Van Lommel
24ad7e0bea Cycles code refactor: add support for motion vertex attributes. 2014-03-29 13:03:46 +01:00
Brecht Van Lommel
41d1675053 Cycles code refactor: move more geometry code into per primitive files. 2014-03-29 13:03:45 +01:00
Brecht Van Lommel
84470a1190 Cycles code refactor: move geometry related kernel files into own directory. 2014-03-29 13:03:45 +01:00
Sergey Sharybin
bcf6eedc48 Make blender compilable with FFmpeg-0.8.1
Needed for some own tests.
2014-03-27 19:12:21 +06:00
Thomas Dinges
859039f732 Cycles: Raise a proper error message when using Branched Path on sm_30, this is currently still disabled. 2014-03-27 10:29:22 +01:00
Campbell Barton
66671f1aae Cycles: fix for building with cmake when gcc refuses sse args 2014-03-27 10:40:14 +11:00
Campbell Barton
10e7544586 CMake: disable SSE flags if gcc/clang don't support 2014-03-27 08:33:33 +11:00
Lukas Tönne
8da4936590 Fix for build error in Cycles standalone caused by new DeviceDrawParams
added in rB74518b28267e9b18199212fbaa3c689fa018d20c.

No special bind/unbind needed for standalone viewer, so can just use a
static stub in the display callback.
2014-03-26 18:11:16 +01:00
Sergey Sharybin
74518b2826 Fix T39420: Cycles viewport/preview flickers, when moving mouse across editors
Issue was caused by the wrong usage of OCIO GLSL binding API. To make it
work properly on pre-GLSL-1.3 drivers shader is to be enabled after the
texture is binded to the opengl context. Otherwise it wouldn't know the
proper texture size.

This is actually a regression in 2.70 and to be ported to 'a'.
2014-03-26 15:58:53 +06:00
Campbell Barton
a99a8a6070 Code cleanup: style and warnings 2014-03-26 07:53:56 +11:00