Commit Graph

9739 Commits

Author SHA1 Message Date
Hans Goudey 19ff145e66 Clang-Tidy: Enable readability-redundant-control-flow 2020-07-03 09:41:55 -04:00
Jacques Lucke 1e255ce031 Fix T72214: Fluids: noise does not work with negative frame numbers
The issue is duplicated code. There are two functions that zero-fill
the frame number. They worked the same for positive frames numbers, but
behaved differently for negative ones.

On frame `-100`, `BLI_path_frame` outputs `-0100` and
`fluid_cache_get_framenr_formatted_$ID$` outputted `-100`.

I changed the behavior of the latter, because we depend on the behavior
of the former for much longer already.

Reviewers: sebbas

Differential Revision: https://developer.blender.org/D8107
2020-07-03 15:27:02 +02:00
Brecht Van Lommel 4ccd96f1a4 Cycles: rename viewport denoise Fastest option to Automatic and extend tooltip 2020-07-03 12:36:17 +02:00
Sergey Sharybin 468adfa4fd Guarded allocator: Override placement new operator
Allows to in-place construct objects which are using guarded allocator.
2020-07-03 12:30:20 +02:00
Sebastián Barschkis b1d3850333 Cleanup: Fluid renaming from old 'manta' naming to new 'fluid' naming
Changed variable names from mmd, mds, mfs, and mes to fmd, fds, ffs, and fes. The author of this commits lights a candle for all the merge conflicts this will cause.
2020-07-03 11:52:08 +02:00
Sergey Sharybin 746aec51a7 Cycles: Use TBB's spin mutex
First benefit is reduced boilerplate code.

Second benefit is fixed warnings about using deprecated spin lock
on macOS when using SDK 10.12 and above.

Differential Revision: https://developer.blender.org/D8182
2020-07-03 11:14:26 +02:00
Campbell Barton a272a2a6cd Cleanup: spelling 2020-07-03 11:58:13 +10:00
Campbell Barton 26ffed7466 Cleanup: spelling 2020-07-02 13:03:46 +10:00
Brecht Van Lommel 792cb8bdc7 Fix T77984: Cycles OpenCL error rendering empty scene 2020-07-01 20:01:25 +02:00
Aaron Carlisle f228a8948b Cleanup: Two two spaces around python class 2020-07-01 12:36:00 -04:00
Campbell Barton 36d6aa428f Cleanup: spelling 2020-07-01 13:12:24 +10:00
Aaron Carlisle 3562be2bda UI: Cycles: Use Split layout for object motion blur 2020-06-30 13:23:12 -04:00
Brecht Van Lommel d4b9b2c020 Cycles: bump version to 1.13, matching Blender 2.90 release cycle 2020-06-30 18:12:08 +02:00
Brecht Van Lommel 6ac235a6f7 Fix T78038: Cycles crash rendering with volume object and motion blur 2020-06-30 17:36:02 +02:00
Brecht Van Lommel 4e9ed1dae9 Fix T78447: Cycles vertex color node not working with hair 2020-06-30 14:36:52 +02:00
Campbell Barton b838a51803 Cleanup: spelling 2020-06-30 20:54:31 +10:00
Campbell Barton 84f8b47c4c Cleanup: clang-format 2020-06-30 20:50:37 +10:00
Brecht Van Lommel 2d8c59ccb9 Fix T77095: fix Cycles performance regression with AMD RX cards
Apply the workaround only for known problematic drivers. The latest pro driver
appears to work correctly, hopefully the regular driver will as well once it
is updated to the same OpenCL driver version (3075.13).
2020-06-30 12:01:40 +02:00
Adrian Newton f28e59bd74 UI: Use single column for cycles ray visibility checkboxes
Differential Revision: https://developer.blender.org/D7612
2020-06-29 17:12:19 -04:00
Brecht Van Lommel fb68a30af6 Fix crash compiling Cycles OpenCL, after recent TBB changes 2020-06-26 17:44:24 +02:00
Brecht Van Lommel da2e71be2f Fix T78310: tweak layout in denoising panel to have more spacing 2020-06-26 13:19:34 +02:00
Brecht Van Lommel 74c49492c2 Cycles: add experimental preference to replace magic debug value 256
Previously you'd have to run with --debug-value 256, now just make it
a preference so the Debug panel can be always available for developers.
2020-06-26 13:19:34 +02:00
Sebastián Barschkis 2036b9771e Fluid: Fix typos from OpenVDB update
Some typos that were not noticed in 9951858942.
2020-06-26 11:48:02 +02:00
Sebastián Barschkis 31ad8bda74 Fix T77204: Mantaflow Initial velocity bugged?
Always initialize the particle velocity of newly sampled particles to 0 if there are no initial velocities. Clearing the grid source makes sure that new particles will get a 0 velocity - and not interpolated from the associated grid.
2020-06-25 18:03:08 +02:00
Sebastián Barschkis 495b0eff9a Fix T77285: Incorrect Mantaflow fluid border interaction when collision is turned off
Incorrect boolean for 'open' domain borders.
2020-06-25 16:49:47 +02:00
Brecht Van Lommel 79c2581bfa Fix T78238: issue loading existing .blend files with Optix viewport denoiser
Also add additional validation to ensure the denoiser is supported before
trying to use it.
2020-06-25 15:39:10 +02:00
Campbell Barton fd5c185beb Cleanup: spelling 2020-06-25 23:14:36 +10:00
Brecht Van Lommel 8903368490 Cycles: add support for rendering sculpt vertex colors
Ref T78041
2020-06-25 13:54:05 +02:00
Brecht Van Lommel b30df982d2 Fix viewport denoising not working if start samples higher than total samples 2020-06-25 13:00:58 +02:00
Jens Verwiebe 6b53e0adbc Better fix for crash ( with gpu only ) on render end/abort introduced in 0dced1a 2020-06-25 11:06:56 +02:00
Jens Verwiebe ec776f18ff Fix crashing on render end/abort introduced in 0dced1a 2020-06-24 23:51:57 +02:00
Brecht Van Lommel 0dced1af34 Fix T78149: Cycles memory leak rendering animation with Embree 2020-06-24 18:48:16 +02:00
Julian Eisel b468023aa1 VR: Properly support outputting sRGB swapchain buffers
Latest SteamVR OpenXR updates brought OpenGL support, but only with sRGB
buffers. I think for DirectX it's the same now.
It's not a big issue for us to use sRGB buffers, so that's what I will
do for now. That way we shouldn't need hardcoded exceptions for specific
runtimes that don't transform linear buffers correctly.
2020-06-24 18:42:53 +02:00
Ray Molenkamp 5cfbc722d0 Fix T78047: Fix failing denoiser tests on windows
When we switched to MSVC2019 and C++17 we seemingly
managed to trigger a code-gen bug with MSVC in the
AVX code-path.

This change works around the issue by (hopefully
temporary) disabling the optimizer for the fast_exp2f4
function, given it is only used in a single pass
of the denoiser and nowhere else, this is luckily
not as bad as it could have been.

Once the compiler is fixed or a different fix is
available we'll have to revisit this.

Details and link to the repro posted to MS is
available in T78047
2020-06-24 10:42:00 -06:00
Brecht Van Lommel b4e1571d0b Cleanup: compiler warnings 2020-06-24 17:25:44 +02:00
Sebastián Barschkis 9951858942 Fluid: Improved OpenVDB support for fluid caches
This commit makes uses of the new OpenVDB IO in Mantaflow (introduced in 781f783a66ac).

From now on, fluid cache files in OpenVDB format will contain a list of grids per frame (before: one .vdb file per grid per frame). Besides regular grids, particle systems are also stored using OpenVDBs PointGrid data structures.

All older cache formats will remain fully functional:
- Uni caches (.uni) files are still available from the UI and can be used as before
- Raw caches (.raw) are no longer available from the UI, but loading them is still possible
- Old OpenVDB caches (one .vdb per grid) can no longer be baked either, but loading them is still possible.

It is also no longer possible to choose file formats for 'Noise' and 'Particles'. Instead there are now options to set the file format for 'Volumetric' and for 'Mesh' data.

Known issues (planned to be resolved soon):
- OpenVDB files are currently not taking into consideration the clipping value (FluidDomainSettings). Empty cells are therefore being written too. Depending on the scene, this can make file sizes unnecessarily large.
- Domains are not being exported at their world position. Instead they are always clipped to the origin.
2020-06-24 16:07:35 +02:00
Brecht Van Lommel 6fec2e4db0 Cleanup: fix typo in denoiser menu 2020-06-24 16:01:47 +02:00
Brecht Van Lommel 3cfb687b55 Cleanup: make it possible to include util_tbb.h in any order 2020-06-24 15:28:00 +02:00
Brecht Van Lommel 669befdfbe Cycles: add Intel OpenImageDenoise support for viewport denoising
Compared to Optix denoise, this is usually slower since there is no GPU
acceleration. Some optimizations may still be possible, in avoid copies
to the GPU and/or denoising less often.

The main thing is that this adds viewport denoising support for computers
without an NVIDIA GPU (as long as the CPU supports SSE 4.1, which is nearly
all of them).

Ref T76259
2020-06-24 15:17:36 +02:00
Brecht Van Lommel 0a3bde6300 Cycles: add denoising settings to the render properties
Enabling render and viewport denoising is now both done from the render
properties. View layers still can individually be enabled/disabled for
denoising and have their own denoising parameters.

Note that the denoising engine also affects how denoising data passes are
output even if no denoising happens on the render itself, to make the passes
compatible with the engine.

This includes internal refactoring for how denoising parameters are passed
along, trying to avoid code duplication and unclear naming.

Ref T76259
2020-06-24 15:17:36 +02:00
Brecht Van Lommel 073ab4703e Fix build error on Windows after recent changes 2020-06-24 15:17:36 +02:00
Brecht Van Lommel e389c05410 Cleanup: move TBB includes into own header 2020-06-24 14:32:06 +02:00
Campbell Barton 074929d1c5 MEM_guardedalloc: allow freeing const arrays with MEM_SAFE_FREE
'const' arrays couldn't use this macro with GNUC.
2020-06-24 22:13:27 +10:00
Aaron Carlisle 49234c15e2 UI: Cycles: Use Title Case 2020-06-23 17:54:09 -04:00
Jacques Lucke 87ceff3d1b Preferences: New experimental settings for particle system and hair
This replaces the cmake options `WITH_NEW_OBJECT_TYPES` and
`WITH_NEW_SIMULATION_TYPE` with two experimental userpref settings:

* `use_new_particle_system`: Enables the point cloud type and the simulation editor.
* `use_new_hair_type`: Only displays the add-operator in the add menu for now.

Note, in the current state you can't do anything productive with the new particle
system or the new hair type. Features will be added step by step in the upcoming
weeks and months.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8096
2020-06-23 11:30:46 +02:00
Brecht Van Lommel 461ba2c74c Fix random crash in Cycles smoke volume loading
Don't access evaluated mesh data after freeing Blender depsgraph.

Potentially related to T77954.
2020-06-22 16:53:09 +02:00
Brecht Van Lommel 99436acde8 Cycles: enable Embree by default for CPU rendering
For GPU debugging purposes, it is still possible to render with the same BVH2
on the CPU using the Debug panel in the render properties.

Note that building Blender without Embree will now lead to significantly reduced
performance in CPU rendering, and a few of the Cycles regression tests will fail
due to small pixel differences.

Ref T73778

Depends on D8014

Maniphest Tasks: T73778

Differential Revision: https://developer.blender.org/D8015
2020-06-22 13:28:01 +02:00
Brecht Van Lommel 2c41c8e94f Cycles: internal refactoring to make thick/ribbon curve separate primitives
Also removing the curve system manager which only stored a few curve intersection
settings. These are all changes towards making shape and subdivision settings
per-object instead of per-scene, but there is more work to do here.

Ref T73778

Depends on D8013

Maniphest Tasks: T73778

Differential Revision: https://developer.blender.org/D8014
2020-06-22 13:28:01 +02:00
Brecht Van Lommel 207338bb58 Cycles: port curve-ray intersection from Embree for use in Cycles GPU
This keeps render results compatible for combined CPU + GPU rendering.
Peformance and quality primitives is quite different than before. There
are now two options:

* Rounded Ribbon: render hair as flat ribbon with (fake) rounded normals, for
  fast rendering. Hair curves are subdivided with a fixed number of user
  specified subdivisions.

  This gives relatively good results, especially when used with the Principled
  Hair BSDF and hair viewed from a typical distance. There are artifacts when
  viewed closed up, though this was also the case with all previous primitives
  (but different ones).

* 3D Curve: render hair as 3D curve, for accurate results when viewing hair
  close up. This automatically subdivides the curve until it is smooth.

  This gives higher quality than any of the previous primitives, but does come
  at a performance cost and is somewhat slower than our previous Thick curves.

The main problem here is performance. For CPU and OpenCL rendering performance
seems usually quite close or better for similar quality results.

However for CUDA and Optix, performance of 3D curve intersection is problematic,
with e.g. 1.45x longer render time in Koro (though there is no equivalent quality
and rounded ribbons seem fine for that scene). Any help or ideas to optimize this
are welcome.

Ref T73778

Depends on D8012

Maniphest Tasks: T73778

Differential Revision: https://developer.blender.org/D8013
2020-06-22 13:28:01 +02:00
Brecht Van Lommel d1ef5146d7 Cycles: remove SIMD BVH optimizations, to be replaced by Embree
Ref T73778

Depends on D8011

Maniphest Tasks: T73778

Differential Revision: https://developer.blender.org/D8012
2020-06-22 13:28:01 +02:00