Commit Graph

9772 Commits

Author SHA1 Message Date
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
Brecht Van Lommel 1de0e13af6 Cycles: remove __UV__ and __INSTANCING__ as kernel options
The kernel did not work correctly when these were disabled anyway. The
optimized BVH traversal for the no instances case was also only used on
the CPU, so no longer makes sense to keep.

Ref T73778

Depends on D8010

Maniphest Tasks: T73778

Differential Revision: https://developer.blender.org/D8011
2020-06-22 13:28:01 +02:00
Brecht Van Lommel fed101a7be Cycles: always perform backface culling for curve, remove option
The hair BSDFs are already designed to assume this, and disabling backface
culling would break them in some cases.

Ref T73778

Depends on D8009

Maniphest Tasks: T73778

Differential Revision: https://developer.blender.org/D8010
2020-06-22 13:28:01 +02:00
Brecht Van Lommel c7d940278b Cycles: remove support for rendering hair as triangle and lines
Triangles were very memory intensive. The only reason they were not removed yet
is that they gave more accurate results, but there will be an accurate 3D curve
primitive added for this.

Line rendering was always poor quality since the ends do not match up. To keep CPU
and GPU compatibility we just remove them entirely. They could be brought back if
an Embree compatible implementation is added, but it's not clear to me that there
is a use case for these that we'd consider important.

Ref T73778

Reviewers: #cycles

Subscribers:
2020-06-22 13:28:01 +02:00
Brecht Van Lommel e50f1ddc65 Cycles: use TBB for task pools and task scheduler
No significant performance improvement is expected, but it means we have a
single thread pool throughout Blender. And it should make adding more
parallellization in the future easier.

After previous refactoring commits this is basically a drop-in replacement.
One difference is that the task pool had a mechanism for scheduling tasks to
the front of the queue to minimize memory usage. TBB has a smarter algorithm
to balance depth-first and breadth-first scheduling of tasks and we assume that
removes the need to manually provide hints to the scheduler.

Fixes T77533
2020-06-22 13:27:37 +02:00
Brecht Van Lommel 54e3487c9e Cleanup: remove task pool stop() and finished() 2020-06-22 13:06:47 +02:00
Brecht Van Lommel b10b7cdb43 Cleanup: use lambdas instead of functors for task pools, remove threadid 2020-06-22 13:06:47 +02:00
Brecht Van Lommel d8c2092b15 Cycles: make TBB a required library dependency, and use in a few places
Now that the rest of Blender also relies on TBB, no point in maintaining custom
code for paraller_for and thread local storage.
2020-06-22 13:06:47 +02:00
Brecht Van Lommel ace3268482 Cleanup: minor refactoring around DeviceTask 2020-06-22 13:06:47 +02:00
Brecht Van Lommel b7c34c889b Cleanup: use move semantics for task pool functions 2020-06-22 13:06:47 +02:00
Hans Goudey ab72cd2fc1 Cleanup: Spelling 2020-06-19 16:11:15 -04:00
Sergey Sharybin 1f5f3b5588 Cycles: Make compatible with C++17 on 10.9 deployment target
OSLRenderServices contains a member which is 64 bytes aligned and this
is onlys supported by default allocators in SDK 10.14. Since we take
care of allocation ourselves ignoring the diagnostic is an acceptable
way dealign with it.
2020-06-19 12:02:21 +02:00
Sergey Sharybin 7ae9227794 Quadriflow: Fix compilation error with C++17
Unary function has been removed.
Unless I'm missing something subclass is not needed here.
2020-06-19 12:02:21 +02:00
Sergey Sharybin 31ae833811 Ceres: Update to the latest upstream version
Using latest master because of various compilation error fixes.

Brings a lot of recent development. From most interesting parts:

- New threading model.
- Tiny solver.
- Compatibility with C++17.
2020-06-19 12:02:21 +02:00
Brecht Van Lommel 6899cb3c07 Fix for T77095: work around render artifacts with AMD Radeon RX 4xx and 5xx 2020-06-18 14:41:51 +02:00
Jacques Lucke 55ebf174bc Fluids: fix variable names
This seems to be an error in rBb91b90f0dd3c9bff3b1a6e563c2cce293722ed16.

I found it, because I could not open the file in T77263 anymore.

Reviewers: sebbas

Differential Revision: https://developer.blender.org/D8065
2020-06-18 14:27:58 +02:00
Lukas Stockner eacdcb2dd8 Cycles: Add new Sky Texture method including direct sunlight
This commit adds a new model to the Sky Texture node, which is based on a
method by Nishita et al. and works by basically simulating volumetric
scattering in the atmosphere.

By making some approximations (such as only considering single scattering),
we get a fairly simple and fast simulation code that takes into account
Rayleigh and Mie scattering as well as Ozone absorption.

This code is used to precompute a 512x128 texture which is then looked up
during render time, and is fast enough to allow real-time tweaking in the
viewport.

Due to the nature of the simulation, it exposes several parameters that
allow for lots of flexibility in choosing the look and matching real-world
conditions (such as Air/Dust/Ozone density and altitude).

Additionally, the same volumetric approach can be used to compute absorption
of the direct sunlight, so the model also supports adding direct sunlight.
This makes it significantly easier to set up Sun+Sky illumination where
the direction, intensity and color of the sun actually matches the sky.

In order to support properly sampling the direct sun component, the commit
also adds logic for sampling a specific area to the kernel light sampling
code. This is combined with portal and background map sampling using MIS.

This sampling logic works for the common case of having one Sky texture
going into the Background shader, but if a custom input to the Vector
node is used or if there are multiple Sky textures, it falls back to using
only background map sampling (while automatically setting the resolution to
4096x2048 if auto resolution is used).

More infos and preview can be found here:
https://docs.google.com/document/d/1gQta0ygFWXTrl5Pmvl_nZRgUw0mWg0FJeRuNKS36m08/view

Underlying model, implementation and documentation by Marco (@nacioss).
Improvements, cleanup and sun sampling by @lukasstockner.

Differential Revision: https://developer.blender.org/D7896
2020-06-17 21:06:41 +02:00
Brecht Van Lommel fc7c34e380 Cleanup: fix compiler warnings 2020-06-17 14:36:51 +02:00
Brecht Van Lommel 25b8dedfb4 Fix T77915: Cycles OSL microfacet closure not working in custom shaders
The code to implement the newer closure in terms of the old one got lost in
the removal of our stdosl.h copy. Now implement it as a builtin closure.
2020-06-17 14:09:28 +02:00
Patrick Mours b586f801fc Cycles: Improve CUDA and OptiX error reporting in the viewport
This patch makes the infamous "Cancel" error in the viewport a thing of the past. Instead it
now shows a more useful error message and streamlines the error handling process in CUDA.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8008
2020-06-12 18:24:15 +02:00
Julian Eisel a809631ff2 VR: Fix too dark rendering on SteamVR
Apply the sRGB transform workaround we already apply for Monado (and used
to apply for Windows Mixed Reality).
2020-06-12 13:12:45 +02:00
Julian Eisel f12fe3c23e VR: SteamVR is now a supported OpenXR runtime! (Windows only)
Steam just released a SteamVR update with OpenXR Developer Preview
support:
https://steamcommunity.com/games/250820/announcements/detail/2396425843528787270.

Once SteamVR is set up for OpenXR (see link above), it works with
Blender "out of the box", thanks to OpenXR!

We have to apply the sRGB transform workaround for SteamVR though,
otherwise it renders way too dark. Done in the next commit.

Note that AMD users may still only see a pink screen, because the
OpenGL-DirectX compatibility fails. I will check on a fix again.
For SteamVR on Linux we may have to wait for until it supports OpenGL
rendering for OpenXR. Alternatively, we *could* add initial Vulkan
support at Ghost level and use Vulkan<->OpenGL interoperability
extensions, Monado uses these as  well.
2020-06-12 13:12:14 +02:00
Brecht Van Lommel faf5f7b63d Cleanup: fix compiler warning after recent changes
It would be good to use override for all member functions, but doing it for
only somes generates compiler warning.
2020-06-10 20:34:01 +02:00
Brecht Van Lommel 63930c41bc Fix Cycles viewport missing refresh when changing scene hair settings
This code was not updated for the CoW depsgraph.
2020-06-10 19:48:08 +02:00
Julian Eisel 4b39de677d Fix T74101: File Browser in macOS fullscreen crashes or makes windows unusable
When closing the File Browser window after making it fullscreen, Blender would
either crash or all windows would disappear, with no obvious way to bring them
back.

The "fix" is to not allow fullscreen for File Browsers (or any future "dialog"
windows), but only maximizing. From what I can tell that's how secondary
windows are supposed to work on macOS. What we previously did seemed like
something macOS doesn't handle cleanly, and I didn't find a simple way to do so
on our side.
2020-06-10 18:40:05 +02:00
Patrick Mours f367f1e5a5 Cycles: Improve OptiX viewport denoising performance with CUDA rendering
With this patch Cycles recognizing when a logical OptiX and CUDA device represent the same
physical GPU and attempts to eliminate unnecessary tile copies for viewport rendering if that
is the case for all active devices. In addition, denoising is now no longer performed on the first
available OptiX device only, but instead it will try to match CUDA and OptiX
rendering/denoising devices exactly to maximize utilization.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7975
2020-06-10 14:12:13 +02:00
Lukas Stockner d4315040ad Cycles: Fix CUDA compilation after cone sampling fix 2020-06-10 13:02:43 +02:00
Lukas Stockner 63a40ed422 Cycles: Fix uniform cone sampling
This code is currently only used for the Glossy Toon BSDF, but it's a generic
building block that might be used for other things in the future.

To see why the current code does not give a uniform distribution, consider that
it chooses both angles uniformly, but the smaller the angle from the center of
the cone is, the smaller the differential solid angle is (similar to how
sampling disks by choosing radius and phi uniformly does not work).

Differential Revision: https://developer.blender.org/D7948
2020-06-09 22:19:15 +02:00
Campbell Barton f326b6a18e Cleanup: avoid addition with large strings in Python
This is known to be inefficient, use a second write call instead.
2020-06-09 13:40:51 +10:00
Patrick Mours 9f7d84b656 Cycles: Add support for P2P memory distribution (e.g. via NVLink)
This change modifies the multi-device implementation to support memory distribution
across devices, to reduce the overall memory footprint of large scenes and allow scenes to
fit entirely into combined GPU memory that previously had to fall back to host memory.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7426
2020-06-08 17:55:49 +02:00
Jacques Lucke b5846ebce7 Fix T77603: OSL parser fails when script ends with comment without newline
Reviewers: brecht

Differential Revision: https://developer.blender.org/D7958
2020-06-08 17:01:47 +02:00
Sebastián Barschkis b91b90f0dd Fluid: Cleanup internal Python object names
Manta Python objects should not carry the global ID in their names.
2020-06-05 18:52:33 +02:00
Patrick Mours 473aaa389c Cycles: Enable OptiX on all Maxwell+ GPUs 2020-06-05 12:33:00 +02:00
Sergey Sharybin 1c5479167f Cleanup: Strict compiler warning 2020-06-05 11:59:45 +02:00
Brecht Van Lommel 41866070d3 Cleanup: remove unused flag 2020-06-04 14:37:20 +02:00
Brecht Van Lommel 1438c1cfd5 Merge branch 'blender-v2.83-release' 2020-06-04 13:49:50 +02:00
Brecht Van Lommel 86385d7ebd Fix build error for Cycles standalone
This does not affect the Blender release.

Ref D7915
2020-06-03 19:10:51 +02:00
Campbell Barton de9c04c287 Cleanup: clang format, warning 2020-06-04 01:18:39 +10:00
Tautvydas Andrikys ffb3365fb2 Fix T63588: Cycles unnecessarily updates background importance sampling map
With modifications by Brecht to solve T77273, crash enabling portal lights.
2020-06-02 19:48:51 +02:00
Brecht Van Lommel 0465086223 Merge branch 'blender-v2.83-release' 2020-06-02 19:48:45 +02:00
Brecht Van Lommel 52cc412e0f Revert "Fix T63588: Cycles unnecessarily updates background importance sampling map"
This reverts commit 33ce0cb5a1.

Fix T77273: crash enabling portal lights. The optimization for background
updates can be added back later for 2.90 and 2.83.1.
2020-06-02 19:44:12 +02:00
Clément Foucault cb59ef1032 OCIO: GLSL: Avoid undefined behavior
Set ubo binding after shaderinterface creation as GPU_shaderinterface_create
will call glUniformBlockBinding.
2020-06-02 16:46:38 +02:00
Clément Foucault cecda64e2e GPU: ShaderInterface: Refactor to setup all uniform at creation time
This remove the complexity of queriying the locations at runtime and
allows for more performance and upfront binding specifications.

The benefit of doing everything at creation time is that we can assign binding
points in a predictable order which is going to be somewhat the same for
every similar shader.

This also rewrite GPU_vertformat_from_shader to not use shaderface.

This is to keep the shaderface simple. If it becomes necessary to not query
the shader after creation (i.e: vulkan?) we could just create the vert
format in advance at compilation for PyGPU shaders.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7879
2020-06-02 12:11:39 +02:00
Johan Walles 9c410c77eb UI: rename Cycles point light Size to Radius, for consistency and clarity
Differential Revision: https://developer.blender.org/D7888
2020-06-02 08:08:59 +02:00
Brecht Van Lommel 59e793d3bd Cycles: add missing light angle for distant lights in XML reading
Contributed by howetuft.

Differential Revision: https://developer.blender.org/D7891
2020-06-02 08:08:52 +02:00
Brecht Van Lommel a8907e409a Merge branch 'blender-v2.83-release' 2020-06-02 08:08:43 +02:00
Stefan Werner c7280ce65b Cycles: Added shadow terminator offset parameter.
A new user parameter can be used to shift the shadow terminator
towards the light source. With it, one can hide some of the
artifacts that appear on coarse meshes with smooth shading.

Note that this technique is not engery conserving.

This is based on the work by the Appleseed renderer team.

Differential Revision: https://developer.blender.org/D7634
2020-06-02 07:27:14 +02:00
Brecht Van Lommel 7881c251f3 Fix build error in Cycles standalone without guarded allocator
Solution suggested by howetuft.

Differential Revision: https://developer.blender.org/D7892
2020-06-02 06:27:39 +02:00
Garry R. Osgood 389d550412 Fix T77106: Cycles crash baking with AO shader node
Differential Revision: https://developer.blender.org/D7890
2020-06-02 06:25:08 +02:00
Brecht Van Lommel 18cda8be87 Cycles: change perspective depth pass to be more standard
Now it matches Eevee, OpenGL and other renderers. Panoramic camera depth passes
are unchanged, and are still distance from the camera center.
2020-06-02 04:54:44 +02:00
Brecht Van Lommel 98c301d25e Fix NaN in Cycles environment texture importance sampling in some scenes
Cause identified by Ray Molenkamp.
2020-06-02 04:54:39 +02:00
Christian Rauch 63bcee81f6 GHOST/wayland: use 'is_dialog' flag to prevent drawing into same window 2020-05-30 12:23:39 +01:00
Campbell Barton d1f4adab24 Cleanup: spelling, correct reference to 'Mesh.mcol' 2020-05-29 12:58:29 +10:00
Clément Foucault a9073ccb68 Merge branch 'blender-v2.83-release' 2020-05-28 13:43:57 +02:00
Brecht Van Lommel 79e529c5ec Fix T77109: Cycles viewport render crash after object add and undo 2020-05-27 18:03:17 +02:00
Patrick Mours 49c295813b Merge branch 'blender-v2.83-release' 2020-05-27 15:31:03 +02:00
Patrick Mours 28d9368538 Fix T76947: Optix realtime denoiser progressively reduces brightness of very bright objects
The input data to the OptiX denoiser was clamped to 0..10000 as required, but it could easily
exceed that range with a high number of samples (since the data contains the overall sum). To
fix that, divide by the number of samples first and multiply it back in after the denoiser ran.
2020-05-27 15:17:47 +02:00
Sergey Sharybin efa4ae17f0 OpenSubdiv: Only store edges topology for non-smooth edges
This change makes it so vertices of edge are only stored when edge
has non-zero crease. This allows to lower memory footprint of 1.5M
faces from 78 MiB to 54 MiB in the case all creases are zero.

Meshes with crease are more hard to predict due to array-based
storage, so it all depends on index of edge with crease. Worst case
(all edges are creased) still stays at 78 MiB.
2020-05-27 12:07:16 +02:00
Sergey Sharybin 8cd17a9529 OpenSubdiv: Allow any order of edge topology/sharpness assignment
Makes it possible to set adjacent vertices after edge sharpness.

Initially it seemed like useful sanity check, but with time it
became rather a burden.
2020-05-27 12:07:16 +02:00
Sergey Sharybin 42cb1e3a2c OpenSubdiv: Optimize faces storage in mesh topology
Avoid per-face pointer and allocation: store everything as continuous
arrays.

Memory footprint for 1.5M faces:

- Theoretical worst case (all vertices and edges have crease) memory
  goes down from 114 MiB to 96 MiB (15% improvement).

  This case is not currently achievable since Blender does not expose
  vertex crease yet.

- Current real life worst case (all edges have crease) memory goes
  down from 108 MiB to 90 MiB (17% improvement).

- Best case (no creases at all) memory goes down from 96 MiB to 78 MiB
  (19% improvement).
2020-05-27 12:07:16 +02:00
Sergey Sharybin c971731b8f OpenSubdiv: Add regression tests for mesh topology
While this looks trivial it already allowed to catch issues in one
of previous attempt to optimize memory usage. It will totally be
useful for an upcoming refactor of face topology storage.
2020-05-27 12:07:16 +02:00
Sergey Sharybin 38b50fe393 OpenSubdiv: Hide individual topology elements
Move all API to happen via MeshTopology.

This is a preparation for an upcoming memory optimization.
2020-05-27 12:07:16 +02:00
Sergey Sharybin 15bcfc5b19 OpenSubdiv: Cleanup, remove unused code
There is no need in edge map anymore.
2020-05-27 12:07:16 +02:00
Sergey Sharybin 12c42738f3 OpenSubdiv: Add TODO avoid checking face-varying topology for equality 2020-05-27 12:07:16 +02:00
Sergey Sharybin 8e9fdd2f31 OpenSubdiv: Move preliminary geometry counters check to mesh topology 2020-05-27 12:07:16 +02:00
Sergey Sharybin a444400900 OpenSubdiv: Keep explicit storage of base mesh faces
Allows to perform comparison by doing linear comparison of indices.

Before cyclic match was used to deal with possibly changed winding from
OpenSubdiv side.

Speeds up comparison (and hence improves FPS), makes code more reliable
nut uses more memory.
2020-05-27 12:07:16 +02:00
Sergey Sharybin 1e0de7c2ea OpenSubdiv: Compare edge topology
This change makes it so topology refiner comparison will check vertices
of all existing/provided edges.

The initial claim that due to manifold nature of mesh there is no need
in "deep" edges check was wrong: some areas might only provide edges
with non-zero creases. So if crease of one edge goes changes from 1.0
to 0.0 and crease of other edge goes from 0.0 to 1.0 the old comparison
code would not have caught it.
2020-05-27 12:07:16 +02:00
Sergey Sharybin 6a8193e505 OpenSubdiv: Refactor, move mesh topology comparison to own file
Makes it easier to follow and extend.
2020-05-27 12:07:16 +02:00