Commit Graph

9772 Commits

Author SHA1 Message Date
Sergey Sharybin ece54172d0 OpenSubdiv: Use explicit storage for edge sharpness
Similar to previous change in vertex sharpness, explicitly store value
provided by the converter.

Allows to avoid rather fragile check for boundary edges.

Also allows to avoid need in constructing edge map. This lowers memory
footprint of the comparison process and avoids memory allocations
during the comparison (which is an extra benefit from the performance
point of view).
2020-05-27 12:07:16 +02:00
Sergey Sharybin 16aef5dc4a OpenSubdiv: Allow use of regular ordered map 2020-05-27 12:07:16 +02:00
Sergey Sharybin ad4cef38e3 OpenSubdiv: Refactor, move comparison to own file 2020-05-27 12:07:16 +02:00
Sergey Sharybin 614d70a87d OpenSubdiv: Compare sharpness based on converter
This change starts the transition of topology refiner comparison
to compare actual values given by the converter, which will not be
affected by the refinement or face winding synchronization steps.

Currently is only implemented for vertex sharpness, but will be
extended further as followup development.

Fixes T71908: Subdiv: Incorrect topology comparison, leading to poor performance
2020-05-27 12:07:16 +02:00
Sergey Sharybin 717d968fb9 OpenSubdiv: Add explicit storage for mesh topology
The idea is to use this explicit storage for topology comparison rather
than using base level. While this will have memory overhead it allows
to simplify comparison of such things as:

- Vertex sharpness (where base level from topology refiner will have it
  refined, meaning it will be different from what application requested
  for non-manifold and corner vertices).

- It will allow to simplify face-vertices comparison, where currently
  O(N^2) algorithm is used due to possible difference in face winding.

- It will also allow to avoid comparison-time allocation of edge map.

Currently no functional changes, just preparing for development which
will happen next.
2020-05-27 12:07:16 +02:00
Sergey Sharybin 5d8515ed86 OpenSubdiv: Add move semantic to the namespace 2020-05-27 12:07:16 +02:00
Sergey Sharybin b5ef644ef6 OpenSubdiv: Refactor, pass higher level object through comparison 2020-05-27 12:07:16 +02:00
Sergey Sharybin 444ca1a117 OpenSubdiv: Refactor, move utils to base
Also split them across utilities and types.
2020-05-27 12:07:16 +02:00
Sergey Sharybin 39cf673132 OpenSubdiv: Refactor, move base C-API file to base folder 2020-05-27 12:07:16 +02:00
Sergey Sharybin 98197343e8 OpenSubdiv: Cleanup, use C++ range based loop
Avoid indirection via define.
2020-05-27 12:07:16 +02:00
Sergey Sharybin be03a756e5 OpenSubdiv: Cleanup, move utility function to base type conversion 2020-05-27 12:07:16 +02:00
Sergey Sharybin 0ff665e4ce OpenSubdiv: Refactor, move type conversion to base fodler 2020-05-27 12:07:16 +02:00
Sergey Sharybin 4886a704b3 OpenSubdiv: Refactor, move evaluator to own folder 2020-05-27 12:07:16 +02:00
Sergey Sharybin 6fc9d106ad OpenSubdiv: Completely disable topology verification
Previously it was enabled for debug builds, now it is to be enabled
explicitly.

The reason for this is to reduce overhead when debugging other areas
which might involve subdivision surface. When conversion is to be
debugged set this manually in the code.
2020-05-27 12:07:16 +02:00
Sergey Sharybin 0d089ce881 OpenSubdiv: Refactor, move edge map to base folder 2020-05-27 12:07:16 +02:00
Sergey Sharybin 4ab36c4393 OpenSubdiv: Refactor creation of topology refiner
Consolidate it inside of the topology refiner implementation class,
which would allow to store extra data acquired during construction
of the OpenSubdiv's object.
2020-05-27 12:07:15 +02:00
Sergey Sharybin 57aae2a355 OpenSubdiv: Refactor, use C++ allocation for internal classes
Only use OBJECT_GUARDED_{NEW. DELETE} for structures which are part of
public C-API (and hence can not have new/delete operators overloaded).

Could try being brave and override new/delete from under C++ ifdef.
2020-05-27 12:07:15 +02:00
Sergey Sharybin c81a5f58f8 OpenSubdiv: Refactor, move topology refiner factory to topology folder 2020-05-27 12:07:15 +02:00
Sergey Sharybin 67fe31d751 OpenSubdiv: Refactor, move topology refiner to own folder
In the future factory will also be moved there.
2020-05-27 12:07:15 +02:00
Sergey Sharybin 7c0bea0d65 OpenSubdiv: Refactor, move device specific code to own files
Also, move all device files to own folder.

Makes it so checks for device availability are done in a localized
place.
2020-05-27 12:07:15 +02:00
Stefan Werner ecc15c55d4 Cycles: Upgraded Embree to version 3.10.0
Enabled round linear hair in Embree.

Differential Revision: https://developer.blender.org/D7623
2020-05-27 10:10:18 +02:00
Campbell Barton 6c1cf395f2 Cleanup: remove unnecessary copy constructor
Caused deprecated-copy warnings as it wasn't used.
2020-05-27 11:50:54 +10:00
Philipp Oeser e790f1a8dc Merge branch 'blender-v2.83-release' 2020-05-26 14:24:50 +02:00
Brecht Van Lommel 9f1f7ba2bb Fix T76925: more Cycles OpenCL compile errors with some drivers on Linux 2020-05-25 17:06:10 +02:00
Antony Ryakiotakis 08c1f5bf33 Cycles: Improve sampling of area lights
This patch uses the sampling method described in "A Low Distortion Map Between Triangle and Square" by Eric Heitz.
The benefit is avoiding sqrt in the calculation, which could be cheaper on some architectures, and the result is
more even sampling across the triangle surface.

Based on ideas from
https://pharr.org/matt/blog/2019/02/27/triangle-sampling-1.html
https://pharr.org/matt/blog/2019/03/13/triangle-sampling-1.5.html

Reviewed By: Brecht Van Lommel

Differential Revision: https://developer.blender.org/D6566
2020-05-23 14:21:49 +02:00
Brecht Van Lommel 86fa8dc7f7 Merge branch 'blender-v2.83-release' 2020-05-22 22:59:02 +02:00
Brecht Van Lommel f27e122d95 Fix T76925: Cycles OpenCL compile error with some drivers on Linux 2020-05-22 21:50:24 +02:00
Christian Rauch b87d81be96 Wayland: support key repeat 2020-05-22 18:09:17 +10:00
Christian Rauch fe739f8c26 GHOST: fix GHOST_System::getMilliSeconds()
This wasn't returning milliseconds, causing problems with key repeat.
2020-05-22 18:08:13 +10:00
Campbell Barton ce6fd6b6a2 Fix missing header building with wayland 2020-05-22 16:47:59 +10:00
Clément Foucault 8a0840b0ee Merge branch 'blender-v2.83-release'
# Conflicts:
#	source/blender/draw/engines/eevee/eevee_volumes.c
2020-05-20 22:56:09 +02:00
Jacques Lucke ccf43fe605 Cycles: Fix rendering instanced smoke domain.
The problem was that Cycles would store a pointer to an object in
`DEGObjectIterData->templ_dupli_object`. This pointer was then accessed
when the iterator was already freed.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D7797
2020-05-20 16:53:28 +02:00
Brecht Van Lommel 4f622c9a08 Fix Windows build after recent guardedalloc changes 2020-05-20 00:32:17 +02:00
Brecht Van Lommel 183ba284f2 Cleanup: make guarded memory allocation always thread safe
Previously this would be enabled when threads were used, but threads are now
basically always in use so there is no point. Further, this is only needed for
guarded allocation with --debug-memory which is not performance critical.
2020-05-20 01:03:05 +02:00
Brecht Van Lommel 120e9924c1 Cleanup: remove legacy mmap memory allocation for 32 bit
This helped to go beyond the 4GB limit, but is no longer relevant for 64 bit.
2020-05-20 00:57:41 +02:00
Sebastián Barschkis 0a19b8a5b4 OpenSubdiv: Remove old GPU code
This code was accidentally reintroduced in e73d7d27dc.
2020-05-19 21:35:47 +02:00
Sebastián Barschkis e73d7d27dc Merge branch 'blender-v2.83-release' 2020-05-19 21:23:54 +02:00
Sebastián Barschkis 7bb3d9787e Fix T76812: [Mantaflow] Inflow particles not continuous
Makes use of the new particle skipping option introduced in f25a882955cb.
2020-05-19 21:12:30 +02:00
Jacques Lucke cfb7664d5b Fix: build error due to missing definitions
Reviewers: sergey, brecht

Differential Revision: https://developer.blender.org/D7787
2020-05-19 17:36:40 +02:00
Sebastián Barschkis 338abd6f68 Merge branch 'blender-v2.83-release' 2020-05-19 16:03:24 +02:00
Sebastián Barschkis 0c20fce2f2 Fix T76697: [Mantaflow] mesh generation does not account for some particles
Adapted mesh generation to account for domains with disabled fractionstoo.
2020-05-19 16:02:38 +02:00
Josh Belanich 03fa66d274 Fix T72889: Cycles camera motion blur not usng more than 2 steps
Differential Revision: https://developer.blender.org/D7782
2020-05-19 15:40:56 +02:00
Sebastián Barschkis 4fa1fc29bd Fluid: Cleanup unused variables 2020-05-19 12:33:17 +02:00
Sebastián Barschkis 35f9c3b9a4 Merge branch 'blender-v2.83-release' 2020-05-18 17:35:30 +02:00
Sergey Sharybin 31fc01eecb OIpenSubdiv: Cleanup, move to a better sounding namespace
The code is not only part of C-API, but also implements Blender-specific
glue level implementation.
2020-05-18 17:25:07 +02:00
Sebastián Barschkis 9bc7ea5496 Fix T76814: [Mantaflow] Surface Tension always works
Initialize the curvature grid and compute the laplacian only if the diffusion flag is set.
2020-05-18 17:19:51 +02:00
Sergey Sharybin 2ad5131f77 OpenSubdiv: Cleanyp, remove old GPU code
All parts of drawing (shaders, GL mesh descriptor, material partitioner
and so on) needs to be redone for the draw manager and new OpenSubdiv
library.

Removing untested code which is doomed to be replaced to make localized
refactoring easier.
2020-05-18 17:06:48 +02:00
Sergey Sharybin 22f68f85a4 OpenSubdiv: Cleanup, remove unused topology orientation code
The code was trying to make winding consistent and manifold, same as
OpenSubdiv expects it to.

Unfortunately, the code was having some issues in corner cases so the
winding wasn't really correct.
Fortunately, the latter (compared to when this code was originally
written) supports orientation on OpenSubdiv side.

Removing code which is currently unused in Blender and which had
known issues. Is simple enough to bring the code from Git history
if the functionality is needed in the future.
2020-05-18 17:06:48 +02:00
Sebastian Parborg 27cac4a102 Fix T62422: Baking ray distance do not work
The previous naming scheme for the "selected to active" baking options
lead to confusion and they were not describing what they actually did.

To remedy this, I've added a new settings that does what the older setting implied it did.

Reviewed By: Brecht, Dalai, Andy Davies

Differential Revision: http://developer.blender.org/D7733
2020-05-18 15:50:36 +02:00
Sergey Sharybin 005d04e145 Manta: Cleanup, strict compiler flag
For some reason was only visible with gcc-10 in release builds.

Kind of makes sense since there is no CMake code which removes strict
compiler flag, so deal with strict flags in the code itself.
2020-05-18 11:05:45 +02:00
Ray Molenkamp 5c5a638b57 Fix: Build error with MSVC
A parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax.

Removing the cast seems fine for both MSVC and GCC
2020-05-17 12:22:14 -06:00
Sebastián Barschkis a975cb9207 Fluid: Foundation for new OpenVDB file IO
This commit lays the foundation for support for OpenVDB caching with multiple grids per cache file.
2020-05-17 17:09:28 +02:00
Sebastián Barschkis 0abe5936b7 Fluid: Cleanup namespace std 2020-05-17 17:09:28 +02:00
Brecht Van Lommel d9773edaa3 Cycles: code refactor to bake using regular render session and tiles
There should be no user visible change from this, except that tile size
now affects performance. The goal here is to simplify bake denoising in
D3099, letting it reuse more denoising tiles and pass code.

A lot of code is now shared with regular rendering, with the two main
differences being that we read some render result passes from the bake API
when starting to render a tile, and call the bake kernel instead of the
path trace kernel.

With this kind of design where Cycles asks for tiles from the bake API,
it should eventually be easier to reduce memory usage, show tiles as
they are baked, or bake multiple passes at once, though there's still
quite some work needed for that.

Reviewers: #cycles

Subscribers: monio, wmatyjewicz, lukasstockner97, michaelknubben

Differential Revision: https://developer.blender.org/D3108
2020-05-15 20:25:24 +02:00
Sergey Sharybin 2b36cf3118 Libmv: Fix crash solving when having negative frames
Don't use linear array with frame as an index since it has the
following disadvantages:

- Requires every application to take care of frame remapping, which
  could be way more annoying than it sounds.

- Inefficient from memory point of view when solving part of a footage
  which is closer to the end of frame range.

Using map technically is slower from performance point of view, but
could not feel any difference as the actual computation is way more
complex than access of camera on individual frames.

Solves crash aspect of T72009
2020-05-15 14:59:25 +02:00
Sergey Sharybin 547f50b5e0 Libmv: Add map utility 2020-05-15 11:20:45 +02:00
Sergey Sharybin 6398892121 Libmv: Cleanup, spelling 2020-05-15 11:20:45 +02:00
Lukas Stockner c880e54a95 Cycles: Refactor microfacet BSDFs to remove separate anisotropy code
Since the sampling and evaluation functions handle both cases anyways,
there's not really a point for keeping the distinction in the kernel,
so we might as well cut down the number of CLOSURE_BSDF_MICROFACETs a bit.

Differential Revision: https://developer.blender.org/D7736
2020-05-15 00:52:57 +02:00
Antonio Vazquez 4ac748c099 Merge branch 'blender-v2.83-release' 2020-05-14 19:54:15 +02:00
Tautvydas Andrikys 33ce0cb5a1 Fix T63588: Cycles unnecessarily updates background importance sampling map 2020-05-14 17:56:50 +02:00
Brecht Van Lommel 16d8a683be Fix T73984: unnecessary Cycles viewport updates with object texture coordinates
Remove old code that added extra updates for shaders that have a dependency on
objects. The dependency graph can now tell Cycles when a material is affected by
an object transform.
2020-05-14 17:39:37 +02:00
Clément Foucault bd80c21635 Merge branch 'blender-v2.83-release' 2020-05-14 16:23:24 +02:00
Brecht Van Lommel 97f50c71b9 Fix --debug-cycles printing CUDA devices twice
Reuse the CUDA devices list for Optix device detection.
2020-05-14 16:07:22 +02:00
Jeroen Bakker 236794d07a Merge branch 'blender-v2.83-release' 2020-05-14 14:30:34 +02:00
Jacques Lucke 975c45df9a Cleanup: don't use deprecated exception specifications
Usage of exception specifications is discouraged by the C++ core guidelines.
2020-05-14 11:24:50 +02:00
Christian Rauch c8060a78fd GHOST/wayland: style fix 2020-05-13 23:51:51 +01:00
Christian Rauch a53917152e GHOST/wayland: fix cursor buffer deallocation 2020-05-13 23:13:48 +01:00
Christian Rauch bd3c842c56 GHOST/wayland: remove unused 'registry' 2020-05-13 23:13:48 +01:00
Sebastián Barschkis 9db08b77e4 Fluid: Fix for refactor 99ee1de094
Fix incorrect file IO functions.
2020-05-13 13:05:01 +02:00
Christian Rauch 75e989dab6 GHOST: fix cursor buffer handling when toggling visibility 2020-05-12 23:05:24 +01:00
Brecht Van Lommel 5ca1eb96c7 Merge branch 'blender-v2.83-release' 2020-05-12 21:57:04 +02:00
Brecht Van Lommel bfdb27f494 Fix incorrect assert in Cycles node socket get/set functions
Thanks to Subrahmanya Oruganti for spotting these.
2020-05-12 21:50:49 +02:00
Campbell Barton f7715b3337 Merge branch 'blender-v2.83-release' 2020-05-12 22:10:21 +10:00
Campbell Barton 65381e220e Fix T76507: Reading clipboard blocks keyboard input on X11 2020-05-12 22:09:11 +10:00
Jacques Lucke 0c1b1e734e Merge branch 'blender-v2.83-release' 2020-05-12 12:21:16 +02:00
Jacques Lucke a50c131a0d Fix T75889: Cannot bake mantaflow via Python API
The issue was the usage of the global `__main__` Python module.
When running scripts in the text editor, Blender would overwrite
the `__main__` module.

Reviewers: sebbas

Differential Revision: https://developer.blender.org/D7690
2020-05-12 12:18:09 +02:00
Jacques Lucke 2008bcb0bb Fluid: remove special treatment for running Python code on windows
We discussed this in D7690 and could not find a reason for this
code anymore. It might just be leftover from some even older code.
2020-05-12 12:18:09 +02:00
Campbell Barton 9b02415ec8 Cleanup: doxy comments 2020-05-09 17:36:12 +10:00
Sebastián Barschkis 385559843e Fluid: Adjusted secondary particles timestep and gravity options
Secondary particles are now compatible with the new gravity setup.
2020-05-08 16:59:11 +02:00
Sebastián Barschkis 18f833be29 Additional fix for T76426: Mantaflow Liquid - Gravity not respecting Time Scale from domain.
Removed time scale from another conversion factor. See also changes from 6400f54b4c.
2020-05-08 13:11:39 +02:00
Aaron Carlisle b4d50d3f07 Cleanup: Doxygen: fix markup warnings for links 2020-05-07 23:43:19 -04:00
Sebastián Barschkis ab122c73ba Fluid: Use cached value for total time value
The old time_total initialization was in trouble if scenes made use of a variable framelength (e.g. by animating the time scale parameter).
2020-05-07 17:33:35 +02:00
Sebastián Barschkis 6400f54b4c Fix T76426: Mantaflow Liquid - Gravity not respecting Time Scale from domain.
Removed timescale from conversion factor - factors should stay constant even if timescale changes.
2020-05-07 17:33:35 +02:00
Julian Eisel 9b7754883b Merge branch 'blender-v2.83-release' 2020-05-07 14:40:55 +02:00
Nicolas Fauvet 1c0e22b982 VR: Fix OpenXR state freeze on Oculus after taking off HMD
With the Oculus runtime, the VR session would freeze when taking off the HMD
and putting it back on. This was caused by the deletion of graphics resources
too early in the OpenXR state machine, at least for Oculus.
The resources will now only be freed once the session is actually destroyed.

Also fixes an issue where it wasn't possible to stop the session via the UI
when the HMD was taken off.

Reviewed By: Julian Eisel

Differential Revision: https://developer.blender.org/D7635
2020-05-07 14:38:10 +02:00
Jeroen Bakker ed1fb242a8 Fix T76469: OpenCL 1.2 Compilation
Recent changes assumed OpenCL 2.0 platform. This adds a check to see if
we are compiling on an OpenCL 2.0 platform.

Patch was tested on:
* AMD Radeon Pro WX 7100 with amdgpu-pro-19.50-1011208-ubuntu-18.04 drivers
* AMD Vega 64 with amdgpu-pro-20.10-1048554-ubuntu-18.04 drivers
* AMD RX 5700 with amdgpu-pro-20.10-1048554-ubuntu-18.04 drivers

Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D7637
2020-05-07 14:34:50 +02:00
Nicolas Fauvet 6e0540671c VR: Fix OpenXR state freeze on Oculus after taking off HMD
With the Oculus runtime, the VR session would freeze when taking off the HMD
and putting it back on. This was caused by the deletion of graphics resources
too early in the OpenXR state machine, at least for Oculus.
The resources will now only be freed once the session is actually destroyed.

Also fixes an issue where it wasn't possible to stop the session via the UI
when the HMD was taken off.

Reviewed By: Julian Eisel

Differential Revision: https://developer.blender.org/D7635
2020-05-07 14:28:28 +02:00
Julian Eisel 45adcc51b2 macOS: Remove workaround for old quit dialog
Got added in 1a30e52142 (and tweaked in follow-ups) but shouldn't be needed
anymore with the newer popup based quit dialog.

It prevents Blender from quitting properly in case macOS closed all Blender
windows. This may happen in some corner-cases unfortunately (e.g. T74101) which
would be nice to have addressed at some point. Until then, users shouldn't have
to force-kill Blender to shut it down if they run into this.
2020-05-07 13:55:14 +02:00
Campbell Barton 8b74d6673a Fix num-pad access on wayland
Always interpret keypad keys as if numpad is enabled,
this matches other platforms.

Also add missing quote key.
2020-05-06 11:10:29 +10:00
Christian Rauch 4af9578ab7 Fix T76429: GHOST/Wayland event's don't correspond to physical keys 2020-05-06 10:20:32 +10:00
Campbell Barton 39ea222339 Cleanup: warnings 2020-05-06 08:18:00 +10:00
Brecht Van Lommel e7470c9dbe Merge branch 'blender-v2.83-release' 2020-05-05 15:14:09 +02:00
Brecht Van Lommel d97c83712c Cycles: mark CUDA 10.2 as officially supported
It appears to work fine after a recent bugfix and testing for the past few
weeks.
2020-05-05 15:06:49 +02:00
Campbell Barton 65194dc71a Cleanup: clang-format
Minor difference caused by clang-format v10.0
2020-05-05 16:06:12 +10:00
Campbell Barton 75be3bc4b9 Merge branch 'blender-v2.83-release' 2020-05-05 13:46:58 +10:00
Brecht Van Lommel ac6be6759e Fix Cycles Python error when device name is not a valid UTF-8 string
This may fix or help diagnose T76378.
2020-05-04 23:07:01 +02:00
Sebastián Barschkis 375a50dad9 Merge branch 'blender-v2.83-release' 2020-05-04 18:18:15 +02:00
Sebastián Barschkis 8b5868cc15 Fix T75883: Smoke simulations with Adaptive Domain broken for 'Final' bakes with OpenVDB in 2.83
Config files always use the .uni extenstion.
2020-05-04 18:16:09 +02:00
Sebastián Barschkis 6ea71cb104 Fluid: Fix for refactor 99ee1de094
Use booleans instead of 0 / 1 in Python
2020-05-04 13:39:05 +02:00
Sebastián Barschkis 70fe988dc4 Fluid: Cleanup use of std in MANTA wrapper
Moved std namespace to beginning of class.
2020-05-03 21:10:52 +02:00
Sebastián Barschkis 82f9ed9305 Fluid: Cleanup in main MANTA wrapper
Use shorter variable names.
2020-05-03 21:10:52 +02:00
Sebastián Barschkis 99ee1de094 Fluid: Refactored 'Modifier Data to Python' value transfer function
This function needed a bigger cleanup, especially after the problem from T76276.
2020-05-03 21:10:51 +02:00
Campbell Barton 6a0cb48149 GHOST: cleanup platform checks, fix Wayland + X11
- Building with Wayland + X11 missed an exception include.
- Move HEADLESS check first, since it's the same on all platforms.
2020-05-03 20:24:24 +10:00
Brecht Van Lommel 83304e4c22 Merge branch 'blender-v2.83-release' 2020-05-01 23:55:13 +02:00
Brecht Van Lommel bba11c68c4 Fix T75995: Cycles render artifacts with overlapping volumes
This is a workaround, but a proper solution requires significant changes to
ray intersection in the kernel.
2020-05-01 23:42:42 +02:00
Brecht Van Lommel 805a78e396 Cleanup: compiler warning with clang 10 2020-05-01 22:58:57 +02:00
Nikhil Shringarpurey 51aa0ea58f Fx build error with MSBuild on Windows
Differential Revision: https://developer.blender.org/D7587
2020-05-01 22:03:26 +02:00
Julian Eisel 4cc8123377 UI: Use property split layout and decorators for material properties
Use the automatic property split layout (hence, change to the new 40/60% split
ratio) and add decorator buttons for animatable properties.
This actually applies to all node input buttons in the properties, e.g. world shading,
light shading, texture nodes.

Doing this makes the layout more consistent with other layouts in the
properties. But the decorators are also a useful hint for users that these
options can be animated. Previously using decorators and the automatic split
layout wasn't possible, I've done a number of changes now to have it supported.
Before I moved the socket icons to the left side, the decorators also looked
weird (two circle icons next to each other).

{F8497704} With nested items: {F8497708}

Reviewed By: William Reynish, Pablo Vazquez

Differential Revision: https://developer.blender.org/D7544
2020-05-01 15:21:41 +02:00
Campbell Barton d7d140ec7f CMake: add WITH_GHOST_X11 option
- Support building only with Wayland.
- In this case, show useful error messages
  when Wayland fails to load.
2020-05-01 20:07:01 +10:00
Campbell Barton e28d2e5184 Cleanup: duplicate include, define from Wayland patch 2020-05-01 19:28:43 +10:00
Campbell Barton 7ded7610ce Cleanup: rename WITH_X11 to WITH_GHOST_X11
Matches WITH_GHOST_{SDL|WAYLAND}
2020-05-01 19:14:50 +10:00
Christian Rauch 47fea20dc8 GHOST: set the window state on wayland startup 2020-05-01 18:43:11 +10:00
Sebastián Barschkis 713ad9d971 Fix T76276: Compiler Error C1061 due to too many nested if/else in MANTA_main.cpp
The compiler error should be fixed by removing the 'else if' blocks. However, this function should still be refactored in the future.
2020-04-30 20:54:53 +02:00
Patrick Mours f4b020eec3 Merge branch 'blender-v2.83-release' 2020-04-30 17:57:46 +02:00
Patrick Mours f5237f7704 Fix long OptiX BVH build times in Cycles with many objects
Looping over all primitives for every object is really slow, so this patch avoids that by moving
the necessary assignments inline with the primitive merging done for every geometry.
2020-04-30 17:57:01 +02:00
Sebastián Barschkis 21485e94aa Fluid: Refactored fluid gravity settings
Refactored setup that converts from Blender to Mantaflow units.
2020-04-30 17:33:22 +02:00
Sebastián Barschkis dc0a564c06 Merge branch 'blender-v2.83-release' 2020-04-30 15:55:35 +02:00
Sebastián Barschkis 4d63dfca4c Fluid: Reset noise emission value at the beginning of an adaptive frame
Emission values should not accumulate beyond one frame, only during the adaptive steps of one frame.
2020-04-30 15:42:44 +02:00
Jeroen Bakker 6121c28501 Fix T75895: Unable to Compile Cycles on NAVI/Linux
This patch will add some compiler hints to break unrolling in the
nestled for loops of the voronoi node.

Reviewed by: Brecht van Lommel

Differential Revision: https://developer.blender.org/D7574
2020-04-30 15:04:40 +02:00
Campbell Barton 7f4c4011ce Cleanup: replace unordered_map with switch statement
Was performing 2x look-ups, checking keys doesn't benefit noticeably
from hash look-ups.
2020-04-30 17:56:51 +10:00
Campbell Barton 070bf01d37 GHOST: fix WITH_GHOST_DEBUG option
Changing the order of include changes broke GHOST_DEBUG,
however it was using defines in a fragile way.

Fix by removing 'GHOST_DEBUG' and use 'WITH_GHOST_DEBUG' which
was already defined by CMake.
2020-04-30 17:28:28 +10:00
Campbell Barton 52186a39af Cleanup: printf warning 2020-04-30 17:28:28 +10:00
Campbell Barton a18ad3c3b6 CMake: use system include for generated headers 2020-04-30 16:01:41 +10:00
Christian Rauch 66e70fe299 GHOST: initial Wayland support
Usable with the CMake option 'WITH_GHOST_WAYLAND'

The following functionality is working:

- Building with X11 and Wayland at the same time,
  wayland is used when available.
- Keyboard, pointer handling.
- Cursor handling.
- Dedicated off-screen windows.
- Drag & drop.
- Copy & paste.
- Pointer grabbing.

See D6567 for further details.
2020-04-30 14:21:50 +10:00
Philipp Oeser d07dab0d61 Fix T76225: Cycles View layer filters are grayed out while still working
Mistake in rB7fc60bff14a6.

Maniphest Tasks: T76225

Differential Revision: https://developer.blender.org/D7566
2020-04-29 19:25:17 +02:00
Sergey Sharybin b7bcd0a87c Tracking: Implement Nuke/Natron distortion model
Neither Nuke nor Natron support OpenCV's radial distortion model
which makes it impossible to have any kind of interoperability.

The new model is available under the distortion model menu in Lens
settings.

Differential Revision: https://developer.blender.org/D7484
2020-04-29 16:39:30 +02:00
Brecht Van Lommel cec9dbc997 Merge branch 'blender-v2.83-release' 2020-04-28 22:42:15 +02:00
Brecht Van Lommel 05274ca829 Fix T75432: Cycles progressive refine render slow with denoising data
Only perform denoising prefilter for the last sample, not every sample.
2020-04-28 22:40:44 +02:00
Bastien Montagne 6278b48ea1 Merge branch 'blender-v2.83-release'
Conflicts:
	source/blender/blenkernel/intern/lib_query.c
	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
2020-04-28 15:40:12 +02:00
Brecht Van Lommel 7d85b6431f Fix T76044: update Cycles to build with OSL 1.11 master 2020-04-28 13:50:31 +02:00
Sergey Sharybin 2c60221080 Cleanup: Missing include directories after recent cleanup 2020-04-28 13:33:18 +02:00
Brecht Van Lommel 2db4a5bb9f Cleanup: remove unused string module
This is legacy code that can simply be replaced by std::string.
2020-04-28 12:57:39 +02:00
Brecht Van Lommel 2580fa1602 Cleanup: remove STR_String usage from GHOST 2020-04-28 12:57:39 +02:00
Ray Molenkamp 15081cf6df Merge remote-tracking branch 'origin/blender-v2.83-release' 2020-04-27 13:01:24 -06:00
Ray Molenkamp 7951ec2641 Cleanup: Fix warning about initialization order with MSVC 2020-04-27 13:00:53 -06:00
Christian Rauch 54eb701978 Cleanup: add newline to ghost warning print 2020-04-27 15:27:18 +10:00
Campbell Barton d2aa4ada50 Merge branch 'blender-v2.83-release' 2020-04-24 12:27:12 +10:00
Campbell Barton af0a042da7 Cleanup: remove unused arg, clang-format 2020-04-24 11:43:30 +10:00
Campbell Barton b785feb3d7 Merge branch 'blender-v2.83-release' 2020-04-23 12:12:34 +10:00
Campbell Barton e812512e1d Cleanup: clang-format, unused warning 2020-04-23 12:10:41 +10:00
Sebastián Barschkis cdc399a055 Merge branch 'blender-v2.83-release' 2020-04-22 17:05:04 +02:00
Brecht Van Lommel cf5147f69f Fix T74423: Cycles rendering artifacts with CUDA 10.2
Work around what appears to be a compiler bug, just changing the code a bit
without any functional changes.
2020-04-22 16:40:52 +02:00
Sebastián Barschkis fdea3dd7e7 Fluid: Fix for inconsistent behavior with flow and effector objects
Fixes issue with flow and effector objects which were not being used after resuming a bake job.
This issue has been reported in T75729 and T75758.
2020-04-22 16:18:13 +02:00
Sebastián Barschkis abdd4117b1 Fluid: Cleanup in MANTA main class
More concise return types for cache import functions and general cleanup.
2020-04-22 16:16:23 +02:00
Sebastián Barschkis 40e9dc638b Fluid: Remove noise bake call from Python
Saving noise cache files is handled in fluid.c.
2020-04-22 16:16:23 +02:00
Sebastián Barschkis 06e3df4ce4 Fix T75681: Mantaflow crash when trying to bake a cupcake: The CG solver diverged, residual norm > 1e30
Ensures that there are no enclosed holes between an obstacle and the domain walls.
2020-04-22 16:16:23 +02:00
Philipp Oeser a47a975a55 Merge branch 'blender-v2.83-release' 2020-04-22 14:38:59 +02:00
Philipp Oeser 6c9a882340 Fix T75964: changing object's viewport display color does not update
cycles

Caused by rB00466e756e33.

While that commit sounds logical, Cycles uses is_updated_transform() to
detect updates.

Now introduce is_updated_shading() and use that on top.

Maniphest Tasks: T75964

Differential Revision: https://developer.blender.org/D7493
2020-04-22 14:31:32 +02:00
Sergey Sharybin e5052e8bde Merge branch 'blender-v2.83-release' 2020-04-22 14:28:10 +02:00
Sergey Sharybin 9aeb475e99 Subdiv: Fix wrong non-manifold subdivision in certain cases
Was happening when only partial subset of callbacks was specified.

The reason was that there was a callback to specify edges sharpness
but no callback to specify vertex sharpness, so the special case for
non-manifold edges was not run.

Fixes T75697: Multires in simple mode doesn't work correct on a plane
2020-04-22 14:26:12 +02:00
Sergey Sharybin 805c52b1fd Libmv: Cleanup, naming
Initial bundle adjustment only supported OpenCV's radial distortion
model, so the cost functor was called after it.

Nowadays it supports more than this single model, so naming was a bit
wrong and misleading.
2020-04-21 16:41:23 +02:00
Sergey Sharybin a02da85b55 Libmv: Cleanup, spelling and naming in bundle adjustment
Just more things which were discovered to be annoying on unclear when
adding more features to this code.
2020-04-21 12:25:45 +02:00
Sergey Sharybin 749181ff4d Libmv: Cleanup, spelling in comment 2020-04-20 17:26:45 +02:00
Sergey Sharybin e9c9e1c2c7 Libmv: De-duplicate creation of residual block
Allows to centralize logic which is needed to check which cost functor
to use for the specific intrinsics.
2020-04-20 16:26:39 +02:00
Sergey Sharybin f0e8965090 Libmv: Cleanup reprojection cost function
Make it smaller and more clear how and what it operates on.
2020-04-20 16:26:32 +02:00
Sergey Sharybin ce82e9e64a Libmv: Pass entire camera intrinsics to reprojection error functor
Currently no functional changes, but allows to have access to some
invariant settings of camera intrinsics such as image dimensions.
2020-04-20 16:26:32 +02:00
Sergey Sharybin c334020d8f Libmv: Cleanup, rephrase comment 2020-04-20 16:26:32 +02:00
Sergey Sharybin 838d452843 Libmv: Cleanup, fix indentation 2020-04-20 16:26:31 +02:00
Sergey Sharybin 584f112548 Libmv: Cleanup, spelling in comments 2020-04-20 16:26:31 +02:00
Campbell Barton 2a96e8be39 Cleanup: redundant parenthesis, NULL checks 2020-04-20 12:15:49 +10:00
Sebastián Barschkis 76c1a91cfa Fluid: Fix for inconsistent behavior with flow and effector objects
Fixes issue with flow and effector objects which were not being used after resuming a bake job.
This issue has been reported in T75729 and T75758.
2020-04-19 21:15:40 +02:00
William Reynish 7fc60bff14 UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.

Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.

We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.

* Changes the property split percentage from 50/50% to 40/60%. This is
  needed to give enough space for the checkboxes. But in most cases this
  looks better anyway - see Transform panel. In some cases it simply
  fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
  When we did this, the alignment was never quite right, and the layout
  code was a mess.
* Adds column headings to many places where a list of checkboxes all
  share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
  only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
  poorly with column headings, and also they would mess alignment up
  badly. The grid flow layouts also often made buttons and controls jump
  around on the screen if you would just resize editors slightly,
  causing visual confusion, making users lose their place. The logic for
  at what time the list of items would re-flow was often flawed, jumping
  to multiple columns too fast or too late - and frankly, the grid flow
  layouts would often just look bad.

Maniphest Task: https://developer.blender.org/T65965

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

Reviewed by: Brecht Van Lommel, Pablo Vazquez.

Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 17:00:57 +02:00
Sebastián Barschkis 0f6044610f Fluid: Cleanup in MANTA main class
More concise return types for cache import functions and general cleanup.
2020-04-15 14:22:47 +02:00
Sebastián Barschkis d9db8f8b7c Fluid: Remove noise bake call from Python
Saving noise cache files is handled in fluid.c.
2020-04-15 14:18:00 +02:00
Sebastián Barschkis e21fdfc8e4 Fix T75681: Mantaflow crash when trying to bake a cupcake: The CG solver diverged, residual norm > 1e30
Ensures that there are no enclosed holes between an obstacle and the domain walls.
2020-04-15 14:18:00 +02:00
Brecht Van Lommel 7fbd9b67af Fix Windows build error introduced in Wintab commit revert 2020-04-14 17:14:56 +02:00
Brecht Van Lommel e90d8422d0 Revert "Windows: support high resolution tablet pen events for Wintab"
This reverts commit 1a3928f33c and 1a3928f3. This is not working stable
with some Wintab implementations, so reverting for now. This leaves only
the Windows Ink changes for 2.83.
2020-04-14 18:58:37 +02:00
Brecht Van Lommel e2003d9212 UI: reorder adaptive sampling settings in order of importance 2020-04-12 15:44:28 +02:00
Ray Molenkamp aeb42cf8ab Cycles/Optix: Support building the optix kernels on demand.
CMake: `WITH_CYCLES_DEVICE_OPTIX` did not respect `WITH_CYCLES_CUDA_BINARIES` causing the optix kernel to be always build at build time.

Code: `device_optix.cpp` did not count on the optix kernel not existing in the default location.

For this to work, one should have before starting blender

1) working nvcc environment
2) Optix SDK installed and the OPTIX_ROOT_DIR environment variable pointing to it which is not set by default

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

Reviewed By: Brecht
2020-04-11 12:59:21 -06:00
Nicholas Rishel 1a3928f33c Fix T75546: Solve possible endless loop in wintab initialisation
Some Wintab drivers report a zero length queue, this causes an unplanned never ending loop.

Differential Revision: https://developer.blender.org/D7392
Reviewed by: Ray Molenkamp
2020-04-09 16:43:09 -06:00
Bartosz Moniewski 054950def9 Shading: add Roughness input to Noise and Wave texture nodes
Currently in fractal_noise functions, each subsequent octave doubles the
frequency and reduces the amplitude by half. This patch introduces Roughness
input to Noise and Wave nodes. This multiplier determines how quickly the
amplitudes of the subsequent octaves decrease.

Value of 0.5 will be the default, generating identical noise we had before.
Values above 0.5 will increase influence of each octave resulting in more
"rough" noise, most interesting pattern changes happen there. Values below
0.5 will result in more "smooth" noise.

Differential Revision: https://developer.blender.org/D7065
2020-04-09 21:48:03 +02:00
Campbell Barton 19352bca16 Cleanup: spelling 2020-04-05 22:22:21 +10:00
Brecht Van Lommel c13aa95eda Fix T75288: crash in Cycles image loading with multithreaded shader compilation 2020-04-08 22:01:04 +02:00
Brecht Van Lommel cc53c9e476 Fix T75290: Cycles crash with out of bounds memory access in volume mesh build 2020-04-08 21:58:17 +02:00
Brecht Van Lommel 8360bfb75c Cleanup: clang-format 2020-04-08 21:58:17 +02:00
Sebastián Barschkis 020d1e23ae Fluid: Fix issue with mesh not being loaded
Fixed an issue that was likely introduced in a past cleanup.
2020-04-08 16:26:20 +02:00
Brecht Van Lommel 91d7f5d246 Fix T74572: adaptive sampling still not working correct with shader AOVs 2020-04-08 14:09:10 +02:00
Brecht Van Lommel fd487b1f4e Fix build error with WITH_X11_XINPUT=OFF after recent changes 2020-04-08 14:03:54 +02:00
Sebastián Barschkis c2cb87f897 Fluid: Fix problem with inconsistent noise when using multiple adaptive time-steps
Problem was mentioned in T74062.
2020-04-08 13:27:12 +02:00
Nicholas Rishel ea3e0b3e8c Windows: support high resolution tablet pen events for Wintab
Together with Windows Ink support, this should fully resolve T70765.

Differential Revision: https://developer.blender.org/D6675
2020-04-08 12:25:40 +02:00
Nicholas Rishel d571d615a5 Windows: support high resolution tablet pen events for Windows Ink
Rather than using the last state of the tablet, we now query the history of
pointer events so strokes can follow the pen even if Blender does not handle
events at the same rate.

Differential Revision: https://developer.blender.org/D6675
2020-04-08 12:25:40 +02:00
Nicholas Rishel 3d8c57f4da Cleanup: minor refactoring of pointer event handling
Ref D6675
2020-04-08 12:25:40 +02:00
Nicholas Rishel 4e4bf241c8 Cleanup: add utility functions for milliseconds conversion
Ref D6675
2020-04-08 12:25:40 +02:00
Brecht Van Lommel c43473e884 Cleanup: remove GHOST API to query tablet state from Window
It's not used by Blender anymore and it's unreliable since this state really
only makes sense associated with events in a particular order.

Ref D6675
2020-04-08 12:25:40 +02:00
Brecht Van Lommel 53981c7fb6 Cleanup: refactor adaptive sampling to more easily change some parameters
No functional changes yet, this is work towards making CPU and GPU results
match more closely.
2020-04-07 20:29:48 +02:00
Sebastián Barschkis 4a83832120 Fix T74828: Fluid: Crash with Fire/Smoke Noise
Issue was that the noise simulation was trying to bake with a minimized domain size (adaptive domain initializes domain with size (1,1,1)). Similarly to the base resolution bake, there should be no noise baking happening at those domain sizes - a domain at this size is considered empty.
2020-04-07 14:31:33 +02:00
Sebastián Barschkis ea78f9922e Fluid: Fixed assertion error
Fix for new assertion statements that were introduced in bfdc42d990.
2020-04-07 14:31:33 +02:00
Brecht Van Lommel 10f0e003a9 Fix T74572: adaptive sampling not scaling AOVs correctly 2020-04-06 23:23:48 +02:00
Brecht Van Lommel e05552f7c4 Revert "Fix T74572: adaptive sampling not scaling render passes correctly"
This reverts commit 82a8da0ec3. It was completely
wrong. Fixes T75388.
2020-04-06 23:23:48 +02:00
Sebastián Barschkis 71a52bbe2a Fluid: Ensure correct velocities for noise bake
Make sure that noise uses the unaltered velocity grid. This is particularly important once external velocities get added to the velocity grid.
2020-04-06 17:48:32 +02:00
Sergey Sharybin 5dde5dd44e Libmv: Use static scheduler for threading
For a real-world distortion the payload is quite uniformly
distributed across scanlines. Surely, in the corners more
iterations of minimizer is needed, but that happens in threads
without scheduling overhead.
2020-04-06 15:18:32 +02:00
Sergey Sharybin 7e93d4eea3 Tracking: Fix (un)distortion happen in single thread
Need to communicate available number of threads to the camera
intrinsics implementation, otherwise default value of 1 is used.

Must have been single-threaded for a very long time.
2020-04-06 15:18:32 +02:00
Sebastián Barschkis 70b061b4fd Fluid: Refactored caching in main Mantaflow class
This refactor cleans up code for the Manta file IO. It also improves the cache 'Replay' option.
2020-04-03 17:37:37 +02:00
Sebastián Barschkis bfdc42d990 Fluid: Refactored MANTA class
Refactored the caching system so that return values are no longer ignored. The aim of this refactor was to make the caching more robust.
2020-04-03 17:37:25 +02:00
Brecht Van Lommel 80513d8574 Fix T75287: other Cycles render passes wrong when using Cryptomatte 2020-04-03 13:13:26 +02:00
Brecht Van Lommel 82a8da0ec3 Fix T74572: adaptive sampling not scaling render passes correctly 2020-04-03 13:13:26 +02:00
Campbell Barton 04fe37f931 Cleanup: quiet shadow warnings with ghost & mantaflow 2020-04-03 16:15:57 +11:00
Campbell Barton d52326bab3 Cleanup: spelling 2020-04-03 12:38:04 +11:00
Julian Eisel 6eb409bb9c Fix warnings caused by own earlier commit
Caused by 34465a7fb0.
2020-04-02 18:46:12 +02:00
Brecht Van Lommel 12628e0794 Fix Cycles AVX unit test still failing to build with old GCC 2020-04-02 18:19:49 +02:00