Commit Graph

7482 Commits

Author SHA1 Message Date
Sergey Sharybin
2bad10be96 Cycles: Cleanup, move Embree BVH logic to own file
There is no way we can keep generic entry point functions easy to
follow if we start adding actual logic in them.
2018-11-09 12:28:55 +01:00
Sergey Sharybin
2d98b198e9 Cycles: Cleanup, indentation in preprocessor 2018-11-09 12:12:11 +01:00
Sergey Sharybin
3e76cc494a Cycles: Cleanup, indentation 2018-11-09 12:10:48 +01:00
Sergey Sharybin
203de0bbf0 Cycles: Cleanup, space after (void)
It was used in like 95% of places.
2018-11-09 12:08:51 +01:00
Sergey Sharybin
2330cadb0f Cycles: Cleanup, don't use strict C prototypes
Those are more like a legacy of language, which is not
needed in C++.
2018-11-09 12:04:41 +01:00
Sergey Sharybin
c86d4b1d80 Cycles: Cleanup, split array from vector
Those are similar but different types, no reason to keep
their definitions in a single file.
2018-11-09 11:54:24 +01:00
Sergey Sharybin
b394e05118 Cycles: Cleanup, some documentation 2018-11-09 11:46:09 +01:00
Sergey Sharybin
a15e631537 Cycles: Cleanup, remove unneeded manual constructors specification 2018-11-09 11:44:33 +01:00
Sergey Sharybin
0e9be6fd7d Cycles: Cleanup, remove unneeded method from vector
Since we've defaulted to C++11, no need to override this
method manually anymore.
2018-11-09 11:42:12 +01:00
Sergey Sharybin
cb4b5e12ab Cycles: Cleanup, spacing after preprocessor
It is supposed to be two spaces before comment stating which if
else/endif statements corresponds to. Was mainly violated in the
header guards.
2018-11-09 11:34:54 +01:00
116be3deff Fix build on 32bit after Embree changes. 2018-11-08 14:58:01 +01:00
Lukas Stockner
47c77cd89c Cycles: Write Cryptomatte metadata according to the specification
Reviewers: brecht, sergey, swerner

Subscribers: creamsurfer, Tanguy, Noss, SteffenD

Differential Revision: https://developer.blender.org/D3862
2018-11-08 01:07:54 +01:00
Stefan Werner
d3320c5488 Cycles: Rearranged macros in kernel_types.h to fix Embree build. 2018-11-07 15:20:24 +01:00
33201a48b0 Fix build with OSL, remove unneeded file after Embree changes. 2018-11-07 14:38:07 +01:00
Stefan Werner
d3dd3739f6 Cycles: Fixed a warning. 2018-11-07 14:04:22 +01:00
Stefan Werner
e96986fa47 Cycles: Fixed OpenCL render after the Embree checkin. 2018-11-07 13:53:56 +01:00
Stefan Werner
2c5531c0a5 Cycles: Added Embree as BVH option for CPU renders.
Note that this is turned off by default and must be enabled at build time with the CMake WITH_CYCLES_EMBREE flag.
Embree must be built as a static library with ray masking turned on, the `make deps` scripts have been updated accordingly.
There, Embree is off by default too and must be enabled with the WITH_EMBREE flag.

Using Embree allows for much faster rendering of deformation motion blur while reducing the memory footprint.

TODO: GPU implementation, deduplication of data, leveraging more of Embrees features (e.g. tessellation cache).

Differential Revision: https://developer.blender.org/D3682
2018-11-07 12:58:12 +01:00
ea8e45de29 Fix assert rendering hair tests on some systems. 2018-11-04 20:25:57 +01:00
db59f30f2b Fix assert rendering with denoising, after recent changes. 2018-11-04 20:15:33 +01:00
Sergey Sharybin
e0cc3e9809 Cycles: Fix wrong BVH used when disabling AVX2 in debug settings
Mainly useful for debugging. Previously, when AVX2 was disabled
in the debug panel but BVH layout was kept on BVH8 nothing was
rendered.

Needed to make it so supported BVH layout mask for devices is
queried in "dynamic", so it is possible to use DebugFlags there.
2018-10-31 11:46:52 +01:00
7c0d37deca Fix build error on Windows 32bit, alignment was wrong. 2018-10-30 11:39:44 +01:00
Lukas Stockner
e3817e5ec1 Cycles: Support generating Denoising passes without actually denoising
Needed for the animation denoiser since the denoising filter is done separately there.

Reviewers: brecht, sergey

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D3833
2018-10-29 15:50:01 +01:00
17d91bcb61 Cycles: more detailed tooltips for cryptomatte options. 2018-10-29 13:22:58 +01:00
47953dee79 Fix Linux build after Cryptomatte commit. 2018-10-28 14:55:55 +01:00
Stefan Werner
e58c6cf0c6 Cycles: Added Cryptomatte output.
This allows for extra output passes that encode automatic object and material masks
for the entire scene. It is an implementation of the Cryptomatte standard as
introduced by Psyop. A good future extension would be to add a manifest to the
export and to do plenty of testing to ensure that it is fully compatible with other
renderers and compositing programs that use Cryptomatte.

Internally, it adds the ability for Cycles to have several passes of the same type
that are distinguished by their name.

Differential Revision: https://developer.blender.org/D3538
2018-10-28 05:37:41 -04:00
c0b3e3daeb Fix T57393: Cycles OSL bevel and AO not working after OSL upgrade. 2018-10-27 15:00:37 +02:00
Lukas Stockner
f1673d20fa Cycles: Expose noisy image pass by default when rendering with denoiser
Apparently quite a few users would like to have the noisy pass available when using the denoiser, and since it's being generated anyways we might as well expose it by default.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D3608
2018-10-26 16:21:11 +02:00
Lukas Stockner
65b25df801 Cycles: Overhaul ensure_valid_reflection to fix issues with normal- and bumpmapping
This function is supposed to prevent the black artifacts caused by strong normal- or bumpmapping, but failed in some cases.

Now the code correctly handles all test files and previous issues I am aware of and also has extensive comments describing
the algorithm and the math behind it.

Basically, the main problem was that there can be multiple valid solutions that fulfil the reflection angle criterium,
but I had assumed that only one would exist and therefore simply picked the first solution with a positive term in srqt().
Now, the code uses additional validity checks and a simple heuristic to pick the best valid solution.

Additionally, the code messed up very shallow reflections even if the normal map strength was zero due to the constant
limit for the outgoing ray angle, which caused shallow incoming rays to fail the initial test even when reflected directly
on Ng. Now, the code accounts for this by reducing the threshold in the case of a shallow incoming ray, ensuring that at
least N=Ng is always a valid solution.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D3816
2018-10-25 14:50:48 +02:00
Bastien Montagne
35d7211bfa I18n: tweak/fix exception catching code of pgettex() wrapper.
Related to T57066, rather unlikely to fix core of the issue, but may
solve crash itself.

Same as rBf22385f28ec8 (did it by mistake in 2.8 first :/ ).
2018-10-24 08:23:14 +02:00
Ray Molenkamp
86dbbd156f Windows: Enable python debugging in Visual Studio.
see D3817 for technical details, and https://wiki.blender.org/wiki/Tools/Debugging/Python_Visual_Studio for a end user quick-start guide.

Differential Revision: https://developer.blender.org/D3817
2018-10-22 10:17:08 -06:00
Lukas Stockner
02e6916890 Cycles: Enable shadow information in requested features when denoising is used
The shadow information isn't only used for shadowcatchers, but also to generate the shadowing feature pass of the denoiser.
2018-10-22 00:14:22 +02:00
Campbell Barton
76f640c27d Cleanup: spelling 2018-10-09 09:29:14 +11:00
Lukas Stockner
7920ebd157 Cycles: Fix NLM denoising kernels zeroing the wrong buffer on OpenCL
Since my temporary buffer commit (about a month ago), the OpenCL device was zeroing the wrong buffer, leading to
completely wrong filtered feature passes and therefore significantly lower-quality results than CPU and CUDA.
2018-10-09 00:14:29 +02:00
Lukas Stockner
7aaeb06fb6 Cycles: Clean up extra minus in previous commit
Forgot to add that change, sorry for the noise.
2018-10-08 22:22:05 +02:00
Lukas Stockner
0234de7d85 Cycles: Reuse existing buffer in the NLM denoising kernels on CPU 2018-10-08 22:17:06 +02:00
Lukas Stockner
15e9d80375 Cycles: Use existing shared temporary memory in reconstruction step of the denoiser
Previously the code allocated its own temporary memory, but it's possible to just use the existing shared one instead.
2018-10-08 22:13:40 +02:00
Lukas Stockner
a0cc7bd961 Cycles: Implement vectorized NLM kernels for faster CPU denoising 2018-10-06 21:49:54 +02:00
Ray Molenkamp
9a674a749b cycles: Support building with cuda 10 on windows. 2018-10-03 10:18:22 -06:00
d05b9e0a2e Fix build with older CMake versions that we still need to support. 2018-10-03 12:55:43 +02:00
d2da3af073 Fix T54287: memory not freed after rendering on Linux.
With new jemalloc versions memory allocated by threads that then become
inactive is not longer automatically freed. Instead we have to enable a
background thread to do it.

Some testing is needed to find out of this is sufficient, because the
background thread only runs periodically.
2018-10-03 12:09:31 +02:00
786870e26f Fix T56909: wrong interface scale on macOS 10.14, when using 10.14 SDK.
This does not affect existing releases as far as I can tell, only new builds
using the new SDK have the problem.
2018-10-01 08:35:32 +02:00
bbd3ac73bc Fix T56396: Cycles wrong object motion blur with deformation blur disabled. 2018-09-30 19:34:34 +02:00
Sergey Sharybin
de3ee3c6e8 Cycles: Fix compilation error of CUDA kernel
Was caused by previous commit.
2018-09-28 15:02:44 +02:00
Sergey Sharybin
b030277e79 Cycles: Fix crash with BVH8 on certain scenes
The crash was caused by BVH traversal stack being overflowed.

That overflow was caused by lots of false-positive intersections
for rays originating on a non-finite location.

Not sure why those rays will be existing in the first place,
this is to be investigated separately.

This commit moves pre-SSE4.1 check to a higher level function
and enables it for all miroarchitectures.
2018-09-28 13:57:50 +02:00
Sergey Sharybin
81f68bbba1 Fix compilation errors and warnings with Clang-6 2018-09-28 09:46:12 +02:00
bd267b0332 Fix cycles_cubin_cc build error on macOS. 2018-09-27 15:59:14 +02:00
e8e2f51063 Fix CUDA build with Xcode 10.0, use nvrtc due to incompatible compilers. 2018-09-27 15:20:33 +02:00
Sergey Sharybin
8f9a6b1bab Cycles: Cleanup 2018-09-27 14:49:37 +02:00
Sergey Sharybin
bee16ec4d8 Cycles: Sync BVH8 unaligned node packing code with BVH4
Similar to dfae3de6bdf.
2018-09-27 14:49:12 +02:00
2a63e062b0 Tests: add --no-window-focus to open window without focus.
This is useful to run OpenGL tests while continuing to do other tasks
without windows constantly popping up in the foreground.
2018-09-27 12:21:48 +02:00