cycles.git
13 days agocmake: fix linking errors on windows. master
Ray Molenkamp [Fri, 12 Apr 2019 12:43:55 +0000 (06:43 -0600)]
cmake: fix linking errors on windows.

2 months agoFix WITH_CYCLES_OPENSUBDIV not enabling OpenSubdiv.
Brecht Van Lommel [Thu, 14 Feb 2019 16:27:15 +0000 (17:27 +0100)]
Fix WITH_CYCLES_OPENSUBDIV not enabling OpenSubdiv.

2 months agoFix Cycles Embree crash on macOS, due to too small thread stack size.
Brecht Van Lommel [Thu, 14 Feb 2019 13:37:57 +0000 (14:37 +0100)]
Fix Cycles Embree crash on macOS, due to too small thread stack size.

2 months agoFix Cycles build error with OpenImageIO 2.x
Brecht Van Lommel [Thu, 14 Feb 2019 12:57:28 +0000 (13:57 +0100)]
Fix Cycles build error with OpenImageIO 2.x

2 months agoFix T61470: inconsistent HSV node results with saturation > 1.0.
Brecht Van Lommel [Wed, 13 Feb 2019 15:58:54 +0000 (16:58 +0100)]
Fix T61470: inconsistent HSV node results with saturation > 1.0.

Values outside the 0..1 range produce negative colors, so now clamp to that
range everywhere. Also fixes improper handling of hue > 2.0 in some places.

2 months agoFix T61502: Cycles wrong other object texture coordinates in OSL.
Brecht Van Lommel [Wed, 13 Feb 2019 14:01:54 +0000 (15:01 +0100)]
Fix T61502: Cycles wrong other object texture coordinates in OSL.

The row/column major matrix conversion was done twice.

2 months agoFix T61457, T61489, T61482: build errors and memory warning in Cycles.
Brecht Van Lommel [Tue, 12 Feb 2019 16:10:31 +0000 (17:10 +0100)]
Fix T61457, T61489, T61482: build errors and memory warning in Cycles.

For OIIO 2.x we must use unique_ptr. This also required updating the
guarded allocator for std::move to work. Since C++11 construct/destroy
have a default implementation that also works this case, so we just
leave it out.

2 months agoAdd animation denoising test, fix operator to work with single frames.
Brecht Van Lommel [Mon, 11 Feb 2019 17:26:47 +0000 (18:26 +0100)]
Add animation denoising test, fix operator to work with single frames.

2 months agoBackport samples metadata format changes to 2.7
Sergey Sharybin [Wed, 6 Feb 2019 10:49:41 +0000 (11:49 +0100)]
Backport samples metadata format changes to 2.7

The render layer name is now always included. Best to keep these consistent,
so that animation denoising and sample merging works the same for both and
tests can be the same. Ref D4311.

2 months agoFix build error on macOS after recent changes
Brecht Van Lommel [Mon, 11 Feb 2019 14:03:28 +0000 (15:03 +0100)]
Fix build error on macOS after recent changes

2 months agoAdd animation denoising python operator
Lukas Stockner [Wed, 6 Feb 2019 11:57:10 +0000 (12:57 +0100)]
Add animation denoising python operator

This adds a cycles.denoise_animation operator, which denoises an animation
sequence or individual file. Renders must be saved as multilayer EXR files
with denoising data passes.

By default file path and frame range come from the current scene, and EXR
files are denoised in-place. Alternatively, a different input and/or output
file path can be provided.

Denoising settings come from the current view layer. Renders can be denoised
again with different settings, as the original noisy image is preserved along
with other passes and metadata.

There is no user interface yet for this feature, that comes later.

Code by Lukas with modifications by Brecht. This feature was originally
developed for Tangent Animation, thanks for the support!

Differential Revision: https://developer.blender.org/D3889

2 months agoRefactor blender device settings handling into own file.
Brecht Van Lommel [Wed, 6 Feb 2019 15:15:45 +0000 (16:15 +0100)]
Refactor blender device settings handling into own file.

2 months agoFix wrong Cycles render status text when only writing denoising passes.
Brecht Van Lommel [Thu, 7 Feb 2019 19:49:37 +0000 (20:49 +0100)]
Fix wrong Cycles render status text when only writing denoising passes.

In that case we do prefiltering for the denoising passes, but don't actually
denoise the image.

2 months agoAnimation denoising support in the kernel
Lukas Stockner [Wed, 6 Feb 2019 13:19:20 +0000 (14:19 +0100)]
Animation denoising support in the kernel

This is the internal implementation, not available from the API or
interface yet. The algorithm takes into account past and future frames,
both to get more coherent animation and reduce noise.

Ref D3889.

2 months agoTweak outlier detection, preparing for animation denoising.
Lukas Stockner [Wed, 6 Feb 2019 13:42:32 +0000 (14:42 +0100)]
Tweak outlier detection, preparing for animation denoising.

Ref D3889.

2 months agoPrefilter feature passes separate from denoising
Lukas Stockner [Wed, 6 Feb 2019 11:42:10 +0000 (12:42 +0100)]
Prefilter feature passes separate from denoising

Prefiltering of feature passes will happen during rendering, which can
then be used for denoising immediately or written as a render pass for
later (animation) denoising.

The number of denoising data passes written is reduced because of this,
leaving out the feature variance passes. The passes are now Normal,
Albedo, Depth, Shadowing, Variance and Intensity.

Ref D3889.

2 months agoFix T61078: Cycles crash with adaptive smoke sim playback
Brecht Van Lommel [Fri, 1 Feb 2019 18:05:00 +0000 (19:05 +0100)]
Fix T61078: Cycles crash with adaptive smoke sim playback

3D image dimensions should be updated on the Cycles side before loading
the smoke data.

2 months agoCleanup: remove redundant, invalid info from headers
Campbell Barton [Fri, 1 Feb 2019 15:40:00 +0000 (02:40 +1100)]
Cleanup: remove redundant, invalid info from headers

BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.

2 months agoDelay cuda and opencl initialization to avoid driver crashes.
Brecht Van Lommel [Tue, 29 Jan 2019 15:39:30 +0000 (16:39 +0100)]
Delay cuda and opencl initialization to avoid driver crashes.

We've had many reported crashes on Windows where we suspect there is a
corrupted OpenCL driver. The purpose here is to keep Blender generally
usable in such cases.

Now it always shows None / CUDA / OpenCL in the preferences, and only when
selecting one will it reveal if there are any GPUs available. This should
avoid crashes when opening the preferences or on startup.

Differential Revision: https://developer.blender.org/D4265

2 months agoOSL: remove fresnel template that was not public domain
Brecht Van Lommel [Mon, 28 Jan 2019 10:51:24 +0000 (11:51 +0100)]
OSL: remove fresnel template that was not public domain

Convention is to only have public domain code templates. Also fixes wrong
license header in Cycles.

2 months agoFix Cycles standalone build as part of Blender
Brecht Van Lommel [Sun, 27 Jan 2019 17:26:26 +0000 (18:26 +0100)]
Fix Cycles standalone build as part of Blender

2 months agoCleanup: fix compiler warnings
Brecht Van Lommel [Sat, 26 Jan 2019 13:46:38 +0000 (14:46 +0100)]
Cleanup: fix compiler warnings

2 months agoFix T60597, T60806: Cycles crash rendering principled BSDF + volume interior.
Brecht Van Lommel [Thu, 24 Jan 2019 14:15:57 +0000 (15:15 +0100)]
Fix T60597, T60806: Cycles crash rendering principled BSDF + volume interior.

The integrator maximum number of closures was not set properly for the CPU/mega
kernels to match the actual available memory. Before relatively recent code
refactoring we did not use this value in those kernels so it worked fine.

2 months agoChange default displacement method to bump mapping again.
Brecht Van Lommel [Thu, 24 Jan 2019 14:15:57 +0000 (15:15 +0100)]
Change default displacement method to bump mapping again.

Even though it makes sense logically to have displacement actually displace
the mesh, this is causing a lot of confusion for existing users that are used
to the previous behavior. Further, since Eevee does not support displacement
yet and the discrepancy between the viewport and final render is problematic.

2 months agoCleanup: add clarifying comments for recent NUMA fixes
Brecht Van Lommel [Mon, 21 Jan 2019 09:51:19 +0000 (10:51 +0100)]
Cleanup: add clarifying comments for recent NUMA fixes

2 months agoFix T60585: Cycles not using all cores on threadripper, after recent changes.
Brecht Van Lommel [Fri, 18 Jan 2019 18:15:38 +0000 (19:15 +0100)]
Fix T60585: Cycles not using all cores on threadripper, after recent changes.

2 months agoCast to correct base type when checking requested features
Lukas Stockner [Fri, 18 Jan 2019 01:56:59 +0000 (02:56 +0100)]
Cast to correct base type when checking requested features

2 months agoReport whether camera was detected inside volume or not
Sergey Sharybin [Wed, 16 Jan 2019 13:51:30 +0000 (14:51 +0100)]
Report whether camera was detected inside volume or not

2 months agoCleanup: add begin/end iterators to Cycles NodeEnum
Alex Fuller [Mon, 14 Jan 2019 14:42:54 +0000 (15:42 +0100)]
Cleanup: add begin/end iterators to Cycles NodeEnum

Differential Revision: https://developer.blender.org/D4173

2 months agoFix Cycles node definition typos and incorrect enum value
Alex Fuller [Mon, 14 Jan 2019 14:41:24 +0000 (15:41 +0100)]
Fix Cycles node definition typos and incorrect enum value

Differential Revision: https://developer.blender.org/D4174

2 months agoFix T60450: Cycles broken GPU denoising after recent changes
Brecht Van Lommel [Mon, 14 Jan 2019 10:42:38 +0000 (11:42 +0100)]
Fix T60450: Cycles broken GPU denoising after recent changes

2 months agoFix T60145: Cycles resets manually set affinity
Sergey Sharybin [Fri, 11 Jan 2019 16:55:36 +0000 (17:55 +0100)]
Fix T60145: Cycles resets manually set affinity

This change brings back old original logic which was checking
whether worker threads do fit into an active CPU group. But
it does it a bit smarter now and is also checking affinity
within that group. This way Cycles will use all threads on a
Threadripper2 CPU if it's set to automatic number of threads,
but on another hand will not change affinity if user requested
16 threads and changed Blender affinity.

2 months agoFix T60227: Crash when Cycles uses more than system threads
Sergey Sharybin [Fri, 11 Jan 2019 14:01:54 +0000 (15:01 +0100)]
Fix T60227: Crash when Cycles uses more than system threads

Tweaked scheduling so it survives this situation by scattering
"extra" threads uniformly over all the NUMA nodes.

There are still tweaks possible to make some specific hardware
configurations work better.

2 months agoFix T60320: Cycles OpenCL denoising filter errors on some drivers.
Brecht Van Lommel [Fri, 11 Jan 2019 10:12:38 +0000 (11:12 +0100)]
Fix T60320: Cycles OpenCL denoising filter errors on some drivers.

2 months agoFix Cycles viewport render doing some unnecessary work at the start.
Brecht Van Lommel [Wed, 9 Jan 2019 15:57:01 +0000 (16:57 +0100)]
Fix Cycles viewport render doing some unnecessary work at the start.

In some cases it would load adaptive kernels or even start rendering
twice because the first time the scene was not fully synced yet.

2 months agoFix T60300, T57774: Cycles OpenCL viewport crash with subsurface scattering.
Brecht Van Lommel [Wed, 9 Jan 2019 15:38:04 +0000 (16:38 +0100)]
Fix T60300, T57774: Cycles OpenCL viewport crash with subsurface scattering.

2 months agoAdd utility to dump bvh tree as graphviz file
Sergey Sharybin [Tue, 8 Jan 2019 17:17:21 +0000 (18:17 +0100)]
Add utility to dump bvh tree as graphviz file

2 months agoMake bvh wider prior to packing
Sergey Sharybin [Tue, 8 Jan 2019 17:10:32 +0000 (18:10 +0100)]
Make bvh wider prior to packing

This allows to do more non-trivial tree modifications to make
it more dense and more friendly for vectorization.

2 months agoFix T60320: Cycles OpenCL volume rendering error on some drivers.
Brecht Van Lommel [Tue, 8 Jan 2019 14:50:14 +0000 (15:50 +0100)]
Fix T60320: Cycles OpenCL volume rendering error on some drivers.

2 months agoFix T60300: Cycles SSS render hanging with AMD OpenCL
Brecht Van Lommel [Tue, 8 Jan 2019 14:35:54 +0000 (15:35 +0100)]
Fix T60300: Cycles SSS render hanging with AMD OpenCL

2 months agoFix T54962: Cycles crash using subsurface scattering texture blur.
Brecht Van Lommel [Thu, 3 Jan 2019 16:08:46 +0000 (17:08 +0100)]
Fix T54962: Cycles crash using subsurface scattering texture blur.

2 months agoFix T60061: Cycles OSL point density not working
Brecht Van Lommel [Wed, 2 Jan 2019 18:55:26 +0000 (19:55 +0100)]
Fix T60061: Cycles OSL point density not working

Add override keywords so we can detect when the function definitions change.

2 months agoFix (unreported) broken Cycles tests after numaapi changes today.
Bastien Montagne [Thu, 27 Dec 2018 21:38:22 +0000 (22:38 +0100)]
Fix (unreported) broken Cycles tests after numaapi changes today.

Please always build tests when messing with build system/libs, am tired
of fixing that kind of issues...

Also, that fix is probably not working for standalone, no idea where's
the numaapi lib then, but committing since I need a building blender
here (with the tests, yes).

2 months agoFix T59874: Cycles CPU 25% load only during rendering
Sergey Sharybin [Thu, 27 Dec 2018 18:01:19 +0000 (19:01 +0100)]
Fix T59874: Cycles CPU 25% load only during rendering

The issue was introduced by a Threadripper2 commit back in
ce927e15e0e3. This boils down to threads inheriting affinity
from the parent thread. It is a question how this slipped
through the review (we definitely run benchmark round).

Quick fix could have been to always set CPU group affinity
in Cycles, and it would work for Windows. On other platforms
we did not have CPU groups API finished.

Ended up making Cycles aware of NUMA topology, so now we
bound threads to a specific NUMA node. This required adding
an external dependency to Cycles, but made some code there
shorter.

3 months agoFix T59565: NaN/crash with zero radius tip of hair curves
Brecht Van Lommel [Fri, 21 Dec 2018 17:51:13 +0000 (18:51 +0100)]
Fix T59565: NaN/crash with zero radius tip of hair curves

3 months agoCleanup: fix ATTR_FALLTHROUGH warnings
Brecht Van Lommel [Fri, 21 Dec 2018 16:02:04 +0000 (17:02 +0100)]
Cleanup: fix ATTR_FALLTHROUGH warnings

Ref D3960.

3 months agoFixes for recent curve robustness
Sergey Sharybin [Thu, 20 Dec 2018 15:45:38 +0000 (16:45 +0100)]
Fixes for recent curve robustness

The key indices were wrong: need to offset curve key index
by first curve key index. Also corrected calculation of the
interpolation step.

Annoyingly, can not reproduce this on a simple file, need
production rig. For the possible future look the following
file from Spring was used: 03_005_A.lighting.debug.blend

3 months agoUpdate standalone app to OIIO 2.0
Sergey Sharybin [Thu, 13 Dec 2018 13:31:38 +0000 (14:31 +0100)]
Update standalone app to OIIO 2.0

4 months agoUpdate code to be compatible with OIIO 2.0
Sergey Sharybin [Tue, 11 Dec 2018 11:17:26 +0000 (12:17 +0100)]
Update code to be compatible with OIIO 2.0

There are some changes in API of OpenImageIO, but those are quite
simple to keep working with older and newer library versions.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D4064

4 months agoCleanup: remove accidentally committed debug code
Brecht Van Lommel [Tue, 11 Dec 2018 14:18:01 +0000 (15:18 +0100)]
Cleanup: remove accidentally committed debug code

4 months agoAdd strict assert when assigning input socket stack offset
Sergey Sharybin [Tue, 11 Dec 2018 13:34:28 +0000 (14:34 +0100)]
Add strict assert when assigning input socket stack offset

4 months agoRemove old nasty workaround
Sergey Sharybin [Tue, 11 Dec 2018 13:33:24 +0000 (14:33 +0100)]
Remove old nasty workaround

It used to be used for some sort of ignoring automatically
generated bump nodes. But nowadays it causes one of the shaders
in Classroom demo file to be compiled wrong.

4 months agoFix macOS buildbot build, wrong CUDA version check
Brecht Van Lommel [Tue, 11 Dec 2018 13:14:52 +0000 (14:14 +0100)]
Fix macOS buildbot build, wrong CUDA version check

4 months agoCleanup, indentation
Sergey Sharybin [Tue, 11 Dec 2018 11:57:57 +0000 (12:57 +0100)]
Cleanup, indentation

4 months agoDo more user-friendly indication that GPU devices are not found
Sergey Sharybin [Fri, 7 Dec 2018 13:47:35 +0000 (14:47 +0100)]
Do more user-friendly indication that GPU devices are not found

4 months agoDisable OpenCL on macOS
Sergey Sharybin [Fri, 7 Dec 2018 13:37:47 +0000 (14:37 +0100)]
Disable OpenCL on macOS

This is unfortunate, but the number of bugs in this configuration
keeps growing, and almost all of them are caused by bug in OpenCL
compiler.

The compiler is not likely to be fixed, since Apple declared OpenCL
deprecated.

This evil commit is aimed to keep officially supported features
of Blender in a good working and stable state.

4 months agoFix T57963: Cycles crash using AO for displacement
Brecht Van Lommel [Thu, 6 Dec 2018 18:50:05 +0000 (19:50 +0100)]
Fix T57963: Cycles crash using AO for displacement

Note this is not supported, there exists no geometry at this point, but
it should not crash at least.

4 months agoFix (unreported) building Cycles tests with Embree enabled
Bastien Montagne [Wed, 5 Dec 2018 14:14:16 +0000 (15:14 +0100)]
Fix (unreported) building Cycles tests with Embree enabled

4 months agoFix build with old CMake versions
Brecht Van Lommel [Wed, 5 Dec 2018 11:53:08 +0000 (12:53 +0100)]
Fix build with old CMake versions

4 months agoBuildbot: enable support for NVIDIA Turing cards in Cycles (like GTX 20xx).
Brecht Van Lommel [Tue, 4 Dec 2018 10:49:57 +0000 (11:49 +0100)]
Buildbot: enable support for NVIDIA Turing cards in Cycles (like GTX 20xx).

We currently only build the sm_7x kernels with CUDA 10.0, older cards still
use 9.1 until rendering errors are solved for them.

4 months agoadd initial CUDA 10.0 support, but only recommend use for Turing cards.
Brecht Van Lommel [Tue, 4 Dec 2018 11:34:59 +0000 (12:34 +0100)]
add initial CUDA 10.0 support, but only recommend use for Turing cards.

There may still be rendering errors when used for older graphics cards.

4 months agoFix T58600: update OSL scripts to work with OSL 1.10.x
Shane Ambler [Mon, 3 Dec 2018 11:16:30 +0000 (12:16 +0100)]
Fix T58600: update OSL scripts to work with OSL 1.10.x

4 months agoCorrect missing semicolon in recent commit
Campbell Barton [Fri, 30 Nov 2018 06:07:13 +0000 (17:07 +1100)]
Correct missing semicolon in recent commit

4 months agoFix T58183: crash with CPU + GPU rendering after profiling changes.
Brecht Van Lommel [Thu, 29 Nov 2018 22:30:17 +0000 (23:30 +0100)]
Fix T58183: crash with CPU + GPU rendering after profiling changes.

Multi-device was not passing along profiler to the CPU.

4 months agoCleanup: trailing space
Campbell Barton [Thu, 29 Nov 2018 21:38:25 +0000 (08:38 +1100)]
Cleanup: trailing space

4 months agoFix internal compiler error when building with VS 2017 (15.9.3).
Brecht Van Lommel [Thu, 29 Nov 2018 15:41:10 +0000 (16:41 +0100)]
Fix internal compiler error when building with VS 2017 (15.9.3).

It doesn't like alignment for function arguments, and I don't think this
alignment is needed.

Solution found by Ray Molenkamp.

4 months agoAdd sample-based runtime profiler that measures time spent in various parts of the...
Lukas Stockner [Thu, 29 Nov 2018 01:06:30 +0000 (02:06 +0100)]
Add sample-based runtime profiler that measures time spent in various parts of the CPU kernel

This commit adds a sample-based profiler that runs during CPU rendering and collects statistics on time spent in different parts of the kernel (ray intersection, shader evaluation etc.) as well as time spent per material and object.

The results are currently not exposed in the user interface or per Python yet, to see the stats on the console pass the "--cycles-print-stats" argument to Cycles (e.g. "./blender -- --cycles-print-stats").

Unfortunately, there is no clear way to extend this functionality to CUDA or OpenCL, so it is CPU-only for now.

Reviewers: brecht, sergey, swerner

Reviewed By: brecht, swerner

Differential Revision: https://developer.blender.org/D3892

4 months agoCMake: Remove Cycles specific OpenSubdiv options
Sergey Sharybin [Mon, 26 Nov 2018 10:41:38 +0000 (11:41 +0100)]
CMake: Remove Cycles specific OpenSubdiv options

Just use one flag which enables OpenSubdiv globally for all the
areas of Blender.

4 months agoCleanup: trailing space
Campbell Barton [Sat, 24 Nov 2018 21:01:14 +0000 (08:01 +1100)]
Cleanup: trailing space

4 months agoFixed a warning
Stefan Werner [Fri, 23 Nov 2018 12:47:25 +0000 (13:47 +0100)]
Fixed a warning

4 months agoImproved robustness of hair motion blur
Stefan Werner [Fri, 23 Nov 2018 12:21:55 +0000 (13:21 +0100)]
Improved robustness of hair motion blur

In some instances, the number of control vertices of a hair could change mid-frame.
Cycles would then be unable to calculate proper motion blur for those hairs. This adds
interpolated CVs to fill in for the missing data. While this will not necessarily result in
a fully accurate reconstruction of the guide hair, it preserves motion blur instead of disabling it.

Reviewers: #cycles, sergey

Reviewed By: #cycles, sergey

Subscribers: sergey, brecht, #cycles

Tags: #cycles

Differential Revision: https://developer.blender.org/D3695

4 months agoFix T57811: Render crashes in certain scenes when AO Bounces are used
Sergey Sharybin [Wed, 21 Nov 2018 13:17:26 +0000 (14:17 +0100)]
Fix T57811: Render crashes in certain scenes when AO Bounces are used

4 months agoCleanup, use utility function
Sergey Sharybin [Wed, 21 Nov 2018 12:51:18 +0000 (13:51 +0100)]
Cleanup, use utility function

Replaces inlined platform-specific code.

4 months agoCleanup, reduce indentation level
Sergey Sharybin [Wed, 21 Nov 2018 11:23:54 +0000 (12:23 +0100)]
Cleanup, reduce indentation level

4 months agoCleanup, comments and dead code
Sergey Sharybin [Wed, 21 Nov 2018 10:33:11 +0000 (11:33 +0100)]
Cleanup, comments and dead code

4 months agoCleanup, CUDA code path is not possible inside AVX2
Sergey Sharybin [Wed, 21 Nov 2018 10:28:49 +0000 (11:28 +0100)]
Cleanup, CUDA code path is not possible inside AVX2

4 months agoCleanup, code style
Sergey Sharybin [Thu, 15 Nov 2018 16:16:40 +0000 (17:16 +0100)]
Cleanup, code style

4 months agoFix/workaround for gcc-7.2
Sergey Sharybin [Mon, 12 Nov 2018 11:10:33 +0000 (12:10 +0100)]
Fix/workaround for gcc-7.2

For some reason when building with gcc-7.2 (which is default
in previous Ubuntu LTS) the guarded allocator is not being
properly instantiated.

Doesn't happen with newer version of gcc-7 which is 7.3, and
also doesn't happen with gcc-6 and gcc-8.

Would be nice to know what is wrong, but for the time being
committing workaround which keeps Blender users happy.

4 months agoProper comment for closing header guard
Sergey Sharybin [Mon, 12 Nov 2018 10:02:10 +0000 (11:02 +0100)]
Proper comment for closing header guard

4 months agoRevert "Cycles: Cleanup, move Embree BVH logic to own file"
Sergey Sharybin [Fri, 9 Nov 2018 16:54:09 +0000 (17:54 +0100)]
Revert "Cycles: Cleanup, move Embree BVH logic to own file"

While we shouldn't have logic in an entry point, and since one should
not be making typos when moving lines around, there is bigger entanglement
issue with BVH host code using kernel function. This is bad violation,
but is tricky to get solved moments before the weekly.

In order to keep things in a (less) broken state than before own cleanup
reverting the changes.

This reverts commit 2bad10be96540ff50a149230d656e599775b3f47.
This reverts commit ddabb21d0584e9874e8e5c62c04abe496ec7334b

4 months agoCleanup, remove unused method declaration
Sergey Sharybin [Fri, 9 Nov 2018 14:21:19 +0000 (15:21 +0100)]
Cleanup, remove unused method declaration

Was never defined. If it's really needed, consider using `const string&`.

4 months agoCycles; Cleanup, line length
Sergey Sharybin [Fri, 9 Nov 2018 11:31:46 +0000 (12:31 +0100)]
Cycles; Cleanup, line length

There are some more sanitization which would be cool to be done
in the neighbourhood of those functions, but that could also happen
later.

4 months agoCleanup, move Embree BVH logic to own file
Sergey Sharybin [Fri, 9 Nov 2018 11:28:55 +0000 (12:28 +0100)]
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.

4 months agoCleanup, indentation in preprocessor
Sergey Sharybin [Fri, 9 Nov 2018 11:12:11 +0000 (12:12 +0100)]
Cleanup, indentation in preprocessor

4 months agoCleanup, indentation
Sergey Sharybin [Fri, 9 Nov 2018 11:10:48 +0000 (12:10 +0100)]
Cleanup, indentation

4 months agoCleanup, space after (void)
Sergey Sharybin [Fri, 9 Nov 2018 11:08:51 +0000 (12:08 +0100)]
Cleanup, space after (void)

It was used in like 95% of places.

4 months agoCleanup, don't use strict C prototypes
Sergey Sharybin [Fri, 9 Nov 2018 11:01:38 +0000 (12:01 +0100)]
Cleanup, don't use strict C prototypes

Those are more like a legacy of language, which is not
needed in C++.

4 months agoCleanup, split array from vector
Sergey Sharybin [Fri, 9 Nov 2018 10:54:24 +0000 (11:54 +0100)]
Cleanup, split array from vector

Those are similar but different types, no reason to keep
their definitions in a single file.

4 months agoCleanup, some documentation
Sergey Sharybin [Fri, 9 Nov 2018 10:46:09 +0000 (11:46 +0100)]
Cleanup, some documentation

4 months agoCleanup, remove unneeded manual constructors specification
Sergey Sharybin [Fri, 9 Nov 2018 10:44:33 +0000 (11:44 +0100)]
Cleanup, remove unneeded manual constructors specification

4 months agoCleanup, remove unneeded method from vector
Sergey Sharybin [Fri, 9 Nov 2018 10:37:56 +0000 (11:37 +0100)]
Cleanup, remove unneeded method from vector

Since we've defaulted to C++11, no need to override this
method manually anymore.

4 months agoCleanup, spacing after preprocessor
Sergey Sharybin [Fri, 9 Nov 2018 10:34:54 +0000 (11:34 +0100)]
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.

4 months agoFix build on 32bit after Embree changes
Brecht Van Lommel [Thu, 8 Nov 2018 13:48:54 +0000 (14:48 +0100)]
Fix build on 32bit after Embree changes

4 months agoWrite Cryptomatte metadata according to the specification
Lukas Stockner [Wed, 7 Nov 2018 03:05:47 +0000 (04:05 +0100)]
Write Cryptomatte metadata according to the specification

Reviewers: brecht, sergey, swerner

Subscribers: creamsurfer, Tanguy, Noss, SteffenD

Differential Revision: https://developer.blender.org/D3862

4 months agoRearranged macros in kernel_types.h to fix Embree build.
Stefan Werner [Wed, 7 Nov 2018 14:20:24 +0000 (15:20 +0100)]
Rearranged macros in kernel_types.h to fix Embree build.

4 months agoFix build with OSL, remove unneeded file after Embree changes.
Brecht Van Lommel [Wed, 7 Nov 2018 12:29:20 +0000 (13:29 +0100)]
Fix build with OSL, remove unneeded file after Embree changes.

4 months agoFixed a warning
Stefan Werner [Wed, 7 Nov 2018 13:04:22 +0000 (14:04 +0100)]
Fixed a warning

4 months agoFixed OpenCL render after the Embree checkin
Stefan Werner [Wed, 7 Nov 2018 12:53:56 +0000 (13:53 +0100)]
Fixed OpenCL render after the Embree checkin

4 months agoAdded Embree as BVH option for CPU renders
Stefan Werner [Wed, 7 Nov 2018 11:58:12 +0000 (12:58 +0100)]
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

4 months agoFix assert rendering hair tests on some systems
Brecht Van Lommel [Sun, 4 Nov 2018 19:25:57 +0000 (20:25 +0100)]
Fix assert rendering hair tests on some systems