Commit Graph

2059 Commits

Author SHA1 Message Date
Sergey Sharybin
ed935ae5ad Cycles: Use lock in the memory statistics
CPU rendering is allowed to allocate memory from multiple threads,
which means statistics need to be avare of this.
2014-12-02 15:50:46 +05:00
Sergey Sharybin
f386f574b1 Cycles: Only report exporting curves if there are particle systems on the object 2014-11-28 16:16:50 +05:00
Sergey Sharybin
af18fb8036 Cycles: Code cleanup, remove dead code 2014-11-28 15:51:09 +05:00
Sergey Sharybin
9311a5be04 Cycles: Speedup BVH build for certain compilers
The issue was noticed with gcc-4.7 (used by the release build environment)
which didn't generate optimal enough code for BVH references swap. Seems it
looked up for the assign operator for each of the reference structure members
even though nothing special was required for assignment.

Forcing compiler to use simple memory copy gives speedup of like 2-3 times.

The issue doesn't happen with OSX's clang and new gcc-4.9, but since we're
gonna to stick to gcc-4.7 for official releases for quite some time still it's
nice to have performance issues resolved for all the compilers.

Didn't put the code into #ifdef so if in the future some issues appears with
alignment or assignment which need to happen as an operator we notice this
earlier.
2014-11-24 18:50:46 +05:00
Sergey Sharybin
c1149198b5 Cycles: Log time spent on the BVH build 2014-11-24 18:50:46 +05:00
Thomas Dinges
b9d9df9810 Cycles UI: Several fixes for recent additions...
* Alpha Property was removed (Fix T42690)
* Some tweaks to make the panel look better again.
* Use abreviated form "Multiple Importance" everywhere, for consistency.
2014-11-22 20:21:18 +01:00
Antony Riakiotakis
9124ecb16b Cycles: support for specular color in solid shading mode, available in
the material panel.

Patch by Phillipp Oeser (D62) with some minor modifications, thanks!
2014-11-21 14:07:38 +01:00
Sergey Sharybin
d4315398fc Cycles: Remove dynamic library helper files
They were only needed for CUDA wrangler. Since we've switched to CUEW
this utility functions are no longer needed.
2014-11-20 18:56:20 +05:00
Sergey Sharybin
d6579fe7f3 Cycles: Fix typo on graphiz graph dumper 2014-11-20 18:56:20 +05:00
Thomas Dinges
0756fe2684 Cleanup: Remove SD_BSDF_GLOSSY flag, unused. 2014-11-20 07:53:22 +01:00
Sergey Sharybin
d06b1a5d8b Cycles: Missed some changes in the previous hair motion blur fix
So now cases when object has both hair motion blur and deformation motion blur
vector pass is all correct.

We could get rid of the flag in the future, still need to look deeper into all
the areas trying to find a more clear solution.
2014-11-19 02:42:22 +05:00
Sergey Sharybin
729dc98be1 Fix T42475: Vector motion blur on hair
Issue was caused by mismatch in pre/post transform matrix spaces for mesh and
curve vectors. This happened because of current way how static transform apply
works: it only stores post/pre in the world space if there's triangle motion
exists. This lead to situation when there's no triangle motion happening but
was hair motion happening.

After long time of trying to solve it in a nice way, ended up solving it in
a bit slow way -- pre/post transform is still storing in the same spaces as
they used to be stored and just convert hair pre/post position to a world
space in the kernel.

This is because currently it's not so clear how to deal with cases when curve
and mesh motion needs different space of pre/post transform (which happens in
cases when only one of the motions exists).

Would think of some magic, and meanwhile artists could be happy with proper
render results.
2014-11-18 15:05:15 +01:00
Sergey Sharybin
c07241dd18 Cycles: Add logging to blender curve segment exporting 2014-11-18 15:05:15 +01:00
Thomas Dinges
694d74bc6d Fix for last commit, accidentaly removed transparent shadows property. 2014-11-17 11:31:59 +01:00
Thomas Dinges
90f3102f9c Cycles Standalone: Updates for Volume sampling. 2014-11-16 20:18:14 +01:00
Thomas Dinges
bfdb9f9e0f Cycles: Remove Integrator volume sampling flag, that was moved to Shader. 2014-11-16 19:50:14 +01:00
Sergey Sharybin
61e1e9adb8 Cycles: Revert changes to inline flags enabled for release only
It appears it's not really needed for convenient debugging when
using proper flags passed to the compiler. Basically, it is -g3
and set breakpoint to a function as if it's not in the namespace.

Not as if a code was any wrong, just it's possible to have more
clear solution for the issue i've tried to solve in the past.
2014-11-15 04:50:34 +05:00
Campbell Barton
22754cf687 skip scene_armature_depsgraph_workaround when theres no armatures 2014-11-14 14:55:45 +01:00
Thomas Dinges
2e2c24bec1 Cycles: Update some comments in volume code. 2014-11-13 11:30:18 +01:00
Sergey Sharybin
395ee33c8a Cycles: Prevent NaN and inf in area lamp sampling caused by precision issues
This doesn't have noticeable affect on the render times, but avoids possible
numerical issues.
2014-11-12 21:23:33 +05:00
Thomas Dinges
8f8b9b58f6 Fix T41066: MSVC + AVX2 kernel causes artifacts in hair render.
The issue lies in the FMA functions, so disable them on Windows for now.
2014-11-12 11:51:49 +01:00
Thomas Dinges
5cba64e30c Cleanup, please follow existing style when adding new flags. ;) 2014-11-12 09:43:23 +01:00
Thomas Dinges
727e9dd1bb Cleanup, typo fixes. 2014-11-12 09:14:07 +01:00
Dalai Felinto
8c227adb8c Fix T41783: Cycles baking ignores displacement
Create unique flag for output shaders with displacement data and use it
to calculate transformed normal. Implementation suggested by Brecht Van
Lommel.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D890
2014-11-11 18:21:56 -02:00
Dalai Felinto
63d0197f9b Fix T41873: Different 'seed' values do not yield different noise patterns when using cycles texture bake
As per instructions by Brecht Van Lommel.
2014-11-11 10:53:01 -02:00
Sergey Sharybin
157067acbd Cycles: Speedup for homogenous volumes in decoupled volume sampling
The idea is to avoid memory allocation when only one segment step is to be allocated.
This gives some speedup which is difficult to measure on this trashcan from hell, but
it's about from 7% to 10% in the extreme case with single volume filling the whole of
the viewport. This seems to depends on the phase of the bug-o-meter in the studio.

On the linux boxes it's not that spectacular speedup, it's about 2% on my laptop and
about 3% on the studio desktop. This is likely because of the awesomeness of jemalloc.
2014-11-10 18:47:28 +01:00
Thomas Dinges
75f518ccb9 Cycles: Remove dead branch for Distant lamps, ls->t is always FLT_MAX here. 2014-11-08 16:47:56 +01:00
Campbell Barton
7b873b0662 Add safe_normalize to cycles, avoid checking length first
This won't give any big speedup,
just avoids redundant sqrtf and may be useful in future.

Differential Revision: https://developer.blender.org/D880
2014-11-08 13:37:42 +01:00
Campbell Barton
112032f2ff Cleanup: cycles whitespace 2014-11-08 13:37:42 +01:00
Sergey Sharybin
a8b9402c8f Cycles: Tweak to the expf() speed workaround
Add compile-time check for particular glibc version which fixed the issue.
This makes it so own-compiled blender is the fastest in the world, and the
only issue remains what should we do for release builds.

After some discussion with Campbell we decided to keep it as is for now
because slowdown is not that much noticeable. We'll disable this workaround
for release builds when all the majority of the distros will switch to the
new version of glibc.
2014-11-07 13:35:45 +05:00
Thomas Dinges
fb820c0638 Cycles: Add "Max Bounce" control for lamps
With this setting, we can limit the influence of a lamp to a certain amount of bounces.
0 = Only direct light contribution
1 = 1 light bounce
...

Differential revision: https://developer.blender.org/D860

You can find an example render in the release logs: http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.73/Cycles
2014-11-05 22:49:09 +01:00
Sergey Sharybin
1073c6ae8e Cycles: Don't check shader for volume when checking if camera is inside volume
Intersection code already ignores objects without volume closure so checking it
afterwards is not needed.
2014-11-04 19:57:15 +01:00
Sergey Sharybin
4a9b912b96 Fix T42411: Camera inside volume + particle dupli (object/group) doesn't work
The issue was caused by missing current object instance initialization after
object was ignored for instance push.
2014-11-04 19:55:05 +01:00
Sergey Sharybin
ffbd9448c8 Cycles: Remove compatibility code for OSL-1.4
That code was mainly needed for the transition period, now we've
got all platforms updated to new OSL.

Plus there are some crucial fixes baking in the current upstream
sources which we'll need to have for the next Blender release.
2014-11-04 16:19:45 +05:00
Sergey Sharybin
d5f978b3cc Cycles: Be ready for new OIIO and OSL libraries
Even tho it's not 100% clear when we'll switch to OSL-1.6 we'd better
start preparing earlier for this, so we don't spend time on this later.

Plus this code helps troubleshooting some OSL issues, which requires
testing with latest versions of OSL.
2014-11-04 16:19:45 +05:00
Bastien Montagne
c14d34322b Fix typo breaking compilation with SSE2.
Spotted by sybrenstuvel (Sybren Stüvel), thanks!
2014-11-02 23:01:09 +01:00
Sergej Reich
cbf2fab9ea Cycles: Remove redundant alloc/free
Seems like a copy paste error.
2014-11-01 15:23:14 +01:00
Sergey Sharybin
bf13f1a263 Cycles: Code cleanup, proper class vs. struct declaration 2014-11-01 03:09:46 +05:00
Thomas Dinges
29c71b2c09 Cleanup: Remove unused light function. 2014-10-31 22:54:05 +01:00
Sergey Sharybin
95687f9751 Fix T42349: Windows Render command line Cycles Crash
The issue was caused by GLEW MX enabled in SCons by default so
basically previous commit already fixed the crash. But we need
to be safe here.

For now the fix is simple and not that clean, just check if
there's an OpenGL context available and if not we don't do any
GLSL magic.

This is to be cleaned up after some discussion with the viewport
project guys.
2014-10-31 22:51:49 +05:00
Sergey Sharybin
f9688d88ff Fix T42391: HSV correction shader node gives negative values
This mainly happens when over-saturating already saturated color.
After some discussion with Campbell and loads of tests we decided
to clamp the result RGB color. As an alternative we might want to
clamp corrected HSV values instead, but that would lead to some
larger changes in the render results.

TODO: The same is to be done for compositor nodes.
2014-10-31 14:58:00 +01:00
Thomas Dinges
4ff8744669 Cycles / CUDA: Better fix for missing sm_52 kernel, in case user compiles himself. 2014-10-30 11:42:59 +01:00
Thomas Dinges
d5ed153760 Cycles / OSL: Support microfacet() closure color function from OSL 1.5
This is basically just a wrapper class, which maps the generic call from the OSL spec to our closures.

Example usage:

shader microfacet_osl(
    color Color = color(0.8),
    int Distribution = 0,
    normal Normal = N,
    vector Tangent = normalize(dPdu),
    float RoughnessU = 0.0,
    float RoughnessV = 0.0,
    float IOR = 1.4,
    int Refract = 0,
    output closure color BSDF = 0)
{
    if (Distribution == 0)
        BSDF = Color * microfacet("ggx", Normal, Tangent, RoughnessU, RoughnessV, IOR, Refract);
    else
        BSDF = Color * microfacet("beckmann", Normal, Tangent, RoughnessU, RoughnessV, IOR, Refract);
}
2014-10-30 11:33:27 +01:00
Martijn Berger
4b33667b93 Deduplicate some code by using a function pointer to the real kernel
This has no performance impact what so ever and is already used in the adaptive sampling patch
2014-10-30 10:23:44 +01:00
Campbell Barton
133f79e449 Cleanup: warnings, typos 2014-10-29 14:15:21 +01:00
Sergey Sharybin
6a4a911fc3 Cycles: Optimize math node without links to a single value node
Pretty straightforward implementation. Just needed to move some functions
around to make them available at shader compile time.
2014-10-29 16:31:13 +05:00
Thomas Dinges
db4d7004d8 Cycles: Add a soft min/max UI value for volume step size, usually a range from 0.01 to 1.0 is fine. 2014-10-29 12:16:38 +01:00
Thomas Dinges
6d1c0260bb Cleanup: Style fixes for closures, mainly bitflags and conditions. 2014-10-29 09:56:21 +01:00
Thomas Dinges
13ca9873c9 Cleanup: Remove unused function in Translucent BSDF. 2014-10-29 09:42:19 +01:00
Campbell Barton
eaaeae4699 Cleanup: spelling 2014-10-23 10:38:38 +02:00