blender.git
3 months agoFixup for fix for OSX build using a build folder name with spaces
Dalai Felinto [Fri, 1 Mar 2019 20:07:06 +0000 (17:07 -0300)]
Fixup for fix for OSX build using a build folder name with spaces

Bug introduced on: 1f22e3f311e74031c3c01714117d759d3e3de3f1.
This was making regular Mac builds to fail, where they were not failing before.

Tested by William Reynish.

3 months agoFix missing image editor redraw when reloading image through API.
Brecht Van Lommel [Mon, 4 Mar 2019 15:04:24 +0000 (16:04 +0100)]
Fix missing image editor redraw when reloading image through API.

3 months agoFix Cycles animation denoising giving black pixels for some outliers.
Brecht Van Lommel [Mon, 4 Mar 2019 15:01:11 +0000 (16:01 +0100)]
Fix Cycles animation denoising giving black pixels for some outliers.

The denoising code expects the output buffer to be filled with the noisy
image, which was not the case for standalone denoising.

3 months agoFix bad level calls
Sergey Sharybin [Mon, 4 Mar 2019 10:58:37 +0000 (11:58 +0100)]
Fix bad level calls

3 months agoFix T62073: Cycles random hangs rendering with Save Buffers on.
Brecht Van Lommel [Fri, 1 Mar 2019 18:09:17 +0000 (19:09 +0100)]
Fix T62073: Cycles random hangs rendering with Save Buffers on.

3 months agoFix macOS OpenMP build error when using a build folder name with spaces.
Brecht Van Lommel [Thu, 28 Feb 2019 23:25:53 +0000 (00:25 +0100)]
Fix macOS OpenMP build error when using a build folder name with spaces.

Patch by Campbell.

3 months agoFix Cycles animation denoising not working for files on a network drive.
Brecht Van Lommel [Thu, 28 Feb 2019 18:15:40 +0000 (19:15 +0100)]
Fix Cycles animation denoising not working for files on a network drive.

Can't do cross-device renaming, so put temporary file in same folder as
output file.

3 months agoCleanup: prevent future issues with ID.tag overflow, clarify somes names.
Brecht Van Lommel [Tue, 26 Feb 2019 13:14:56 +0000 (14:14 +0100)]
Cleanup: prevent future issues with ID.tag overflow, clarify somes names.

3 months agoCleanup: remove unnecessary assert.
Brecht Van Lommel [Tue, 26 Feb 2019 18:59:51 +0000 (19:59 +0100)]
Cleanup: remove unnecessary assert.

3 months agoCycles: Fix build error
Ray Molenkamp [Tue, 26 Feb 2019 15:32:41 +0000 (08:32 -0700)]
Cycles: Fix build error

introduced by rBdabe5cd31add8aa55b9ad4bce1b591ed4e98f1a1

3 months agoT61971: Compilation Displacement/Background Kernel
Jeroen Bakker [Tue, 26 Feb 2019 13:05:54 +0000 (14:05 +0100)]
T61971: Compilation Displacement/Background Kernel

Displacement and Background kernels are selectively used, but always compiled. This patch will not compile these kernels when they are not needed.

Displacement kernel is only used for true displacement.
Background kernel is only used when there is a (Cycles)Light of type `LIGHT_BACKGROUND`.

Reviewed By: brecht, #cycles

Tags: #cycles

Maniphest Tasks: T61971

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

3 months agoT61576: Do Not (Re-)Compile OpenCL kernels
Jeroen Bakker [Tue, 26 Feb 2019 07:53:47 +0000 (08:53 +0100)]
T61576: Do Not (Re-)Compile OpenCL kernels

The goal of this patch is to have limit the number of times
kernels needs to be compiled and are reused as kernels with
different compile directives can lead to identical same
binaries.

The implementation does this by stripping the compile directives.
and reshuffling kernels so the output is more likely to be the
same.

We focussed on the kernels where it was easy to detect and maintain
(bundle, bake, displace, do_volume and background). More optimizations
could be done but they are probably less obvious.

Merged the data_init and state_buffer_size kernels to split_bundle.

This patch will also remove empty kernels for do_volume and bake
when their features are not enabled.

When using the benchmark files there are less background, bake and
do_volume kernels compiled.

Fix: T61576, T61501, T61466

Reviewed By: brecht, #cycles

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

3 months agoFix T61946: Cycles border render missing samples and crypto metadata.
Brecht Van Lommel [Mon, 25 Feb 2019 18:51:36 +0000 (19:51 +0100)]
Fix T61946: Cycles border render missing samples and crypto metadata.

3 months agoFix T61891: Cycles light use nodes button greyed out.
Brecht Van Lommel [Mon, 25 Feb 2019 09:24:40 +0000 (10:24 +0100)]
Fix T61891: Cycles light use nodes button greyed out.

3 months agomake.bat: Preliminary Visual Studio 2019 support.
Ray Molenkamp [Sat, 23 Feb 2019 03:49:22 +0000 (20:49 -0700)]
make.bat: Preliminary Visual Studio 2019 support.

VS2019 is binary compatible with the existing vc14 libraries and no
new libraries libs are required in svn.

VS2019 support requires cmake 3.14.

VS2019 is still in pre-release state, you are required to explicitly
select the pre-release version by using:

make full 2019pre

3 months agoMake.bat: Fix sub-module detection
Ray Molenkamp [Sat, 23 Feb 2019 03:02:45 +0000 (20:02 -0700)]
Make.bat: Fix sub-module detection

3 months agoFix previous commit
Sergey Sharybin [Fri, 22 Feb 2019 14:52:42 +0000 (15:52 +0100)]
Fix previous commit

Somehow quote got missing the last moment.

3 months agoAlways show version when running in background mode
Sergey Sharybin [Fri, 22 Feb 2019 14:47:54 +0000 (15:47 +0100)]
Always show version when running in background mode

The goal is to make it easy to know which exact blender version
and built was used for a job on a farm. This includes but not
exclusively render farms. But same is handy for simulation tasks
as well.

3 months agoWindows: Use static pthreads library.
Ray Molenkamp [Thu, 21 Feb 2019 21:16:26 +0000 (14:16 -0700)]
Windows: Use static pthreads library.

3 months agoFix T61810: Cycles OpenCL denoising broken after recent changes.
Brecht Van Lommel [Thu, 21 Feb 2019 15:46:42 +0000 (16:46 +0100)]
Fix T61810: Cycles OpenCL denoising broken after recent changes.

3 months agoCycles OpenCL: Motion Blur Compile Directives
Jeroen Bakker [Thu, 21 Feb 2019 12:31:52 +0000 (13:31 +0100)]
Cycles OpenCL: Motion Blur Compile Directives

When using preview rendering through a camera or final rendering
the `scene.render.use_motion_blur` was not respected when building
the compile directives.

This patch will when building the compile directives check if
motion blur is enabled at all. This should lead to more efficient
kernels when no motion blur is needed.

Tags: #cycles

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

3 months agoFix T61802: EXR preview JPEGs don't have the correct color
Sergey Sharybin [Thu, 21 Feb 2019 14:29:02 +0000 (15:29 +0100)]
Fix T61802: EXR preview JPEGs don't have the correct color

Missing color management, probably from the very beginnings of
the OCIO integration.

3 months agoFix: Missing closing brackets in include
Jeroen Bakker [Thu, 21 Feb 2019 13:36:51 +0000 (14:36 +0100)]
Fix: Missing closing brackets in include

3 months agoFix T61733: wrong alpha for sequencer screen, multiply, .. blend modes.
John Quillan [Thu, 21 Feb 2019 12:26:22 +0000 (13:26 +0100)]
Fix T61733: wrong alpha for sequencer screen, multiply, .. blend modes.

It was copying the alpha from the foreground instead of background image,
which is not usually what is needed and inconsistent with the compositor.

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

3 months agoCodestyle: Indentation
Jeroen Bakker [Thu, 21 Feb 2019 07:52:04 +0000 (08:52 +0100)]
Codestyle: Indentation

3 months agoFix: OpenCL Displacement and light sampling
Jeroen Bakker [Thu, 21 Feb 2019 07:11:02 +0000 (08:11 +0100)]
Fix: OpenCL Displacement and light sampling

The bake kernels are also used during mesh displacement and light
importance sampling. We disabled the implementation of these kernels
when baking was not enabled.

3 months agoCycles: Fix uninitialized number of hits
Sergey Sharybin [Wed, 20 Feb 2019 22:15:21 +0000 (23:15 +0100)]
Cycles: Fix uninitialized number of hits

Was happening when looking for all intersections for transparent shadow rays
in the case the ray is degenerate.

Still quesitonable whether we should consider this a transparent or opaque
configuraiton. Ideally, we should prevent such rays from happening, but that
is another vector of debugging.

3 months agoTests: only run OpenGL draw tests on lib/tests/opengl, support symlinks.
Brecht Van Lommel [Wed, 20 Feb 2019 15:03:13 +0000 (16:03 +0100)]
Tests: only run OpenGL draw tests on lib/tests/opengl, support symlinks.

To keep running these tests relatively fast and practical to run often,
running it on all .blend files is a bit much. So now we only run it on
files from this directory.

Additionally this adds supports for following symlinks, so that you can
easily symlinks to other directories if you want to tests extra files
which may have linked libraries.

3 months agoCleanup: fix compiler warning.
Brecht Van Lommel [Wed, 20 Feb 2019 15:32:06 +0000 (16:32 +0100)]
Cleanup: fix compiler warning.

3 months agoCycles OpenCL: Remove OpenCL MegaKernel
Jeroen Bakker [Wed, 20 Feb 2019 13:41:56 +0000 (14:41 +0100)]
Cycles OpenCL: Remove OpenCL MegaKernel

Using OpenCL MegaKernel has been slow and therefore not usefull.
This patch will remove the mega kernel from the OpenCL codebase
and the OpenCLDeviceBase class.

T61736: removal of mega kernel
T61703: baking does not work with mega kernel

Tags: #cycles

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

3 months agoT61463: Separate Baking kernels
Jeroen Bakker [Tue, 19 Feb 2019 15:31:31 +0000 (16:31 +0100)]
T61463: Separate Baking kernels

Cycles OpenCL: Split baking kernels in own program

Fix T61463. Before this patch baking was part of the base kernels. There
are 3 baking kernels that and all 3 uses shader evaluation. Only for one
of these kernels the functionality was wrapped in the __NO_BAKING__
compile directive.

When you start baking this leads to long compile times. By separating
in individual programs will reduce the compile times.

Also wrapped all baking kernels with __NO_BAKING__ to reduce the
compilation times.

Impact on compilation time

    job   |   scene_name    | previous |  new  | percentage
  --------+-----------------+----------+-------+------------
   T61463 | empty           |    10.63 |  7.27 |         32%
   T61463 | bmw             |    17.91 | 14.24 |         20%
   T61463 | fishycat        |    19.57 | 15.08 |         23%
   T61463 | barbershop      |    54.10 | 48.18 |         11%
   T61463 | classroom       |    17.55 | 14.42 |         18%
   T61463 | koro            |    18.92 | 17.15 |          9%
   T61463 | pavillion       |    17.43 | 14.23 |         18%
   T61463 | splash279       |    16.48 | 15.33 |          7%
   T61463 | volume_emission |    36.22 | 34.19 |          6%

Impact on render time

    job   |   scene_name    | previous |   new   | percentage
  --------+-----------------+----------+---------+------------
   T61463 | empty           |    21.06 |   20.54 |          2%
   T61463 | bmw             |   198.44 |  189.59 |          4%
   T61463 | fishycat        |   394.20 |  388.50 |          1%
   T61463 | barbershop      |  1188.16 | 1185.49 |          0%
   T61463 | classroom       |   341.08 |  339.27 |          1%
   T61463 | koro            |   472.43 |  360.70 |         24%
   T61463 | pavillion       |   905.77 |  902.14 |          0%
   T61463 | splash279       |    55.26 |   54.92 |          1%
   T61463 | volume_emission |    62.59 |   39.09 |         38%

I don't have a grounded explanation why koro and volume_emission is this much
faster; I have done several tests though...

Maniphest Tasks: T61463

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

3 months agoT61513: Refactored Cycles Attribute Retrieval
Jeroen Bakker [Tue, 19 Feb 2019 14:41:22 +0000 (15:41 +0100)]
T61513: Refactored Cycles Attribute Retrieval

There is a generic function to retrieve float and float3 attributes
`primitive_attribute_float` and primitive_attribute_float3`. Inside
these functions an prioritised if-else construction checked where
the attribute is stored and then retrieved from that location.

Actually the calling function most of the time already knows where
the data is stored. So we could simplify this by splitting these
functions and remove the check logic.

This patch splits the `primitive_attribute_float?` functions into
`primitive_surface_attribute_float?` and `primitive_volume_attribute_float?`.
What leads to less branching and more optimum kernels.

The original function is still being used by OSL and `svm_node_attr`.

This will reduce the compilation time and render time for kernels.
Especially in production scenes there is a lot of benefit.

Impact in compilation times

    job  |   scene_name    | previous |  new  | percentage
  -------+-----------------+----------+-------+------------
  t61513 | empty           |    10.63 | 10.66 |          0%
  t61513 | bmw             |    17.91 | 17.65 |          1%
  t61513 | fishycat        |    19.57 | 17.68 |         10%
  t61513 | barbershop      |    54.10 | 24.41 |         55%
  t61513 | classroom       |    17.55 | 16.29 |          7%
  t61513 | koro            |    18.92 | 18.05 |          5%
  t61513 | pavillion       |    17.43 | 16.52 |          5%
  t61513 | splash279       |    16.48 | 14.91 |         10%
  t61513 | volume_emission |    36.22 | 21.60 |         40%

Impact in render times

    job  |   scene_name    | previous |  new   | percentage
  -------+-----------------+----------+--------+------------
  61513 | empty           |    21.06 |  20.35 |          3%
  61513 | bmw             |   198.44 | 190.05 |          4%
  61513 | fishycat        |   394.20 | 401.25 |         -2%
  61513 | barbershop      |  1188.16 | 912.39 |         23%
  61513 | classroom       |   341.08 | 340.38 |          0%
  61513 | koro            |   472.43 | 471.80 |          0%
  61513 | pavillion       |   905.77 | 899.80 |          1%
  61513 | splash279       |    55.26 |  54.86 |          1%
  61513 | volume_emission |    62.59 |  61.70 |          1%

There is also a possitive impact when using CPU and CUDA, but they are small.

I didn't split the hair logic from the surface logic due to:

* Hair and surface use same attribute types. It was not clear if it could be
  splitted when looking at the code only.
* Hair and surface are quick to compile and to read. So the benefit is quite
  small.

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

3 months agoFix Cycles OpenCL multithreaded compilation not working on Windows.
Brecht Van Lommel [Tue, 19 Feb 2019 12:48:29 +0000 (13:48 +0100)]
Fix Cycles OpenCL multithreaded compilation not working on Windows.

3 months agoRevert "Cycles: Change OpenCL split kernel to use single program by default"
Jeroen Bakker [Fri, 15 Feb 2019 09:43:26 +0000 (10:43 +0100)]
Revert "Cycles: Change OpenCL split kernel to use single program by default"

This reverts commit c6bf5d47240cebef356276e369881e855dbe7e6d.

Related to D2264: When multi process opencl kernel compilation is in place single-program compiles slower then multi-program. c6bf5d47240cebef356276e369881e855dbe7e6d was created as single-program compiled faster, but this is not the case anymore. So let's revert this change. Production scenes like victor and barbershop even render quicker.

Change in Cycles OpenCL compilation times

>    job    |   scene_name    | compilation_time | render_time
>  Baseline | empty           |            22.73 |       20.63
>  T61514   | empty           |            10.63 |       21.06
>  Baseline | bmw             |            56.44 |      191.00
>  T61514   | bmw             |            17.91 |      198.44
>  Baseline | fishycat        |            59.50 |      393.48
>  T61514   | fishycat        |            19.57 |      394.20
>  Baseline | barbershop      |           212.28 |     1623.53
>  T61514   | barbershop      |            54.10 |     1188.16
>  Baseline | victor          |            67.51 |     1459.80
>  T61514   | victor          |            22.06 |     1381.58
>  Baseline | classroom       |            51.46 |      341.23
>  T61514   | classroom       |            17.55 |      341.08
>  Baseline | koro            |            62.48 |      475.96
>  T61514   | koro            |            18.92 |      472.43
>  Baseline | pavillion       |            54.37 |      903.48
>  T61514   | pavillion       |            17.43 |      905.77
>  Baseline | splash279       |            47.43 |       52.92
>  T61514   | splash279       |            16.48 |       55.26
>  Baseline | volume_emission |           145.22 |       62.38
>  T61514   | volume_emission |            36.22 |       62.59

Reviewers: #cycles, brecht, sergey

Reviewed By: #cycles, brecht

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

3 months agoFix T54504: Cycles wrong backwards compatibility with linked libraries.
Brecht Van Lommel [Sun, 17 Feb 2019 11:27:07 +0000 (12:27 +0100)]
Fix T54504: Cycles wrong backwards compatibility with linked libraries.

The code assumed all datablocks were read from .blend files saved with the
same version. This restructures the Cycles versioning code to take into
account libraries.

3 months agoBlenlib/Windows: Fix Build error with clang.
Ray Molenkamp [Sat, 16 Feb 2019 18:42:55 +0000 (11:42 -0700)]
Blenlib/Windows: Fix Build error with clang.

__cpuid comes from intrin.h which was implicitly included somewhere
for msvc builds, but not for clang.

3 months agoWindows: Fix building with llvm/clang 7.0.1
Ray Molenkamp [Sat, 16 Feb 2019 18:36:19 +0000 (11:36 -0700)]
Windows: Fix building with llvm/clang 7.0.1

For llvm 6 the visual studio integration was 'not great' and we had
our own, which broke when llvm 7.0.1 came out. llvm now has properly
supported integration available on the VS market place hence we can
retire our custom support.

4 months agoCycles: Support multithreaded compilation of kernels
Brecht Van Lommel [Fri, 15 Feb 2019 07:18:38 +0000 (08:18 +0100)]
Cycles: Support multithreaded compilation of kernels

This patch implements a workaround to get the multithreaded compilation from D2231 working.
So far, it only works for Blender, not for Cycles Standalone. Also, I have only tested the Linux codepath in the helper function.
Depends on D2231.

Patch by lukasstockner97, jbakker, brecht

    job    |   scene_name    | compilation_time
----------+-----------------+------------------
    Baseline | empty           |            22.73
    D2264    | empty           |            13.94
    Baseline | bmw             |            56.44
    D2264    | bmw             |            41.32
    Baseline | fishycat        |            59.50
    D2264    | fishycat        |            45.19
    Baseline | barbershop      |           212.28
    D2264    | barbershop      |           169.81
    Baseline | victor          |            67.51
    D2264    | victor          |            53.60
    Baseline | classroom       |            51.46
    D2264    | classroom       |            39.02
    Baseline | koro            |            62.48
    D2264    | koro            |            49.03
    Baseline | pavillion       |            54.37
    D2264    | pavillion       |            38.82
    Baseline | splash279       |            47.43
    D2264    | splash279       |            37.94
    Baseline | volume_emission |           145.22
    D2264    | volume_emission |           121.10

This patch reduced compilation time as the split kernels and base
kernels are compiled in parallel. In cycles debug mode (256) you can set
unmark the opencl single program file, what reduces the compilation time
even further (bmw 17 seconds, barbershop 53 seconds).

Reviewers: brecht, dingto, sergey, juicyfruit, lukasstockner97

Reviewed By: brecht

Subscribers: Loner, jbakker, candreacchio, 3dLuver, LazyDodo, bliblubli

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

4 months agoCleanup: fix compiler warnings.
Brecht Van Lommel [Thu, 14 Feb 2019 18:28:19 +0000 (19:28 +0100)]
Cleanup: fix compiler warnings.

4 months agoFix T61470: incorrect saturation clamping in recent bugfix.
Brecht Van Lommel [Thu, 14 Feb 2019 18:03:59 +0000 (19:03 +0100)]
Fix T61470: incorrect saturation clamping in recent bugfix.

We should clamp the result after multiplication.

4 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.

4 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.

4 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.

4 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.

4 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.

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

4 months agoCycles: backport samples metadata format changes to 2.7.
Sergey Sharybin [Wed, 6 Feb 2019 10:49:41 +0000 (11:49 +0100)]
Cycles: 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.

4 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.

4 months agoCycles: add animation denoising Python operator.
Lukas Stockner [Wed, 6 Feb 2019 11:57:10 +0000 (12:57 +0100)]
Cycles: 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

4 months agoCycles: refactor Blender device settings handling into own file.
Brecht Van Lommel [Wed, 6 Feb 2019 15:15:45 +0000 (16:15 +0100)]
Cycles: refactor Blender device settings handling into own file.

4 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.

4 months agoWindows: refactor GHOST wintab handling.
Brecht Van Lommel [Mon, 14 Jan 2019 18:12:02 +0000 (19:12 +0100)]
Windows: refactor GHOST wintab handling.

This is backporting a change from 2.8, which may help solve crashes when
activating a window. Previously bringTabletContextToFront() would call
tablet API functions with NULL tablet, which may crash on some drivers.

Ref T60811.

4 months agoCycles: animation denoising support in the kernel.
Lukas Stockner [Wed, 6 Feb 2019 13:19:20 +0000 (14:19 +0100)]
Cycles: 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.

4 months agoCycles: tweak outlier detection, preparing for animation denoising.
Lukas Stockner [Wed, 6 Feb 2019 13:42:32 +0000 (14:42 +0100)]
Cycles: tweak outlier detection, preparing for animation denoising.

Ref D3889.

4 months agoCycles: prefilter feature passes separate from denoising.
Lukas Stockner [Wed, 6 Feb 2019 11:42:10 +0000 (12:42 +0100)]
Cycles: 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.

4 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.

4 months agoCleanup: manually remove header text not handled by automation
Campbell Barton [Fri, 1 Feb 2019 14:45:34 +0000 (01:45 +1100)]
Cleanup: manually remove header text not handled by automation

4 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.

4 months agoUpdate submodule hashes, take 2
Sergey Sharybin [Fri, 1 Feb 2019 14:15:37 +0000 (15:15 +0100)]
Update submodule hashes, take 2

4 months agoEnsure submodules point to blender2.7 hashes
Sergey Sharybin [Fri, 1 Feb 2019 13:51:15 +0000 (14:51 +0100)]
Ensure submodules point to blender2.7 hashes

4 months agoCycles: delay CUDA and OpenCL initialization to avoid driver crashes.
Brecht Van Lommel [Tue, 29 Jan 2019 15:39:30 +0000 (16:39 +0100)]
Cycles: 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

4 months agoRevert "3D Text: avoid checking null character's text on path"
Campbell Barton [Tue, 29 Jan 2019 11:50:55 +0000 (22:50 +1100)]
Revert "3D Text: avoid checking null character's text on path"

This reverts commit 8a379e3460048906306042145052d5d7f3bb859c.

Caused T58284

4 months agoFix T60896: Missing update for Auto Texture Space.
Bastien Montagne [Mon, 28 Jan 2019 21:25:26 +0000 (22:25 +0100)]
Fix T60896: Missing update for Auto Texture Space.

4 months agoFix blenderplayer build after OpenMP changes.
Brecht Van Lommel [Mon, 28 Jan 2019 12:04:20 +0000 (13:04 +0100)]
Fix blenderplayer build after OpenMP changes.

4 months agoCleanup: unused struct declarations
Campbell Barton [Mon, 28 Jan 2019 11:15:46 +0000 (22:15 +1100)]
Cleanup: unused struct declarations

4 months agoCleanup: sort forward declarations of enum & struct
Campbell Barton [Mon, 28 Jan 2019 11:08:29 +0000 (22:08 +1100)]
Cleanup: sort forward declarations of enum & struct

Done using:
  source/tools/utils_maintenance/c_sort_blocks.py

4 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.

4 months agoFix T57069: macOS window contents scaling bug.
Brecht Van Lommel [Mon, 28 Jan 2019 10:58:00 +0000 (11:58 +0100)]
Fix T57069: macOS window contents scaling bug.

The cause of this is unclear, but delaying querying the native pixel size
appears to help in the one case I could reproduce.

4 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.

4 months agomacOS: add support for OpenMP, making smoke/fluid/cloth simulations faster.
Arto Kitula [Sat, 26 Jan 2019 13:14:51 +0000 (14:14 +0100)]
macOS: add support for OpenMP, making smoke/fluid/cloth simulations faster.

This bring macOS on par with Windows and Linux. It uses the OpenMP library
added to our precompiled libraries.

Custom flags are set because FindOpenMP from CMake below 3.12 does not support
AppleClang, and more recent versions do not work with our custom directory
location either.

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

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

4 months agoCleanup: sort cmake file lists
Campbell Barton [Thu, 24 Jan 2019 21:30:33 +0000 (08:30 +1100)]
Cleanup: sort cmake file lists

4 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.

4 months agoFix T59175: Compress file isn't working when Load UI is disabled.
Bastien Montagne [Thu, 24 Jan 2019 15:11:53 +0000 (16:11 +0100)]
Fix T59175: Compress file isn't working when Load UI is disabled.

Do not see why flags from loaded file should be skipped when we do not
load UI, this is not related to UI...

Think we can keep flags from file in both cases, should this raise some
other issue we'll just have to fine tune masked flags in each case
separately.

4 months agoCycles: change default displacement method to bump mapping again.
Brecht Van Lommel [Thu, 24 Jan 2019 14:15:57 +0000 (15:15 +0100)]
Cycles: 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.

4 months agoFix T59423: Mesh deform modifier bind bug causing spiky deformations.
mano-wii [Thu, 24 Jan 2019 12:32:28 +0000 (10:32 -0200)]
Fix T59423: Mesh deform modifier bind bug causing spiky deformations.

Same as rBac316a6526c7.
(I should have commited in 2.7 first and then merged in 2.8).

4 months agoAdd font selection to VSE text strips
Richard Antalik [Mon, 14 Jan 2019 05:28:07 +0000 (21:28 -0800)]
Add font selection to VSE text strips

Allows users to select a font for text strips in the video sequence editor.

Related: 3610f1fc43d0 Sequencer: refactor clipboard copy to no longer increase user count.

Reviewed by: Brecht

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

4 months agoSequencer: refactor clipboard copy to no longer increase user count.
Brecht Van Lommel [Fri, 28 Dec 2018 12:37:51 +0000 (13:37 +0100)]
Sequencer: refactor clipboard copy to no longer increase user count.

The clipboard is not a real user and should not be counted. Only on paste
should the user count increase.

This is part of D3621, and was implemented by Richard Antalik and me.

4 months agoGit: add TAGS & tags to .gitignore
gsr b3d [Tue, 22 Jan 2019 11:48:49 +0000 (12:48 +0100)]
Git: add TAGS & tags to .gitignore

Index files used by emacs, vim and others, for autocompletion and
searching; generated by etags, universal-ctags and others.

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

4 months agoFix full compilation after recent passes changes
Sergey Sharybin [Tue, 22 Jan 2019 10:56:03 +0000 (11:56 +0100)]
Fix full compilation after recent passes changes

Was caused by c9eef249.

4 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.

4 months agoFix T60627: Cycles render hanging on Windows with threadripper CPU.
Sergey Sharybin [Fri, 18 Jan 2019 18:45:39 +0000 (19:45 +0100)]
Fix T60627: Cycles render hanging on Windows with threadripper CPU.

4 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.

4 months agoCleanup: remove unnecessary CUDA architecture sm_72, it's for Tegra chips.
Brecht Van Lommel [Fri, 18 Jan 2019 11:38:19 +0000 (12:38 +0100)]
Cleanup: remove unnecessary CUDA architecture sm_72, it's for Tegra chips.

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

4 months agoFix T56799: Custom render passes missing when using Save Buffers
Lukas Stockner [Thu, 17 Jan 2019 23:45:21 +0000 (00:45 +0100)]
Fix T56799: Custom render passes missing when using Save Buffers

The problem here was that when a render result is allocated, the standard render passes are added according to the
pass bitfield. Then, when the render engine sets the result, it adds the additional passes which are then merged
into the main render result.

However, when using Save Buffers, the EXR is created before the actual render starts, so it's missing all those
additional passes.

To fix that, we need to query the render engine for a list of additional passes so they can be added before the EXR
is created. Luckily, there already is a function to do that for the node editor.

The same needs to be done when the EXR is loaded back.

Due to how that is implemented though (Render API calls into engine, engine calls back for each pass), if we have
multiple places that call this function there needs to be a way to tell which one the call came from in the pass
registration callback. Therefore, the original caller now provides a callback that is called for each pass.

4 months agoRender API: Fix detection of duplicate render passes
Lukas Stockner [Thu, 17 Jan 2019 23:40:05 +0000 (00:40 +0100)]
Render API: Fix detection of duplicate render passes

4 months agoBMesh: keep selection history when removing doubles
Campbell Barton [Thu, 17 Jan 2019 01:34:05 +0000 (12:34 +1100)]
BMesh: keep selection history when removing doubles

Auto-merge would loose the active vertex.

4 months agoBMesh: Remove doubles now merges face-flags
Campbell Barton [Thu, 17 Jan 2019 01:32:12 +0000 (12:32 +1100)]
BMesh: Remove doubles now merges face-flags

4 months agoCleanup: variable names
Campbell Barton [Thu, 17 Jan 2019 01:28:02 +0000 (12:28 +1100)]
Cleanup: variable names

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

5 months agoBMesh: prevent weld-verts bmop creating selected+hidden verts/edges
Campbell Barton [Wed, 16 Jan 2019 04:26:16 +0000 (15:26 +1100)]
BMesh: prevent weld-verts bmop creating selected+hidden verts/edges

Related to error exposed by T59640
Would have fixed crash too, but we want to ignore hidden verts.

5 months agoFix T59640: Transform w/ auto-merge & hidden verts crashes
Campbell Barton [Wed, 16 Jan 2019 03:54:52 +0000 (14:54 +1100)]
Fix T59640: Transform w/ auto-merge & hidden verts crashes

5 months agoSequencer: Restore change menu
Sergey Sharybin [Tue, 15 Jan 2019 17:33:37 +0000 (18:33 +0100)]
Sequencer: Restore change menu

It was still used by C-key menu, and is very handy to have
when working on a complex edit files.

Was initially removed by e9d06f086698.

5 months agoCleanup: commas at the end of enums
Campbell Barton [Tue, 15 Jan 2019 12:57:49 +0000 (23:57 +1100)]
Cleanup: commas at the end of enums

Without this clang-format may wrap them onto a single line.

5 months agoCleanup: comment line length (editors)
Campbell Barton [Tue, 15 Jan 2019 12:24:20 +0000 (23:24 +1100)]
Cleanup: comment line length (editors)

Prevents clang-format wrapping text before comments.

5 months agoCleanup: comment line length (blenlib)
Campbell Barton [Tue, 15 Jan 2019 12:15:58 +0000 (23:15 +1100)]
Cleanup: comment line length (blenlib)

Prevents clang-format wrapping text before comments.

5 months agoCleanup: comment line length (creator)
Campbell Barton [Tue, 15 Jan 2019 12:25:45 +0000 (23:25 +1100)]
Cleanup: comment line length (creator)

Prevents clang-format wrapping text before comments.

5 months agoCleanup: comment line length (DNA)
Campbell Barton [Tue, 15 Jan 2019 12:14:35 +0000 (23:14 +1100)]
Cleanup: comment line length (DNA)

Prevents clang-format wrapping text before comments.

5 months agoRevert fix for T48901: Use of XIWarpPointer
Campbell Barton [Tue, 15 Jan 2019 05:44:08 +0000 (16:44 +1100)]
Revert fix for T48901: Use of XIWarpPointer

Xorg's XIWarpPointer doesn't support multi-head display while
XWarpPointer does.

Revert since this is a known TODO in Xorg and setting a custom
xinput matrix seems not to be used often.

Resolves T50383