Commit Graph

5166 Commits

Author SHA1 Message Date
Sergey Sharybin
686e8e452c Fix T45390: Cycles experimental displacement method ignores scaling when render
From artists perspective it makes sense to always apply displacement in a local
space.

TODO: Double-check that BVH is being packed properly. From quick tests seems it's
all fine, but might be missing some obvious failure still.
2015-07-13 15:24:56 +02:00
Thomas Dinges
d54e77b66d Cycles: Expose "Max Bounces" for the world light.
When using MIS, the world is treated as regular light and in this case
we can now also limit the maximum amount of bounces, the background light
will contribute to the scene.

This can improve performance in some cases, where it's e.g. sufficient to
only have a contribution on first 1-2 bounces.
Examples can be found in the differential.

Differential revision: https://developer.blender.org/D1399
2015-07-12 17:56:54 +02:00
Sergey Sharybin
3dc86f586c Cycles: Add debug print about CLEW initialization status 2015-07-07 14:37:12 +02:00
Sergey Sharybin
37539962fe Cycles: Add an option to force disable all OpenCL devices
This way it's possible to disable OpenCL devices for AMD devices
which are considered whitelisted.
2015-07-07 14:18:45 +02:00
Campbell Barton
72565fbf30 Cleanup: style, spelling 2015-07-06 17:45:11 +10:00
Thomas Dinges
8d15cad449 Cleanup: Typo in comment. 2015-07-04 13:17:29 +02:00
Sergey Sharybin
36426c3ee2 Cycles: Code cleanup, double semicolon 2015-07-03 15:44:57 +02:00
Sergey Sharybin
c864f5d140 Cycles: Error enqueueing split kernels should no longer cause infinite loop 2015-07-03 12:13:38 +02:00
Sergey Sharybin
659e5234af Cycles: Use explicit indices for split kernel queues 2015-07-03 11:05:28 +02:00
Sergey Sharybin
b9f89b1647 Cycles: Code cleanup in split kernel, whitespaces 2015-07-03 11:03:56 +02:00
Antony Riakiotakis
626a287c89 Support debug contexts on win32 2015-07-02 20:06:02 +02:00
Antony Riakiotakis
00808eb39a Make OpenGL debug contexts a flag --debug-gpu instead of a compile time
option.

This makes sense, since contexts get created at runtime, there is little
reason to require recompilation for this.

Only works on linux currently, will be doing more OSs later
2015-07-02 19:30:17 +02:00
Bastien Montagne
53d12bbe04 atomic_ops: Fix MSVC versions of add/sub returning original value instead of result of operation.
Thanks to Brecht for tip about how to fix this!
2015-07-01 12:25:32 +02:00
Bastien Montagne
174d5cf627 atomic_ops: fix typo in func names (uint32 instead of uint64). 2015-07-01 12:25:31 +02:00
Sergey Sharybin
78de47ca24 Cycles: Fix zero-size buffer allocation with OpenCL devices
This is not really supported by OpenCL but might happen in certain
configurations. There might be some remained cases when this happens
but so far can not find any,
2015-07-01 11:56:48 +02:00
Campbell Barton
d9046ccbd4 Cleanup: doxygen comments 2015-07-01 16:30:26 +10:00
Campbell Barton
45b2218341 User Prefs for NDOF dead-zone
D1344 with edits
2015-07-01 13:45:19 +10:00
Sergey Sharybin
cf1bac3f69 Cycles: Solve some harmless NULL pointer magic
Was harmless but confused some sanity checks, also kinda makes sense
to be more verbose about what's going on there.
2015-06-30 23:41:19 +02:00
Campbell Barton
3bb698646a CMake: minor edits 2015-06-30 22:44:27 +10:00
Campbell Barton
8bef305b6d Cleanup: move BLI_timestr to BLI_timecode 2015-06-30 14:47:31 +10:00
Sergey Sharybin
6654ec7de7 Fix T45154: Translation binary file(blender.mo) for Japanese is too small
The issue was caused by some changes made to msgfmt which were needed to make
modified (cleaned-up, stripped-comments messages) working.

Unfortunately that fix was merged into the release branch, so this fix is to
be ported there as well and verified against rc1 translations.
2015-06-29 12:27:59 +02:00
Thomas Dinges
e6f7f36e40 Cleanup: Style in for loops header. 2015-06-29 00:56:04 +02:00
Sergey Sharybin
e245a57640 Fix T45227: Light optimization commit broke world MIS 2015-06-28 20:47:35 +02:00
Sergey Sharybin
68478aea01 Cycles: Avoid having duplication of BVH arrays during build
Previous idea behind having vector during building and array for actual storage
was needed in order to minimize amount of re-allocations happening during the
build, but it lead to double memory overhead used by those arrays at the vector
to array conversion stage.

Issue with such approach was that for BVH without spatial split size of arrays
is known in advance and it never changes, which made vector to array conversion
totally redundant.

Also after testing with several rather complex from spatial split scenes (such
as trees) it seems even conservative approach of reallocation (when we perform
re-allocation when leaf does not fit into the memory) doesn't give measurable
difference in time.

This makes it so we can switch to array, which will avoid unneeded memory
re-allocations when spatial split is disabled without harming other cases.

it's a bit difficult to measure exact benefit of this change on our production
files here, but depending on the scene it might give quite reasonable memory
save.
2015-06-28 18:15:25 +02:00
Sergey Sharybin
b506f3d328 Cycles: Add assert to an array at() function to be sure we don't have bad memory access 2015-06-28 18:15:25 +02:00
Sergey Sharybin
d9ef528d05 Cycles: Minor code style cleanup, whitesaces 2015-06-28 18:15:25 +02:00
Sergey Sharybin
008da0ff5e Cycles: Use aligned blender allocator when using guarded allocation
This way we solve possible issues caused by regular allocator not being aware of
some classes preferring 16 bytes alignment needed for SSE to work properly. This
caused random crashes during rendering.

Now we always use aligned allocation in GuardedAllocator which shouldn't be any
measurable performance impact and the code is only used by developers after
defining special symbol, so there is no impact on release builds at all.
2015-06-27 21:07:43 +02:00
Sergey Sharybin
4d74180b9f Cycles: Fix for wrong device enumeration in CUDA
it is the same issue as described in the previous commit, original changes
in this area were wrong and only worked on a bugger optimus driver which
simply appeared to work by co-incident and in fact used wrong device..
2015-06-27 15:13:08 +02:00
Sergey Sharybin
09dc470982 Cycles: Rework the way how OpenCL devices are created
It was annoying copy-paste happened across OpenCL device constructor, device
enumeration and split kernel checks. Now those areas are using an utility
function which returns pairs of platform and device IDs for devices which are
supported by Cycles and enumeration is happening inside that list.

This makes it so filtering is happening in a single place, so there's no need
to keep 3 different functions in sync.

This commit also fixes a bug with wrong enumeration of devices caused by recent
fixes. Those fixes were in fact wrong and only happened to appear to be working
on laptop with optimus card on Linux. Root of those issues is in fact in bad
Linux driver for optimus cards.
2015-06-27 15:13:08 +02:00
Sergey Sharybin
17f12fc71a Cycles: Allow using custom allocators for vector class 2015-06-27 15:13:08 +02:00
Sergey Sharybin
9260c0c2ba Cycles: Ignore light which has no contribution to the scene
This commit makes it so light which has zero energy or doesn't has
emission shader at all is being ignored by the path tracing.
2015-06-27 15:13:08 +02:00
Martijn Berger
e2d3e36ca7 Cycles standalone: add support for reading UV coordinates to the XML scene reader 2015-06-27 12:05:05 +02:00
Thomas Dinges
ddeb8c595f Cleanup: Fix a typo in world MIS.
Found by Lukas Stockner, thanks!
2015-06-26 21:36:28 +02:00
Campbell Barton
c40759e678 Cleanup: warnings 2015-06-24 18:42:16 +10:00
Sergey Sharybin
211a95b538 Fix T45034: MirrorBall rendering on wrong camera axis
This was a mistake in the original code from D1079.

With the current way how direction ot mirror ball works camera should look
into negative Y direction. Corrected it in the camera matrix synchronization,
so no extra calculations are needed at the render time.

That's a bit annoying, but we'd better port it to the release branch, or
otherwise we'll end up with files created with wrong camera mapping after
2.75 release.
2015-06-22 20:09:52 +02:00
Sergey Sharybin
3044e9fd31 Cycles: Respect duplicator's object motion blur settings
The idea is to make it possible to control linked duplicated objects motion
blur from the scene file without need to do overrides on the linked object
settings. Currently only supported for dupligroup duplication and all now
if duplicator object has motion blur disabled then it'll be inherited into
all the duplicated objects.

There should be no regressions/changes in look of existing files because
objects do have motion blur enabled by default.
2015-06-22 13:53:04 +02:00
Campbell Barton
8d752141ce Support for platforms /wo malloc_usable_size
Was only used for stats, netbsd doesn't define this function.
2015-06-21 12:33:55 +10:00
Sergey Sharybin
a95b0e0e9d Cycles: Another fix for OSX, sm_50 experimental actually also fails to compile
Didn't notice it originally because compilation was threaded.
2015-06-20 19:40:23 +02:00
Sergey Sharybin
5e2835037a Cycles: Tweak to previous commit, experimental sm_52 works on Linux but not OSX 2015-06-20 19:01:24 +02:00
Sergey Sharybin
34d665a4a4 Cycles: Un-inline triangle_intersect_precalc() on Apple OpenCL
This gives quite the same problems as experimental CUDA kernels
and for until it's found a root cause of the problem we'd just
explicitly uninline the function.
2015-06-20 18:00:30 +02:00
Sergey Sharybin
63dd554ff1 Cycles: Don't show pre-sm_20 CUDA cards in the device list 2015-06-20 17:34:12 +02:00
Sergey Sharybin
845854959f Cycles: Cleanup, make it more obvious which platform requires workaround for triangle intersection
Should be no functional changes.
2015-06-20 17:01:21 +02:00
Campbell Barton
74b32a23f7 Cleanup: checks for unsupported MSVC versions 2015-06-20 15:17:32 +10:00
Sergey Sharybin
e1fd7b9ca9 Cycles: Report currently sampling tile when CPU is working on the last tile
This is mainly useful for the render farms output when logging might stop at
the "Path Tracing Tile N/N" string, which makes it a bit difficult to follow
what exactly is happening (node going crazy, hardware issues or just last tile
is too much heavy).

This is more like an experiment, might be changed in the future.
2015-06-18 16:15:37 +02:00
Sergey Sharybin
4ed6605d65 Cycles: Don't show devices which does not support OpenCL 1.1 in the menu
They'll be checked for the version later and that check will fail anyway,
so better to not allow user to see unsupported device in the list.

Also corrected one more issue with the device enumeration.
2015-06-18 11:26:22 +02:00
Sergey Sharybin
0b79c5ed29 Cycles: Report total and render time to the log
This includes total render time spent on rendering since render() was
invoked and also prints time of actual rendering (without synchronization
step).
2015-06-17 14:07:51 +02:00
Sergey Sharybin
ae3e37b899 Cycles: Fix wrong numbering of OpenCL devices when some of them are skipped
Skipped devices did not reflect in the device number, which might result in bad
array indices.

This might also resolve T45037, and need to be ported to a release branch.
2015-06-17 11:35:39 +02:00
Thomas Dinges
291152e127 Add back ray bounces debug code, can be useful nevertheless.
Just need to keep in mind that these are not indirect bounces in the pass then.
2015-06-16 00:39:11 +02:00
Thomas Dinges
53e3e46332 Cycles / Branched Path: Some simplifications for main loop.
The main loop only handles transparent intersections from the camera ray.
Therefore we can simplify some things.

* Avoid PATH_RAY_CAMERA check, this is always true.
* Avoid path_state_next() call, we can just set transparent flag and increase transparent bounces. This way we avoid the function call and some branching.

Also remove debug num_ray_bounces++, this is incorrect here as no indirect bounce happens here.

Should be no functional changes.
2015-06-15 23:50:29 +02:00
Thomas Dinges
888ed6b7f1 Cleanup comment and remove now redundant define. 2015-06-15 23:35:38 +02:00