Commit Graph

9021 Commits

Author SHA1 Message Date
Patrick Mours
8378db40c7 Cycles: Fix out of memory when rendering some scenes with OptiX that work with CUDA
The OptiX implementation wasn't trying to allocate memory on the host if device allocation failed, while the CUDA implementation did. This copies the implementation over to OptiX to remedy that.

Differential Revision: https://developer.blender.org/D6068
2019-10-18 12:23:27 +02:00
Jacques Lucke
2a9b162d94 Fix T70605: incorrect darken and lighten rgb mix mode
Differential Revision: https://developer.blender.org/D6058

Reviewers: brecht, fclem
2019-10-15 17:31:44 +02:00
Dalai Felinto
7df7a8f3f1 Fix T70838: crash on cycles render after recent fix
My bad for not figuring out how to run our unittests since I got back to
Windows.
2019-10-15 10:18:11 -03:00
Dalai Felinto
280d6b03a7 Fix T70670: Hidden collections are still rendered by Cycles in the Viewport
Now local collections are fully working with cycles preview, while the
collection visibility bug is fixed.

Local collections were not working with cycles viewport even before the recent
commit to allow users to show collections that are hidden in the view layer.

It just got worse with said commit (0812949bbc3d).

Differential Revision: https://developer.blender.org/D6034
2019-10-14 22:45:33 -03:00
Campbell Barton
dc2cd2d0dc Cleanup: clang-format, spelling 2019-10-10 10:29:50 +11:00
cf682b9dab GPU: show more descriptive labels on unsupported GPU dialog
Thanks to Ray Molenkamp for the help with the Windows implementation.

Fixes T70521

Differential Revision: https://developer.blender.org/D6023
2019-10-09 13:41:26 +02:00
ad84f22628 Fix T70602: error baking with Cycles OpenCL after recent changes 2019-10-07 16:53:46 +02:00
Sergey Sharybin
2cb5078ce2 Update NUMA API library to latest version
Brings support of PPC and S390 platforms, which are required to have
Blender compiled on all ports of Debian.
2019-10-07 12:59:51 +02:00
Philipp Oeser
d4c452ff39 Fix T70573: Crash on enter Cycles render preview with 'Scene world'
disabled and no world assigned to scene

BlenderSync::sync_world still relied on a blender world (mixes the world
viewport color with the studio light), for now just take black if no
world is present.

Maybe we should we use the theme color in the future here (seems eevee
does this in that case) -- we'd have to pass down `b_userpref` from
`BlenderSession::render` down to `sync_data > sync_shaders > sync_world`
then afaics.

Reviewed By: jbakker, brecht

Maniphest Tasks: T70573

Differential Revision: https://developer.blender.org/D6005
2019-10-07 12:26:25 +02:00
Campbell Barton
60f0a94ab2 Cleanup: clang-format 2019-10-07 15:22:22 +11:00
Campbell Barton
fae0685113 Cleanup: quiet warnings 2019-10-07 12:22:05 +11:00
Ray Molenkamp
7c2affd350 Fix: Headless build 2019-10-04 13:23:26 -06:00
Jeroen Bakker
56dd7feb06 GPU: Platform Support Level
Adds a check when starting blender if your platform is supported. We use a blacklist
as drivers are updated more regular then blender (stable releases).

The mechanism detects if the support level changed or has been validated by the user previously.
Changes can happen due to users updating their drivers, but also when we change the support
level in our code base.

When the user has seen the limited support level message it is saved in the user config.
It would be better to have a system specific config section, but currently not clear
what could benefit from that.

When the platform is unsupported or has limited support a dialog box will appear including a link
to our user manual describing what to do.

**Windows**
Windows uses the MessageBox that is provided by the windows kernel.

**X11**
We use a very lowlevel messagebox for X11. It is very limited in use and can be fine tuned when needed.

**SDL/APPLE**
There is no implementation for SDL or APPLE at this moment as the platform support feature targets mostly Windows users.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5955
2019-10-04 16:23:39 +02:00
OmarSquircleArt
8afa93d82d Fix: Clamping in Map Range node works incorrectly.
The clamp option in the Map Range node doesn't work correctly when the
inputs are linked. The code didn't put that into considration.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5987
2019-10-04 15:21:46 +02:00
Julian Eisel
edffb0e9b1 UI: Register File Browser as Child/Dialog-Window for the OS
For many users, this will make the File Browser window behave more like
what they would expect. It addresses the issue of the File Browser
becoming hidden behind the main window by clicking anywhere in the
latter. It communicates the interruptive, but temporary nature of the
operation a bit better.
Further, on tiling window managers the File Browser now opens as
floating by default, like in other applications.

Note that this also makes sure the File Browser is always opened as
separate window, so it doesn't re-use the Preferences, or any other
temporary window anymore. This seems to have been a common annoyance.

More concretely, this makes the File Browser window behave as follows:
* Stays on top of its parent Blender window, but not on top of
  non-Blender windows.
* Minimizes with its parent window
* Can be moved independently
* Doesn't add an own item in task bars
* Doesn't block other Blender windows (we may want to have this though)
* Opens as floating window for tiling window managers (e.g. i3wm/Sway)

Further notes:
* When opening a file browser from the Preference window (or any
  temporary window), the main window, as the file browsers parent is
  moved on top of the Preferences, which makes it seem like the
  Preferences were closed. This is the general issue of bad secondary
  window handling as window activation changes. I made it so that the
  window is moved back once the file browser is closed.
  This behavior is confusing and would be nice to avoid. It's a separate
  issue though.
* On most window managers on Linux the temporary window can not be
  minimized and maximized, they disable that for dialog windows.
* On Windows and macOS, only minimizing is disabled, as there is no
  decent way yet to restore a window if it's not shown in the taskbar.

Reviewed By: Brecht van Lommel, Campbell Barton, William Reynish
Edits and macOS implementation by Brecht.

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

Part of T69652.
2019-10-03 17:50:27 +02:00
a6ad80d9e8 Fix T70125: crash on startup in Linux with some tablet types connected 2019-10-03 15:36:50 +02:00
Sergey Sharybin
0cc45eaac4 OpenSubdiv: Add accessor to vertex edges via refiner C-API 2019-10-03 12:36:01 +02:00
Campbell Barton
93e8c962fc Cleanup: unused structs, struct members 2019-10-03 07:39:45 +10:00
Campbell Barton
fb9024bded Fix error in opensubdiv topology refiner face matching check 2019-10-03 07:32:28 +10:00
Patrick Mours
0091b84df0 Fix T70268: Render failures with Vector pass active with OptiX in Cycles
Rendering would produce invalid results or crash if the Vector pass was active but motion blur was inactive. This caused the OptiX BVH to be built with motion (because objects reported motion available), but the pipeline to be built without motion support (since with disabled motion blur this is not in the list of requested features). The two are not compatible and therefore caused issues. This patch fixes that by not building the BVH with motion if motion blur is not active (which makes sense).

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5968
2019-10-02 13:23:29 +02:00
Stefan Werner
f97a64aa9b Fix T70252: Reverting to macOS 10.11 compatible API. 2019-10-02 10:22:26 +02:00
Patrick Mours
8dd9172aa2 Fix "motion_blur" tests with OptiX in Cycles
Curves with motion blur produced wrong results with OptiX (T69801). This is because the AABBs for the motion steps were calculated from incorrect attribute data because the offset into the attribute data array was incorrect.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5961
2019-10-01 20:01:51 +02:00
Stefan Werner
5eebd7cc1f Cycles: Fixed Camera inside volumes with Embree turned on.
The Embree backend did not properly recognize when the camera was
inside a volume and ended up ignoring those.
2019-10-01 19:35:56 +02:00
William Reynish
60a827a2a9 UI: Update paint crosshair for Mac
This is based on feedback from users.
Only affects Mac for now, Windows will be committed separately.
2019-10-01 00:00:06 +02:00
Patrick Mours
b89a1687ce Fix "denoise_animation" tests with OptiX in Cycles
The OptiX device only loads the denoising kernels when the "use_denoising" feature is active. This was not set by the calling code however and therefore they were never loaded and attempting to launch them failed (see T69801).

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5946
2019-09-30 15:38:07 +02:00
Patrick Mours
91f6aa6a57 Fix memory leak after using OptiX in Cycles
The "optix_devices" array was not freed on exit, which caused a memory leak (see T69801).

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5944
2019-09-30 14:05:40 +02:00
Campbell Barton
a6a0a09197 Cleanup: spelling 2019-09-30 17:07:05 +10:00
Stefan Werner
04133ee863 Revert "macOS: Replaced OSSpinLock with os_unfair_lock."
This reverts commit 9d282d7a8d689a17ae58e94453ae99a41e91b701.
os_unfair_lock requires macOS 10.12 or newer.
2019-09-30 08:29:17 +02:00
William Reynish
387fe3607d UI: Add high quality cursors on macOS
This adds the same high quality cursors on macOS as we have on Windows.

These are stored as 32*32 pt PDFs, same as the built-in OS cursors

Reviewed by: Brecht Van Lommel

Differential Revision: https://developer.blender.org/D5907
2019-09-27 20:41:22 +02:00
Campbell Barton
7ae85b54d7 Cleanup: clang-format 2019-09-27 12:37:53 +10:00
09dc7bce37 Fix Cycles bake panel showing for other renderers, after recent changes 2019-09-26 16:30:41 +02:00
Harley Acheson
3bf4610347 GHOST: refresh standard cursors available for platforms
* Add more standard cursor types, that platforms can optionally support.
* Remove a few unused cursor types that were not properly supported and
  would show the wrong cursor when used.
* Add native cursor files for Windows. These scale well with DPI and have
  anti-aliasing. Designed by Duarte Farrajota Ramos.

Ref D5197
2019-09-26 14:31:47 +02:00
6292cab193 GHOST: add GHOST_HasWindowCursorShape() to test if standard cursor exists
Ref D5197
2019-09-26 14:31:43 +02:00
Patrick Mours
a1e40087c5 Cycles: Fix undefined behavior which can causes crashes with a misaligned address error
Cycles casts a pointer from ShaderDataTinyStorage to ShaderData, these structs by default had different alignments however (the former was 1-byte aligned, the latter 16-byte). This caused undefined behavior on at least the CUDA platform. Forcing both structs to use the same alignment fixes this.

CUDA toolkits newer than 10.1 run into this because of a compiler optimization.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5883
2019-09-25 14:22:21 +02:00
9c62ac562c Cleanup: clang-format 2019-09-24 10:15:43 +02:00
Jeroen Bakker
36683475d1 Fix T68457: Cycles OpenCL Displacement Shading
When doing simple scenes the displacement shading failed during final
rendering when the displacement method is set to `Displacement + Bump`.

When this option is enabled the shader uses the Vector math
node. This node is part of the node group level 1. When doing simple
shading only using nodes that are part of the node group level
0 the shading was rendered black.

This only happened in final rendering as there the OpenCL programs are
optimized to save registries. Viewport rendering rendered correctly

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5859
2019-09-24 09:44:19 +02:00
1d1ef2e797 Revert part of "GPencil: Invert Paste operator and make Paste to Active default"
This commit accidentally undid a bunch of previous commits. Only the intended
changes are left now.
2019-09-23 11:09:00 +02:00
Campbell Barton
3fcedae8c8 Cleanup: extra semicolon, comma warnings 2019-09-21 11:34:39 +10:00
Yevgeny Makarov
7a83b64f7b UI: Fix Capitalization
Differential Revision: https://developer.blender.org/D5716
2019-09-20 14:31:24 +02:00
fba35aa8c5 Use FFmpeg's own av_guess_frame_rate() function instead of guessing ourselves
This was introduced in FFmpeg lavf 55.1.100 in 2013. For systems that are
still on LibAV or older FFmpeg there is a fallback implementation that
performs the same guess as we did before in `av_get_r_frame_rate_compat()`.
2019-09-19 15:12:53 +02:00
Campbell Barton
d8a7e5ee32 Cleanup: spelling 2019-09-19 13:19:53 +10:00
Jeroen Bakker
271c6794d6 Cycles: Viewport Rendering Memory Improvement
Small memory reduction change by only storing the pixels of the combined
pass when it is being shown in the viewport. Previously the combined pass
was always calculated and present in the output buffer. The combined pass
will still be calculated.

It is a limitation in Blender that Cycles always had a combined pass.
This patch will remove the limitation from the code base of Cycles.
Blender still has the limitation, but will always request the combined
renderpass when doing final rendering.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5784
2019-09-17 11:24:55 +02:00
Stefan Werner
2b9f4bcfa0 macOS: Replaced deprecated Cocoa API calls.
Most of these calls were replaced with the successors as suggested
by Xcode's Fix-It. Functionality should not be affected.
This reduces the number of warnings when building on macOS.
2019-09-14 20:27:16 +02:00
Stefan Werner
9d282d7a8d macOS: Replaced OSSpinLock with os_unfair_lock.
OSSplinLock is a deprecated API, os_unfair_lock is its successor.
This reduces the number of warnings when building on macOS.
2019-09-14 20:23:29 +02:00
Stefan Werner
ca76ecfa0e Cleanup: clang-format 2019-09-14 09:26:51 +02:00
Stefan Werner
c80564ef9f macOS: Enabled posix_memalign() like on other Unix platforms. 2019-09-13 22:49:26 +02:00
6b0d1ef7e1 Cleanup: compiler warnings 2019-09-13 16:51:51 +02:00
Campbell Barton
9e60e86057 Cleanup: clang-format 2019-09-13 21:12:43 +10:00
Patrick Mours
a2b52dc571 Cycles: add Optix device backend
This uses hardware-accelerated raytracing on NVIDIA RTX graphics cards.

It is still currently experimental. Most features are supported, but a few
are still missing like baking, branched path tracing and using CPU memory.
https://wiki.blender.org/wiki/Reference/Release_Notes/2.81/Cycles#NVIDIA_RTX

For building with Optix support, the Optix SDK must be installed. See here for
build instructions:
https://wiki.blender.org/wiki/Building_Blender/CUDA

Differential Revision: https://developer.blender.org/D5363
2019-09-13 11:50:11 +02:00
Patrick Mours
53932f1f06 Cycles: add Optix support in the kernel
This adds all the kernel side changes for the Optix backend.

Ref D5363
2019-09-13 11:46:22 +02:00