Commit Graph

9772 Commits

Author SHA1 Message Date
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
Julian Eisel 34465a7fb0 VR: Refactor DirectX context management
All DirectX management happens on Ghost level now, higher level code can
just assume everything is OpenGL (except of the upside-down drawing that
still needs to be done for DirectX). This is similar to how the
metal-layer is hidden outside of Ghost.

The Ghost-XR graphics binding for DirectX is responsible for managing
the DirectX compatibility now.
2020-04-02 17:43:45 +02:00
Brecht Van Lommel 868d4526a8 Fix more build errors/warnings after recent AVX changes
Thanks to Sergey and Ray for the help identifying the problem.
2020-04-02 17:30:56 +02:00
Brecht Van Lommel 9672605938 Fix build error on Windows/Linux after recent AVX changes 2020-04-02 17:09:01 +02:00
Julian Eisel 53d029d6da Cleanup: Avoid complex template type for XR-Swapchain
I rather avoid types like
`std::vector<std::unique_ptr<GHOST_XrSwapchain>>`, which is easy to do
in this case.
2020-04-02 13:50:27 +02:00
OmarSquircleArt f047d47e24 Cycles: AVX implantation of Perlin noise.
This patch adds an AVX implementation of Perlin noise in Cycles.
An avxi type was also added as a utility based on the respective
type in Intel Embree.

Only 3D and 4D noise were implemented, there is no benefit for
utilizing AVX in 1D and 2D noise. The SSE trilinear interpolation
function was used in the AVX implementation because there is no
benefit from using AVX in interpolating the last three dimensions.

Differential Revision: https://developer.blender.org/D6680
2020-04-01 14:48:01 +02:00
Julian Eisel afe707cc3a Fix missing XR space destruction
I think destructing the XrSession would destruct this anyway, but rather
have this done explicitly, consistently and in a controlled manner.
2020-03-31 16:49:38 +02:00
Sebastián Barschkis 1280f3c0ae Fluid: Optimization for mesh file loading
Improved loading times for mesh files by reading bigger chunks of data from the disk at once.
2020-03-30 17:32:38 +02:00
Sebastián Barschkis 7d59f84708 Fluid: Optimization for liquid / secondary particle file loading
Improved loading times for particles files by reading bigger chunks of data from the disk at once.
2020-03-29 21:31:20 +02:00
Asher e0030d53bc Fix key detection issues introduced by D7229
Removing the GHOST_kKeyUnknown check from processKeyEvent() produces
epeated unknown key events whenever a modifier key is held down, due
to the way ghost uses GHOST_kKeyUnknown as a filter value for modifier
key events.

Differential Revision: https://developer.blender.org/D7257
2020-03-27 20:59:20 -03:00
Daniel Santana 2632ba6703 Fix Optix build error after recent changes
Differential Revision: https://developer.blender.org/D7253
2020-03-27 14:26:26 +01:00
Charlie Jolly 1bb7d42cf6 Cleanup: Silence uninitialized variable warning 2020-03-27 11:12:27 +00:00
Sebastián Barschkis 5cf6689019 Fluid: Removed obstacle levelset optimization
Currently results in unstable particle behavior and incorrect meshing.
2020-03-27 00:16:34 +01:00
Aaron Carlisle a921a4daad Mantaflow: remove reminents of high res smoke
It appears this slipped through the code review

Reviewed By: sebbas

Differential Revision: https://developer.blender.org/D6760
2020-03-26 16:29:08 -04:00
Ray Molenkamp 86c61ce64f Cycles: Restore cycles_cubin_cc to working order
Reviewed by: brecht pmoursnv
Differential Revision: https://developer.blender.org/D7136
2020-03-26 11:41:44 -06:00
Ray Molenkamp 58ea0d93f1 Cycles/Optix: Add CYCLES_OPTIX_TEST override
This works similarly to the CYCLES_OPENCL_TEST
environment variable to allow testing on unsupported
hardware.

Note: like the OPENCL test override, this is
for *testing* only and bug reports on unsupported
hardware will *not* be accepted at this point in
time.
2020-03-26 11:30:17 -06:00
Germano Cavalcante 1b1c683f74 Fix missing text input on Windows with certain keyboard layouts
Events for keys specific to certain keyboard layouts unknown to Blender
were ignored. Now pass them along as unknown key events for which we
can still handle text input, like we already do for Linux and macOS.

Differential Revision: https://developer.blender.org/D7229
2020-03-26 09:22:47 -03:00
Patrick Mours bd2b1a67a7 Fix T74939: Random Walk subsurface appearance in OptiX does not match other engines
Random Walk subsurface scattering did look different with OptiX because transmittance is
calculated based on the hit distance, but the OptiX implementation of `scene_intersect_local`
would return the distance in world space, while the Cycles BVH version returns it in object
space. This fixes the problem by simply skipping the object->world transforms in all the
places using the result of `scene_intersect_local` with OptiX.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7232
2020-03-26 13:00:09 +01:00
Brecht Van Lommel 68e341e9d5 UI: remove non-unicode font and simplify default font loading code
There is no need to have another font embedded in the Blender executable, we
can assume the bundled font exists. In the future we may provide a fallback
if the font specified by the user in the preferences is missing a character,
but that can use our bundled international font.

Differential Revision: https://developer.blender.org/D6854
2020-03-25 16:39:58 +01:00
Brecht Van Lommel f48d15a861 Cycles: limit number of processes compiling OpenCL kernel based on memory
The numbers here can probably be tweaked to be better, but it's hard to
predict and this should at least avoid excessive memory swapping.

Fixes T57064.
2020-03-25 16:39:37 +01:00
Sebastián Barschkis 04ab677761 Fluid: Small fix for secondary particles
Small tweak to ensure index will not run out of bounds during secondary particle computation.
2020-03-25 16:08:05 +01:00
Brecht Van Lommel 394a1373a0 Cycles: use OpenCL C 2.0 if available, to improve performance for AMD
Tested with AMD Radeon Pro WX 9100, where it brings performance back to 2.80
level, and combined with recent changes is about 2-15% faster than 2.80 in
our benchmark scenes.

This somehow appears to specifically address the issue where adding more shader
nodes leads to slower runtime. I found no additional speedup by applying this
to change to 2.80 or removing the new shader node code.

Ref T71479

Patch by Jeroen Bakker.

Differential Revision: https://developer.blender.org/D6252
2020-03-24 20:09:36 +01:00
Brecht Van Lommel 5801a016d4 Cycles: slightly improve OpenCL performance by reordering SVM enum values
Ref T71479
2020-03-24 16:49:46 +01:00
Brecht Van Lommel 2bec6f1f06 Cycles: work around OpenCL performance regression after AOVs and vector rotate
We appear to be hitting some limit where adding any amount of code causes a
significant performance regression, no matter what it does. To work around
that a new node level was added.

Ref T71479
2020-03-24 16:49:46 +01:00
Brecht Van Lommel f8a4fb43fb Cleanup: remove unused Cycles kernel feature flags, replace by node levels 2020-03-24 16:49:46 +01:00
Sebastián Barschkis cda81d5a4d Fluid: Enforce minimum thickness to planar flow / effector objects
Planar object now have a thickness by default. This should make it more intuitive for users as there is no need to specify an object thickness.
2020-03-23 23:50:39 +01:00
Sebastián Barschkis e9629e3cfd Fluid: Use different phi for levelset generation
Phi that is used for mesh should be the one that matches particles best.
2020-03-23 23:50:39 +01:00
Sebastián Barschkis 0c571db4ad Fix T73988: Mantaflow fluid simulation - Particles for Spray, Foam and Bubbles are one frame ahead of Mesh
Fixes an issue with secondary particles being out of sync with the main simulation. Cleaned up the secondary particle code in general too (making sure that all solver attributes - timestep, framelength, etc. - are set correctly).
2020-03-22 21:46:43 +01:00
Ray Molenkamp 44c6b6615b OpenCL: Bring back CYCLES_OPENCL_TEST override
Back in 2.79 you could either use the debug panel or an
environment variable to override using OpenCL for unsupported
hardware. Which was rather useful for developers when testing
on NVidia just to be sure the CL kernels at-least build properly.

This broke in rB949ab753bb2

This diff restores testing though the CYCLES_OPENCL_TEST
environment variable.

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

Reviewers: brecht
2020-03-21 11:55:45 -06:00
Brecht Van Lommel 3033b2a044 Fix T73372: cryptomatte not filling last pass for odd number of levels
Make logic consistent with the render pass creation in Python.
2020-03-21 15:04:12 +01:00
Brecht Van Lommel 6777956005 Fix T68370, T74973: Cycles cryptomatte not working when other passes are enabled
Solution found by Blazej Floch.
2020-03-20 15:59:24 +01:00
Brecht Van Lommel db65a6e0fb Fix T74345: missing albedo for Cycles principled hair BSDF 2020-03-20 15:23:39 +01:00
Brecht Van Lommel 0127e8522a Fix Python error in Cycles baking panel 2020-03-20 14:25:16 +01:00
Campbell Barton 85dc8d7477 Cleanup: sort file, struct lists 2020-03-20 12:19:44 +11:00
Campbell Barton 35e3abb912 Cleanup: remove old header conventions recently re-introduced 2020-03-20 12:19:09 +11:00
Brecht Van Lommel 4b74b35322 Fix Cycles crash in Windows debug mode with volumes 2020-03-19 20:02:33 +01:00
Germano Cavalcante e1b2ded7b2 Fix build WITH_CXX_GUARDEDALLOC 2020-03-19 14:42:04 -03:00
Dalai Felinto 2d1cce8331 Cleanup: `make format` after SortedIncludes change 2020-03-19 09:33:58 +01:00
Julian Eisel 99be00fdb1 Cleanup: Prepare XR code for sorted headers 2020-03-18 20:53:02 +01:00
Brecht Van Lommel 6bfe7c7a02 Fix (harmless) use of uninitialized variables in Cycles 2020-03-18 19:51:54 +01:00
Brecht Van Lommel 7537cad576 Volumes: add render settings for volume datablock
* Space: volume density and step size in object or world space
* Step Size: override automatic step size
* Clipping: values below this are ignored for tighter volume bounds

The last two are Cycles only currently.

Ref T73201
2020-03-18 11:23:05 +01:00
Brecht Van Lommel 1162ba206d Cycles: change volume step size controls, auto adjust based on voxel size
By default it will now set the step size to the voxel size for smoke and
volume objects, and 1/10th the bounding box for procedural volume shaders.

New settings are:
* Scene render/preview step rate: to globally adjust detail and performance
* Material step rate: multiplied with auto detected per-object step size
* World step size: distance to steo for world shader

Differential Revision: https://developer.blender.org/D1777
2020-03-18 11:23:05 +01:00
Brecht Van Lommel 9d20f170c7 Cycles: support for rendering of new Hair object prototype
Ref T68981
2020-03-18 11:23:05 +01:00
Brecht Van Lommel 994eb1ec17 Cycles: support rendering new Volume object type
Voxels are loaded directly from the OpenVDB grid. Rendering still only supports
dense grid, so memory usage is not great for sparse volumes, this is to be
addressed in the future.

Ref T73201
2020-03-18 11:23:05 +01:00
Brecht Van Lommel 006025ead0 Cycles: support for different 3D transform per volume grid
This is not yet fully supported by automatic volume bounds but works fine in
most cases that will have mostly matching bounds.

Ref T73201
2020-03-18 11:23:05 +01:00
Julian Eisel dc2df8307f VR: Initial Virtual Reality support - Milestone 1, Scene Inspection
NOTE: While most of the milestone 1 goals are there, a few smaller features and
improvements are still to be done.

Big picture of this milestone: Initial, OpenXR-based virtual reality support
for users and foundation for advanced use cases.
Maniphest Task: https://developer.blender.org/T71347
The tasks contains more information about this milestone.

To be clear: This is not a feature rich VR implementation, it's focused on the
initial scene inspection use case. We intentionally focused on that, further
features like controller support are part of the next milestone.

- How to use?
Instructions on how to use this are here:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/How_to_Test
These will be updated and moved to a more official place (likely the manual) soon.

Currently Windows Mixed Reality and Oculus devices are usable. Valve/HTC
headsets don't support the OpenXR standard yet and hence, do not work with this
implementation.

---------------

This is the C-side implementation of the features added for initial VR
support as per milestone 1. A "VR Scene Inspection" Add-on will be
committed separately, to expose the VR functionality in the UI. It also
adds some further features for milestone 1, namely a landmarking system
(stored view locations in the VR space)

Main additions/features:
* Support for rendering viewports to an HMD, with good performance.
* Option to sync the VR view perspective with a fully interactive,
  regular 3D View (VR-Mirror).
* Option to disable positional tracking. Keeps the current position (calculated
  based on the VR eye center pose) when enabled while a VR session is running.
* Some regular viewport settings for the VR view
* RNA/Python-API to query and set VR session state information.
* WM-XR: Layer tying Ghost-XR to the Blender specific APIs/data
* wmSurface API: drawable, non-window container (manages Ghost-OpenGL and GPU
  context)
* DNA/RNA for management of VR session settings
* `--debug-xr` and `--debug-xr-time` commandline options
* Utility batch & config file for using the Oculus runtime on Windows.
* Most VR data is runtime only. The exception is user settings which are saved
  to files (`XrSessionSettings`).
* VR support can be disabled through the `WITH_XR_OPENXR` compiler flag.

For architecture and code documentation, see
https://wiki.blender.org/wiki/Source/Interface/XR.

---------------

A few thank you's:
* A huge shoutout to Ray Molenkamp for his help during the project - it would
  have not been that successful without him!
* Sebastian Koenig and Simeon Conzendorf for testing and feedback!
* The reviewers, especially Brecht Van Lommel!
* Dalai Felinto for pushing and managing me to get this done ;)
* The OpenXR working group for providing an open standard. I think we're the
  first bigger application to adopt OpenXR. Congratulations to them and
  ourselves :)

This project started as a Google Summer of Code 2019 project - "Core Support of
Virtual Reality Headsets through OpenXR" (see
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/).
Some further information, including ideas for further improvements can be found
in the final GSoC report:
https://wiki.blender.org/wiki/User:Severin/GSoC-2019/Final_Report

Differential Revisions: D6193, D7098

Reviewed by: Brecht Van Lommel, Jeroen Bakker
2020-03-17 21:42:44 +01:00
Julian Eisel 406bfd4304 Ghost: Ghost-XR API to abstract away and access OpenXR functionality
Extends Ghost to include an abstraction for OpenXR, which I refer to as
Ghost-XR. Such an API is the base for the following commit, which introduces VR
support to Blender.

Main features:
* Simple and high-level interface for Blender specific code to call.
* Extensible for muliple graphics backends, currently OpenGL and a DirectX
  compatibility layer are supported.
* Carefully designed error handling strategy allowing Blender to handle errors
  gracefully and with useful error messages.
* OpenXR extension and API-layer management.
* OpenXR session management.
* Basic OpenXR event management.
* Debug utilities for Ghost-XR and OpenXR

For more information on this API, check
https://wiki.blender.org/wiki/Source/Interface/XR.

Reviewed by: Brecht Van Lommel

Differential Revision: https://developer.blender.org/D6188
2020-03-17 21:39:59 +01:00
Brecht Van Lommel 1504cb26b0 Cleanup: process colorspace conversion with a 1D pixel array
No need to assume it's 2D or 3D.
2020-03-17 17:33:08 +01:00
Sebastián Barschkis 7f3e84deb5 Fluid: Updated manta pp files
Includes only a rename. The name PyInit_Main was a bit confusing as it just belongs to Manta.
2020-03-17 11:57:04 +01:00
Sergey Sharybin f0856b1fda Cycles: Fix bad escape character used for dot 2020-03-16 16:17:13 +01:00
Brecht Van Lommel 215e474a99 Fix T74776: Cycles crash with missing image texture after recent changes 2020-03-16 16:02:06 +01:00
William Reynish 20f6700c88 UI: Show decorators for lights when using Cycles
This matches Eevee, and also the rest of Blender.
2020-03-16 14:32:09 +01:00
William Reynish 4031d8bcb7 UI: Fix capitalization in the macOS app menu 2020-03-15 11:16:08 +01:00
Campbell Barton 60e3f690cb Cleanup: sort file lists & struct declatations 2020-03-14 15:39:59 +11:00
Sebastián Barschkis 93ac4709eb Fluid: Potential fix for Eevee tests crashing with Mantaflow
Belongs to T73921. This commit fixes the crashes with light baking (disabled in f3a33a9298). There is still a memory leak to be fixed though.
2020-03-13 15:34:07 +01:00
Sergey Sharybin 8622372256 OpenSubdiv: Make non-full geometry less strict for sharpness
Allow to mark individual vertices as infinitely sharp even if there is
no full topology and no access to edges: infinite sharp vertices do not
need connectivity information.
2020-03-13 14:07:44 +01:00
Brecht Van Lommel 472534d16e Fix memory leak in recent Cycles image texture refactor 2020-03-12 20:30:49 +01:00
Brecht Van Lommel 26bea849cf Cleanup: add device_texture for images, distinct from other global memory
There was too much image texture specific stuff in device_memory, and too
much code duplication between devices.
2020-03-12 17:28:55 +01:00
Brecht Van Lommel 75be60a667 Fix build error with recent OpenImageIO versions 2020-03-12 17:19:57 +01:00
Campbell Barton 1aebcdbb3a Cleanup: spelling, clang-format 2020-03-12 12:34:54 +11:00
Brecht Van Lommel e6d0a438ab Fix T73626: crash scrubbing timeline with Cycles viewport and smoke/fire 2020-03-11 20:45:39 +01:00
Brecht Van Lommel 6cf4861c3a Cleanup: refactor image loading to use abstract ImageLoader base class
Rather than passing around void pointers, various Blender image sources now
subclass this. OIIO is also just another type of image loader.

Also fixes T67718: Cycles viewport render crash editing point density settings
2020-03-11 20:45:39 +01:00
Brecht Van Lommel d8aa613d94 Cleanup: add ImageHandle to centralize image ownership logic 2020-03-11 20:35:38 +01:00
Brecht Van Lommel ec3eeee46b Cycles: add internal default volume shader, to be used for new volume object
This is mostly straightforward, but required some refactoring to ensure that
the default volume material does not always turn on the volume feature for GPU
rendering.
2020-03-11 20:35:38 +01:00
Brecht Van Lommel 5a169ae2f3 Cleanup: remove foreach include from header, conflicts with OpenVDB 2020-03-11 20:35:38 +01:00
Brecht Van Lommel 21821601f2 Fix Optix build error on Linux with some compilers 2020-03-11 20:35:38 +01:00
Giovanni Remigi 19b46b2fca Fix Cycles crash in BVH8 build due to out of bounds memory access
Differential Revision: https://developer.blender.org/D7114
2020-03-11 17:35:11 +01:00
Brecht Van Lommel f01bc597a8 Cleanup: stop encoding image data type in slot index
This is legacy code from when we had a fixed number of textures.
2020-03-11 17:07:17 +01:00
Brecht Van Lommel 9910803574 Fix Cycles link error with debug + asan after RTTI changes 2020-03-11 17:05:15 +01:00
Brecht Van Lommel c4beb518de Cycles: disable RTTI only for OSL files, other libraries like OpenVDB need it
This is a bit weak since it's not entirely clear where the boundary is, but
tested to build and pass tests on all platforms.
2020-03-11 14:42:46 +01:00
Brecht Van Lommel c8acb6dd6c Smoke: put density/color in separate textures, fixes for workbench shader
This is more in line with standard grids and means we don't have to make
many special exceptions in the upcoming change for arbitrary number of volume
grids support in Eevee.

The workbench shader was also changed to fix bugs where squared density was
used, and the smoke color would affect the density so that black smoke would
be invisible. This can change the look of smoke in workbench significantly.

When using the color grid when smoke has a constant color, the color grid
will no longer be premultiplied by the density. If the color is constant
we want to be able not to store a grid at all. This breaks one test for
Cycles and Eevee, but the setup in that test using a color without density
does not make sense. It suffers from artifacts since the unpremultiplied
color grid by itself will not have smooth boundaries.

Differential Revision: https://developer.blender.org/D6951
2020-03-11 14:42:46 +01:00
Brecht Van Lommel 5cb2861420 Fix Cycles incorrect result when compressing some 8 bit log colorspace images
Don't clamp and do premultiply after color space conversion.
2020-03-11 12:59:29 +01:00
Brecht Van Lommel 796683db8e Cycles: add view layer setting to exclude volumes, like hair and surfaces 2020-03-11 11:25:57 +01:00
Brecht Van Lommel b70a13fb66 UI: show more digits for adaptive sampling noise threshold 2020-03-11 10:54:28 +01:00
Campbell Barton d195deef5c Cleanup: clang-format 2020-03-11 19:23:52 +11:00
Campbell Barton 1c9829f351 GHOST: tests now build again
GLX gears work as expected, multitest_c only creates windows
but misses font drawing still.
2020-03-11 15:17:27 +11:00
Campbell Barton 15983243a4 Cleanup: remove bitmap font drawing ifdef from MultiTest.c 2020-03-11 15:01:14 +11:00
Stefan Werner 7c027f9480 Cycles: Fixed Shadow and Mist passes with adaptive sampling.
This also fixes a side-effect where turning on UV pass but leaving
Shadow pass turned off destroyed the Combined pass.
2020-03-10 16:50:51 +01:00
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
Brecht Van Lommel 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 bc2ce31d79 (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 5be0e3430d
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 a5c4a44df6.
2020-03-05 11:41:09 +01:00