Commit Graph

9345 Commits

Author SHA1 Message Date
Stefan Werner
811569dc11 Cycles: Using OpenCL popcount() in PMJ sampler. 2020-03-10 08:53:30 +01:00
Johan Walles
8bc8713beb Cleanup: avoid (harmless) race condition reported by Helgrind
Differential Revision: https://developer.blender.org/D7058
2020-03-09 17:11:24 +01:00
Brecht Van Lommel
81c18c2507 Fix part of T73921: hang with Eevee light baking and Mantaflow
Now it crashes instead.
2020-03-09 17:11:24 +01:00
Stefan Werner
bc6bbe5fac Fix T74537: Fixed out of bounds memory access in Cycles' PMJ sampler. 2020-03-08 21:31:47 +01:00
Sebastián Barschkis
5539b68009 Fluid: Optimization for smoke simulation (multigrid)
The solver will now automatically detect static scenes (no moving obstacles) and use a slightly faster pressure solve in those cases.
2020-03-07 19:57:06 +01:00
946d39f688 UI: move Cycles adaptive sampling settings to own subpanel 2020-03-07 12:40:06 +01:00
Brecht Van Lommel
dcdcc23488 Fix T74504: Cycles wrong progress bar with CPU adaptive sampling 2020-03-06 23:46:58 +01:00
Brecht Van Lommel
b31b44c223 Fix error in Cycles Optix adaptive sampling after recent cleanup 2020-03-06 23:46:58 +01:00
Dalai Felinto
96e2bd8493 Cleanup: Fix forward declaration of headers 2020-03-06 17:26:32 +01:00
Dalai Felinto
c60366c01f Cycles: cleanup warning 2020-03-06 15:27:50 +01:00
Sebastián Barschkis
b4f1edd98b Fluid: Revert bc2ce31d7940 (changes to open boundaries)
Changes from that commit turned out to be unstable.
2020-03-06 15:01:30 +01:00
Brecht Van Lommel
c8ac760c59 Cleanup: tweak Cycles #includes in preparation for clang-format sorting 2020-03-06 14:44:42 +01:00
Campbell Barton
0b16b63d87 Cleanup: spelling 2020-03-07 00:19:01 +11:00
Sebastian Parborg
24a37b3c03 Fix memory leak in the colorio fallback implementation.
We would previously not store the transforms that were added to the
group transform node. This would lead to pointer to allocated memory
being lost and not freed.
2020-03-06 12:29:12 +01:00
Julian Eisel
c72317943b Attempt to fix build errors on macOS
Mistake in 5be0e3430d13
2020-03-06 11:43:13 +01:00
Campbell Barton
5be0e3430d GHOST/Keymap: support for detecting repeat events
- Keymap items now have 'repeat' boolean which can be set
  to make keymap items respond to key repeat events or not.
- Support for X11 & WIN32 (not macOS currently).

This allows for the possibility to perform actions while a key is held
and finish the action upon release.

Thanks to @Severin for review and WIN32 support.
2020-03-06 17:31:28 +11:00
Campbell Barton
8574d68aa0 Cleanup: spelling 2020-03-06 11:52:32 +11:00
Julian Eisel
3b1ef223ba Ghost: Support drawing OpenGL framebuffers into a DirectX 11 buffer
Adds a minimal DirectX 11 Ghost context, plus some shared DirectX-OpenGL
resource interface using the NV_DX_interop2 WGL extension. From what I
know, this should be available on modern GPUs. If not, it should fail
gracefully.
There should be no user visible changes at this point.

Needed for DirectX-only OpenXR platforms (e.g. Windows Mixed Reality). I
heard there are other use-cases as well though.

It's known that this currently fails on some AMD systems, but that seems
to be fixable.

Most of this comes from the 2019 GSoC project, "Core Support of Virtual
Reality Headsets through OpenXR"
(https://wiki.blender.org/wiki/User:Severin/GSoC-2019/).

Reviewed by: Jeroen Bakker, Ray Molenkam, Brecht van Lommel

Differential Revision: https://developer.blender.org/D6190
2020-03-05 18:29:29 +01:00
Patrick Mours
88db9a17ce Fix T74393: Cycles crashes when both OSL and Optix Denoising are enabled
Enabling viewport denoising causes Cycles to use a multi-device, which always returned NULL when
asked for OSL memory and would subsequently crash. This fixes that by returning the correct OSL
memory pointer from the CPU device in the special viewport denoising multi-device.
2020-03-05 16:28:31 +01:00
Sebastián Barschkis
950a35e353 Fluid: More optimizations in smoke / liquid scripts
Reduced extrapolation distances, no need to extrapolate that far.
2020-03-05 14:22:51 +01:00
Sebastián Barschkis
cd0a6ff5c4 Fluid: Diffusion settings now optional
For optimization purposes these settings need to be enabled explicitly from now on.
2020-03-05 12:36:00 +01:00
Stefan Werner
51e898324d Adaptive Sampling for Cycles.
This feature takes some inspiration from
"RenderMan: An Advanced Path Tracing Architecture for Movie Rendering" and
"A Hierarchical Automatic Stopping Condition for Monte Carlo Global Illumination"

The basic principle is as follows:
While samples are being added to a pixel, the adaptive sampler writes half
of the samples to a separate buffer. This gives it two separate estimates
of the same pixel, and by comparing their difference it estimates convergence.
Once convergence drops below a given threshold, the pixel is considered done.

When a pixel has not converged yet and needs more samples than the minimum,
its immediate neighbors are also set to take more samples. This is done in order
to more reliably detect sharp features such as caustics. A 3x3 box filter that
is run periodically over the tile buffer is used for that purpose.

After a tile has finished rendering, the values of all passes are scaled as if
they were rendered with the full number of samples. This way, any code operating
on these buffers, for example the denoiser, does not need to be changed for
per-pixel sample counts.

Reviewed By: brecht, #cycles

Differential Revision: https://developer.blender.org/D4686
2020-03-05 12:21:38 +01:00
Sebastián Barschkis
4ccbbd3080 Fix T74446: Liquid Inflow Does Not Work
Somehow this was forgotton in the optimization patch a5c4a44df67e.
2020-03-05 11:41:09 +01:00
Aaron Carlisle
ae223ff52b Addons: deprecate 'wiki_url'
When running with debug enabled ('-d' argument),
warnings are printed for add-ons which are not yet updated.

Reminder to name things based on what they do,
not the technologies they use :)
2020-03-05 11:45:22 +11:00
Campbell Barton
5b0f1e7649 Cleanup: formatting, strip trailing space 2020-03-05 08:05:21 +11:00
Sebastián Barschkis
a5c4a44df6 Fluid: Bounding boxes for effector objects
This commit adds bounding box support for emission objects - similarly to flow objects. Before, each effector object had to iterate over the entire domain. Bake times of scenes with multiple obstacles improved significantly with this optimization.

Other improvements that were implemented alongside the bbox feature:
- Option for subframe sampling for effector objects
- Option to enable / disable effectors (can be animated)
- Optimization for static objects. If a flow or effector object does not move and the adaptive domain is not in use, the bake time will be optimized further by reusing the flow / effector grids from the previous frame (no recalculation).
2020-03-04 18:46:48 +01:00
Sebastián Barschkis
3c74d45c9e Fluid: Added sanity grid initializations in smoke / liquid scripts
Just a sanity check.
2020-03-04 18:46:48 +01:00
Sebastián Barschkis
bf8a73b4a7 Fluid: Naming cleanup for flags grid
Use flags instead of obstacle to avoid confusion with obstacle levelset grid.
2020-03-04 18:46:48 +01:00
Sebastián Barschkis
6958ec3f7f Fluid: Added an option to delete fluid inside obstacles
Simple checkbox that - if enabled - will tell the solver to clear density or liquid particles in obstacle cells.
2020-03-04 18:46:48 +01:00
Sebastián Barschkis
b32fd73b24 Fluid: Optimization for extrapolation functions in smoke / liquid scripts
Too much extrapolation can become expensive. Reducing it here since extrapolating levelsets into a couple of cells should be sufficient.
2020-03-04 18:46:48 +01:00
Campbell Barton
a5c984a57d Cleanup: cmake indentation 2020-03-04 11:02:35 +11:00
Stefan Werner
409074aae5 Cycles: add Progressive Multi-Jitter sampling pattern
This sampling pattern is particularly suited to adaptive sampling, and will
be used for that upcoming feature.

Based on "Progressive Multi-Jittered Sample Sequences" by Per Christensen,
Andrew Kensler and Charlie Kilpatrick.

Ref D4686
2020-03-02 16:35:52 +01:00
Charlie Jolly
847c091ae8 Shading: Add invert option to Vector Rotate Node
Checkbox to invert rotation angle, suggested by @simonthommes

Differential Revision: https://developer.blender.org/D6932
2020-03-02 12:49:19 +00:00
Sebastián Barschkis
bc2ce31d79 Fluid: Improved behavior at open boundaries
Use greater boundary width for smoke simulations
2020-02-28 16:20:13 +01:00
Patrick Mours
af54bbd61c Cycles: Rework tile scheduling for denoising
This fixes denoising being delayed until after all rendering has finished. Instead, tile-based
denoising is now part of the "RENDER" task again, so that it is all in one task and does not
cause issues with dedicated task pools where tasks are serialized.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D6940
2020-02-28 16:12:29 +01:00
Patrick Mours
0cea9353fd Fix CUDA out of memory error with OptiX viewport denoising on small GPUs
This makes the memory allocation for the denoiser state use the memory allocator in Cycles, which
will evict textures to host memory when there is not enough space on the device. This means the
allocation for the denoiser state won't just fail if there is no more space and instead more space is
made for it to work. Also simplifies code somewhat.
2020-02-28 15:58:17 +01:00
Sergey Sharybin
bcac081ad5 OpenSubdiv: Allow less topology callbacks assigned
Useful for cases when topology does not need to have any
crease or UV layers. Now instead of assigning callbacks
which returns zero data is possible to simply assign the
callback itself to NULL.
2020-02-28 14:30:49 +01:00
Brecht Van Lommel
f48ad37ef0 Fix T74262: Cycles OpenCL error on some devices after recent changes 2020-02-27 17:38:24 +01:00
Brecht Van Lommel
abc040f26c Build: change libc compatibility code to only be used for new glibc
This way we can still use fast math functions.
2020-02-27 12:52:19 +01:00
Brecht Van Lommel
6d705693a3 Fix Linux CentOS buildbot handing on ffmpeg test
Don't use -ffast-math functions for libc compatibility implementation, since
then the function ends up calling itself. This may not be ideal for performance
but should be insignificant in practice.
2020-02-27 12:30:29 +01:00
Dalai Felinto
01162f756a Fix unreported crash/assert in Cycles with volume render pass in viewport
Bug introduced on e0085bfd24da.
2020-02-27 11:36:49 +01:00
Brecht Van Lommel
9085b7e847 Fix OpenVDB link error on Windows after recent changes 2020-02-26 19:24:20 +01:00
Brecht Van Lommel
d675cf20a1 Cleanup: add ImageKey to avoid longer argument lists and duplicated code 2020-02-26 18:13:14 +01:00
Brecht Van Lommel
78391def6e Cleanup: deduplicate OpenVDB library definitions/include/libs logic
This will more important when we start using OpenVDB in more modules.
2020-02-26 18:13:14 +01:00
Brecht Van Lommel
22abc7f080 Build: add compatibility between precompiled libraries and new glibc
On Linux, precompiled libraries may be made with a glibc version that is
incompatible with the system libraries that Blender is built on. To solve
this we add a few -ffast-math symbols that can be missing.

Differential Revision: https://developer.blender.org/D6930
2020-02-26 18:13:14 +01:00
Campbell Barton
5a6a6ef0c6 Cleanup: spelling 2020-02-26 15:22:46 +11:00
Brecht Van Lommel
c05d83bc76 Fix T74063: Cycles light pass viewport display wrong with saturated colors 2020-02-25 19:52:18 +01:00
Patrick Mours
a93043153a Cleanup: Remove superfluous "cuda_device_ptr" function 2020-02-25 17:13:59 +01:00
Patrick Mours
0c09700f20 Cycles: Add option to change which sample to start viewport denoising at
This patch adds a new user-configurable option to change at which sample viewport
denoising should kick in. Setting it to zero retains previous behavior (start immediately), while
other values will defer denoising until the particular sample has been reached. Default is now
at one, to avoid the weirdness that is AI denoising at small resolutions.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D6906
2020-02-25 15:27:11 +01:00
Clément Foucault
190fd795a9 Overlay: Fix overlays being washed out by render colors
Clamping here might be a bit too much if output is expected to be HDR.
But we don't support HDR atm so clamping is fine.
2020-02-25 13:58:28 +01:00