Commit Graph

5695 Commits

Author SHA1 Message Date
Sergey Sharybin
87c8ff0164 Cycles: Fix compilation error of certain OpenCL split kernels 2016-02-28 16:53:38 +01:00
Thomas Dinges
79c8eed843 Cleanup: Update Cycles standalone copyright info. 2016-02-27 13:07:32 +01:00
Sergey Sharybin
b6d9cbe654 Cycles: Fix bug in CMJ pattern when number of samples is 1
It was wrongly considering 1 is a power of 2. While it is a correct thing
(1 == 2^0) it's not what the math in some later formulas expects.
2016-02-24 14:23:45 +01:00
Sergey Sharybin
d3fa1bd4d5 Fix warnings reported by MSVC
Mainly it's related on a bad practice in SDL to force-define __SSE__
and __SSE2__ flags which generates quite some warnings and causes too
much noise.

There are some other warnings fixed. Should be no functional changes.

NeXyon, please check the changes in audaspace :)
2016-02-23 09:44:54 +01:00
Lukas Stockner
c359343f8d Fix T43388, fix T40369: Cycles baking not antialiasing textures.
This re-enables the AA jittering, but with proper clamping so that u >= 0,
v >= 0 and u+v <= 1.

Differential Revision: https://developer.blender.org/D1254
2016-02-21 15:10:51 +01:00
Sergey Sharybin
5f613f7b5d OCIO: Disable the warnings related on C4251
Those warnings are trigerred by stl classes in OCIO's public interface.

To quote MSDN: "C4251 can be ignored if you are deriving from a type in
the Standard C++ Library"

This is the only instance where those warnings hunts us, so for now we
can keep it all local in intern/opencolorio but this might be changed
in the future.
2016-02-20 14:06:11 +05:00
Sergey Sharybin
b2655167c6 GHost: Avoid macro re-definition by undefining the macro first
Should b totally harmless since the define was overriten anyway.
2016-02-20 14:06:10 +05:00
Sergey Sharybin
b30ab24fb8 Cycles: Avoid re-definition of math cnstants with MSVC 2016-02-20 14:06:05 +05:00
Sergey Sharybin
7c76479d5f Fix compilation error with FFmpeg and Ubuntu Trusty
Seems this is a confusion between Libav which was silently used
by Ubuntu instead of FFmpeg.
2016-02-19 22:05:06 +01:00
3c4f971392 Workaround for T47213: branched path sampling issues with CUDA 7.5. 2016-02-19 00:49:24 +01:00
Sergey Sharybin
da81227e54 Cycles: Fix wrong sample all direct/indirect settings on sm_50 and higher
Seems to be some compiler fault which leads to a wrong flag being used,
making it so wrong number of samples is used for the background.

This should in theory fix issue reported in T47213.
2016-02-18 16:29:35 +01:00
Lukas Stockner
a8fe3a1cee Fix T47461: Different results on CPU and GPU when using Branched Path Tracing
The issue here was actually somewhere else - the attached scene from the report used a light falloff node in a sunlamp (aka distant light).
However, since distant lamps set the ray length to FLT_MAX and the light falloff node squares this value, it overflows and produces a NaN
weight, which propagates and leads to a NaN intensity, which is then clamped to zero and produces the black pixels.

To fix that issue, the smoothing part of the light falloff is just ignored if the smoothing term isn't finite (which makes sense since
the term should converge to 1 as the distance increases).
The reason for the different results on CPUs and GPUs is not perfectly clear, but probably can be explained with different handling of
Inf/NaN edge cases.

Also, to notice issues like these faster in the future, kernel_asserts were added that evaluate as false as soon as a non-finite intensity is produced.
2016-02-18 01:23:38 +01:00
Sergey Sharybin
8cab327316 Cycles: Make CUDA 7.5 officially recommended
This was a hard decision, because going newer CUDA toolkit makes
rendering up to 5% slower. But on another hand, it solves major
speed regressions (up to 30%) with branched path tracing on a
top level cards.

Neither of those regressions have a meaningful and sane workaround
from the code itself.

Toolkit 6.5 could still be used, but it's no longer recommended one.
2016-02-17 15:18:56 +01:00
Sergey Sharybin
3857b4600f Cycles: Don't silence unused macro, remove the macro instead
It's not really handy to silence something unused hoping for it'll be
used in the future. We can end up with quite some silencing then.

Also made this flag which i find rather useless to NOT cause -Werror
in Cycles code.
2016-02-17 12:40:56 +01:00
Campbell Barton
d4e5e94ec7 Cleanup: unused define warning 2016-02-17 21:39:23 +11:00
Campbell Barton
88d4d0d070 Cleanup: OSL style 2016-02-17 21:39:23 +11:00
Sergey Sharybin
d6b77450ce Fix T47447: Cycles crash when reaching texture limit with 3D textures 2016-02-17 11:43:03 +01:00
Sergey Sharybin
4431caae1a Some more tweaks to make linking to a shared FFmpeg-3.0 happy 2016-02-17 10:48:46 +01:00
Lukas Stockner
8d95178c0b Fix T47411: Cycles portals luminance artifacts
When using multiple portals, scene areas behind one of the portals were rendered darker than they should.
The reason for that is a pretty stupid mistake: Since portals are only used at positions that aren't behind them,
only portals that are used should be accounted for in the PDF calculation. That was actually the case, but the final
divide incorrectly divided by the total amount of portals, not the amount of visible ones.

Another issue with areas behind portals was the PDF evaluation function.
The new evaluation code is shorter, simpler and fixes this issue.

Also, the threshold for the distance check was increased to avoid artifacts where portals touch a surface.
2016-02-17 03:06:30 +01:00
0ccae52394 Fix OpenCL kernel build errors after recent 3D texture changes. 2016-02-17 01:38:55 +01:00
833eb863eb Fix (harmless) assert in BVH spatial splits with Visual Studio debug builds. 2016-02-17 00:07:35 +01:00
Campbell Barton
1c958f5bef Cleanup: avoid -Wnarrowing warning 2016-02-17 05:18:47 +11:00
Sergey Sharybin
480b814e02 Cycles: Remove back some tweaks for inline policies
While kernel compiles fine, it seems generated binary is not really correct.
2016-02-16 17:25:58 +01:00
Sergey Sharybin
d0246d5f30 Cycles: Some cleanup, should be no functional changes
Addressing meaningful feedback from coverity.
2016-02-16 15:33:00 +01:00
Sergey Sharybin
63b60be6d7 Fix T47427: Crash caused by OSL 2016-02-16 13:38:07 +01:00
Thomas Dinges
ab5417870d Cleanup: Typo. 2016-02-16 13:00:44 +01:00
Sergey Sharybin
c5e1781944 Cycles: Fix crash when trying to render after re-enabling the addon 2016-02-16 12:47:31 +01:00
Sergey Sharybin
0b03785eb5 Make Blender compilable with FFmpeg-3.0
While it's not something we'll be using for the official release,
it's nice to support new libraries at least on "it compiles" level,
so it's not that many frustrated developers around.

Nexyon, please have a look into Audaspace changes :)
2016-02-16 12:34:15 +01:00
Sergey Sharybin
1c4f21f85e Cycles: Initial support of 3D textures for CUDA rendering
Supports both smoke/fire and point density textures now.

Reduces number of textures available for sm_20 and sm_21, but you have
to compromise somewhere on such a limited hardware.

Currently limited to linear interpolation only, and decoupled ray
marching is not supported yet. Think those could be considered just a
further improvement.

Some quick example:

  https://developer.blender.org/F282934

Code is minimal and we can fully consider it a fix for missing
support of 3D textures with CUDA.

Reviewers: lukasstockner97, brecht, juicyfruit, dingto

Reviewed By: brecht, juicyfruit, dingto

Subscribers: mib2berlin

Differential Revision: https://developer.blender.org/D1806
2016-02-15 21:26:29 +01:00
Martijn Berger
b5171e250c Make cycles standalone link again 2016-02-15 21:00:25 +01:00
Sergey Sharybin
c93069083e Cycles: Tweaks for 32bit CUDA binaries
Tweak some inline policies. Not totally crazy yet, and in fact we now
have one less ifdef statement now.
2016-02-15 19:11:02 +01:00
Sergey Sharybin
1336e97b12 Cycles: Use CUDA_64_BIT_DEVICE_CODE to detect which CUDA architecture to use
It is initialized based on size of pointer, which matches our previous
behavior, but using it in Cycles side allows to cross-compile CUDA
binaries.
2016-02-15 19:08:36 +01:00
Sergey Sharybin
06743f4018 Cycles: Make guarded allocator compatible with MSVC2015 2016-02-15 18:33:36 +05:00
Sergey Sharybin
6371fccdbe Cycles: Fix guarded allocator issues on Windows
The issue was caused by static vectors allocating some internal
data using rebound element allocator for them, which was causing
access to a non-initialized statistics objects and was failing a
lot when switching Blender to a fully guarded allocation.

Additionally, we were not able to free that internal memory before
Blender exits, which was causing false-positive memory leak prints.

Now we're not using GuardedAllocator for those proxy containers.

Ideally this should be done as a GuardedAllocator::rebind, but
it didn't work for vector<bool> because it seems some internal
parts are converting bool to char32_t, which either makes it so
we can't use GuardedAllocator for those vectors or the compiler
get's confused when we're trying explicitly allow GuardedAllocator
for rebind<char32_t>.

This with current approach we should be fine for the release.
2016-02-15 11:46:13 +01:00
Sergey Sharybin
7d85da882b Cycles: Fix infinite recursion of md5 calculation on Windows
Was caused by some safety things of making sure we've for NULL
terminator for the buffer when doing mbs<->wcs conversion, but
it turns out this simply confuses str::string and it can no
longer have proper .size(). Let's assume behavior of string
allocation is same all over the std, and we can avoid having
that extra null-terminator allocated.
2016-02-14 21:08:11 +05:00
701a4a4e09 Fix cmd+z for undo not working when editing text objects on OS X. 2016-02-13 22:54:02 +01:00
88770bed7c Fix T47393: mouse wheel scroll no longer zooms with mighty mouse on OS X.
Hopefully this is the last fix, using the method explained here:
https://forums.developer.apple.com/thread/31536
2016-02-13 16:07:55 +01:00
Thomas Dinges
6a593aba44 Cleanup: Move Cycles sky model data to util. 2016-02-13 13:41:40 +01:00
Sergey Sharybin
d1dd893487 Cycles: Remove meaningless expression 2016-02-13 13:29:50 +01:00
Sergey Sharybin
89b1f042cf Cycles: Fix compilation error on Windows 2016-02-13 13:29:13 +01:00
Sergey Sharybin
69dc0c3192 Cycles: Fixes for Burley BSSRDF
There are several fixes in here, which hopefully will make the shader
working correct without too much magic in there.

First of all, this commit brings BURLEY_TRUNCATE down from 30 to 16
which reduces noise a lot. It's still higher than original truncate
from Brecht, but this reduces PDF value at a cutoff distance by an
order of magnitude (now it's 0.008387, previously it was 0.063521
for the albedo of 0.8 and radius 1.0). This should converge to a
proper result faster and don't have artifacts.

This kind of reverts fix for T47356, but after additional thinking
came to conclusion Burley is not being totally smooth, it is about
giving less waxy results which it's kind of doing in the file.

Second of all, this commit fixes burley_eval() to use normalized
diffusion reflectance. This matches the way we calculate CDF and
solves numeric instability close to 0, making PDF profile looking
closer to other SSS profiles:

  https://developer.blender.org/F282355
  https://developer.blender.org/F282356
  https://developer.blender.org/F282357

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D1792
2016-02-13 13:29:13 +01:00
Thomas Dinges
83dc288689 Cleanup: Remove some OIIO code for versions prior to 1.5. 2016-02-13 13:21:47 +01:00
Sergey Sharybin
ae635771b2 Cycles: Fix crash caused by the guarded allocation commit
C++ requires specific alignment of the allocations which was not an
issue when using GCC but uncovered issue when using Clang on OSX.
Perhaps some versions of Clang might show errors on other platforms
as well.
2016-02-13 12:35:33 +01:00
Sergey Sharybin
1477028ea3 Cycles: Fix compilation error with MinGW
Was using some C++0 which we don't officially enabled yet.
2016-02-12 20:21:13 +01:00
Sergey Sharybin
c8d2bc7890 Cycles: Always use guarded allocator of vectors
We don't have vectors re-allocation happening multiple times from inside
a loop anymore, so we can safely switch to a memory guarded allocator for
vectors and keep track on the memory usage at various stages of rendering.

Additionally, when building from inside Blender repository, Cycles will
use Blender's guarded allocator, so actual memory usage will be displayed
in the Space Info header.

There are couple of tricky aspects of the patch:

- TaskScheduler::exit() now explicitly frees memory used by `threads`.
  This is needed because `threads` is a static member which destructor
  isn't getting called on Blender's exit which caused memory leak print
  to happen.

  This shouldn't give any measurable speed issues, reallocation of that
  vector is only one of fewzillion other allocations happening during
  synchronization.

- Use regular guarded malloc (not aligned one). No idea why it was
  made to be aligned in the first place. Perhaps some corner case tests
  or so. Vector was never expected to be aligned anyway. Let's see if
  we'll have actual bugs with this.

Reviewers: dingto, lukasstockner97, juicyfruit, brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D1774
2016-02-12 15:43:26 +01:00
Sergey Sharybin
28604c46a1 Cycles: Make Blender importer more forward compatible
Basically the idea is to make code robust against extending
enum options in the future by falling back to a known safe
default setting when RNA is set to something unknown.

While this approach solves the issues similar to T47377,
but it wouldn't really help when/if any of the RNA values
gets ever deprecated and removed. There'll be no simple
solution to that apart from defining explicit mapping from
RNA value to Cycles one.

Another part which isn't so great actually is that we now
have to have some enum guards and give some explicit values
to the enum items, but we can live with that perhaps.

Reviewers: dingto, juicyfruit, lukasstockner97, brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D1785
2016-02-12 15:27:33 +01:00
Thomas Dinges
164dfbeb50 Cycles: Remove some ifdefs for OSL < 1.7.1.
That means that we now only support OSL 1.7.1 or newer. Please update libs or re-run install-depsh.sh.
2016-02-11 13:58:50 +01:00
Sergey Sharybin
10cc4ae359 Cycles: Fix typo in network device
Spotted by jesterKing, thanks!
2016-02-11 13:05:55 +01:00
Sergey Sharybin
5237937a08 Cycles: Fix an AttributeErro exceptionr on missing object context
This happens when the properties panel is pinned to the material tab.

Patch by Ralf Hölzemer (aka cheleb), thanks!

Differential Revision: https://developer.blender.org/D1776
2016-02-10 10:35:39 +01:00
Aaron Carlisle
15f76ca072 Update link to avoid redirect 2016-02-10 01:05:10 +01:00