Commit Graph

9907 Commits

Author SHA1 Message Date
Brecht Van Lommel
1767a7c986 Fix build error on macOS after recent changes 2020-09-04 19:35:05 +02:00
Brecht Van Lommel
f04260d8c6 CMake: refresh building and external library handling of Cycles standalone
* Support precompiled libraries on Linux
* Add license headers
* Refactoring to deduplicate code

Includes work by Ray Molenkamp and Grische for precompiled libraries.

Ref D8769
2020-09-04 17:10:50 +02:00
Sergey Sharybin
3e3e42cbcb Cycles: Cleanup, mark overridden virtual methods as such
Solves strict Clang warnings reported on Linux.
2020-09-04 12:37:25 +02:00
OmarSquircleArt
340cbc7f15 Fix T79803: Wrong Distance To Edge 1D Voronoi
The current 1D Voronoi implementation for the Distance to Edge option
computes the distance to the cells instead. This patch fixes that and
compute the distance to the edge.

Reviewed By: JacquesLucke, brecht

Differential Revision: https://developer.blender.org/D8634
2020-09-03 18:56:27 +02:00
Sebastian Parborg
6f6f6ee186 Fix missing "extern_bullet" library when building rigidbodies 2020-09-02 19:44:29 +02:00
Julian Eisel
4330f147d0 Fix unused variable warning on Windows with WITH_INPUT_IME disabled 2020-09-02 17:32:58 +02:00
Ray Molenkamp
c992fd3a3c Cycles: Support WITH_CYCLES_NATIVE_ONLY with MSVC
This change enables the developer option `WITH_CYCLES_NATIVE_ONLY`
for MSVC. This allows a developer to just build the cycles
CPU kernel for their specific system rather than all kernels,
speeding up development.

Other platforms have had this option for years, but MSVC lacks
the compiler switch to target the host architecture hence it
always build all kernels.

This change uses a small helper program to detect the required
flags.

Only AVX/AVX2 are tested, for the following reasons

- SSE2 is enabled by default and requires no flags
- SSE3/4 have no specific build flags for msvc
- AVX512 is not yet supported by cycles

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

Reviewed by: brecht, sergey
2020-09-02 09:19:44 -06:00
Ray Molenkamp
1082edfdfd Cleanup: Clang-format 2020-09-02 09:19:14 -06:00
Sebastian Parborg
1aa54d4921 Make rigidbody simulation handle animated objects gracefully
The animated objects was not updated for each internal substep for the rigidbody sim.
This would lead to unstable simulations or very annoying clipping artifacts.

Updated the code to use explicit substeps and tie it to the scene frame rate.

Fix T47402: Properly updating the animated objects fixes the reported issue.

Reviewed By: Brecht, Jacques

Differential Revision: http://developer.blender.org/D8762
2020-09-02 14:20:41 +02:00
Stefan Werner
009971ba7a Cycles: Separate Embree device for each CPU Device.
Before, Cycles was using a shared Embree device across all instances.
This could result in crashes when viewport rendering and material
preview were using Cycles simultaneously.

Fixes issue T80042

Maniphest Tasks: T80042

Differential Revision: https://developer.blender.org/D8772
2020-09-01 21:00:55 +02:00
Imre Palik
f6dc6caa15 Fix Cycles build error when disabling some kernel features
Differential Revision: https://developer.blender.org/D8372
2020-09-01 19:14:31 +02:00
Jacques Lucke
fec522be6a Fix T79941: mantaflow cache doesn't work with ' character in path
The fix is to escape the `'` character as well.

Reviewers: sebbas

Differential Revision: https://developer.blender.org/D8773
2020-09-01 16:33:32 +02:00
Stefan Werner
17cf500101 Cycles: Fixed Cycles standalone build.
The node refactor in 429afe0c626a was missing in the standalone code.
2020-09-01 14:13:17 +02:00
Clément Foucault
a6185e4fa5 OCIO: Make GLSL implementation use GPUUniformBuf to avoid debug errors
Now that we use internal state info, we require drawing that uses the
GPU api to use it throughout the whole pipeline. This is in order to
track the GL state and do our own error checking.
2020-09-01 12:03:52 +02:00
Sebastian Parborg
f818d1d636 Cleanup: Fix warnings in our intern bullet api wrapper
No functional changes.
2020-09-01 12:01:50 +02:00
Stefan Werner
45da7ce177 Cycles: Followup fixes for node ownership refactor.
There were some places where nodes still would end up without owners.

See D8540 and 429afe0c626a
2020-09-01 11:47:54 +02:00
Clément Foucault
058d29ed9a GHOST: Enable debug context on offscreen context too
This was a long standing TODO. This was also preventing debug callbacks
form other context than the main window.
2020-09-01 00:30:36 +02:00
Kévin Dietrich
429afe0c62 Cycles: introduce an ownership system to protect nodes from unwanted deletions.
Problem: the Blender synchronization process creates and tags nodes for usage. It does
this by directly adding and removing nodes from the scene data. If some node is not tagged
as used at the end of a synchronization, it then deletes the node from the scene. This poses
a problem when it comes to supporting procedural nodes who can create other nodes not known
by the Blender synchonization system, which will remove them.

Nodes now have a NodeOwner, which is set after creation. Those owners for now are the Scene
for scene level nodes and ShaderGraph for shader nodes. Instead of creating and deleting
nodes using `new` and `delete` explicitely, we now use `create_node` and `delete_node` methods
found on the owners. `delete_node` will assert that the owner is the right one.

Whenever a scene level node is created or deleted, the appropriate node manager is tagged for
an update, freeing this responsability from BlenderSync or other software exporters.

Concerning BlenderSync, the `id_maps` do not explicitely manipulate scene data anymore, they
only keep track of which nodes are used, employing the scene to create and delete them. To
achieve this, the ParticleSystem is now a Node, although it does not have any sockets.

This is part of T79131.

Reviewed By: #cycles, brecht

Maniphest Tasks: T79131

Differential Revision: https://developer.blender.org/D8540
2020-08-30 23:49:38 +02:00
Philipp Oeser
2bb60db94a Merge branch 'blender-v2.90-release' 2020-08-28 14:00:51 +02:00
Brecht Van Lommel
d3f2037966 Fix T80149: Cycles OpenCL baking broken after changes to uses tiles for baking
We forgot to update this code as part of D3108. I'd like to include this in 2.90,
it's entirely broken now so can't really get any worse.

Differential Revision: https://developer.blender.org/D8738
2020-08-28 12:53:50 +02:00
Hans Goudey
714dbf273c Clang Tidy: Fix warning
Fix readability-static-definition-in-anonymous-namespace in new code
2020-08-27 14:18:06 -05:00
Ray Molenkamp
6438fc4f79 Cleanup: Fix MSVC warning in mantaflow
This resolves the following MSVC warning:

warning C4805: '&=': unsafe mix of type 'int' and type 'bool' in operation
2020-08-26 19:07:24 -06:00
Jacques Lucke
8a9912eaf8 Tests: fail automated tests on memory leaks and other internal errors
This adds a new `--debug-exit-on-error` flag. When it is set, Blender
will abort with a non-zero exit code when there are internal errors.
Currently, "internal errors" includes memory leaks detected by
guardedalloc and error/fatal log entries in clog.

The new flag is passed to Blender in various places where automated
tests are run. Furthermore, the `--debug-memory` flag is used in tests,
because that makes the verbose output more useful, when dealing
with memory leaks.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D8665
2020-08-26 22:02:02 +02:00
Brecht Van Lommel
0498feb0df Fix T80129: Cycles shadow catcher viewport error with exposure other than 1 2020-08-26 19:26:38 +02:00
Yevgeny Makarov
2ef5fabec9 Fix T77900: File Browser in macOS fullscreen crashes
When Blender is started in fullscreen mode from the command line,
or if the fullscreen state is saved in the startup file, all temporary windows
will also open in fullscreen mode. When closing the fullscreen File Browser,
Blender would either crash or parent window becomes black.

This does not happen if the Blender switches to full screen manually.

`NSWindowCollectionBehaviorFullScreenPrimary` should be set for windows that
can enter full-screen mode. Otherwise macOS will turn the wrong window into
full-screen.

Similar fix: rB4b39de677d20

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

Reviewed by: Julian Eisel
2020-08-26 16:27:05 +02:00
Jacques Lucke
e414afbaf6 Cleanup: typos 2020-08-26 11:24:10 +02:00
Dalai Felinto
c44251c7d7 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-26 11:18:41 +02:00
Brecht Van Lommel
21cb6f09ff Fix T77298: Cycles multiple object making not working with multiple samples
The previous fix loaded the pixels so existing tiles were not overwritten.
However the Cycles render buffer is expected to be scaled by the number of
sample, which was not taken into account.

This is not ideal in that previews could have a mismatched number of samples
between multiple objects, though the result will be correct. The better solution
would be to bake all objects together per tile, rather than one after the other.
But that is a bigger change than we can do in 2.90.

Differential Revision: https://developer.blender.org/D8704
2020-08-25 18:00:35 +02:00
Pablo Dobarro
975fc39457 Merge branch 'blender-v2.90-release' 2020-08-24 18:28:58 +02:00
Brecht Van Lommel
dc74d60915 Fix T79819: crash with OSL trace() and getmessage() after Embree changes
The return value of scene_intersect must be checked, the isect struct members
can't be assumed to be initialized if that returns false.

Differential Revision: https://developer.blender.org/D8692
2020-08-24 17:54:25 +02:00
Kévin Dietrich
5303509354 Fix T80076: Cycles Alembic Motion Blur Problem
The problem occurs when a deforming modifier is added to the object
after the MeshSequenceCache modifier. We should only consider the cached
velocities if the MeshSequenceCache modifier is the last one on the
object and we also need to check for the correct vertex count before
adding the motion vertex attribute.
2020-08-24 16:56:23 +02:00
Kévin Dietrich
734abaa252 Cycles: cleanup, remove unused parameter
This parameter was introduced during a revision of the Alembic motion
blur patch, and is not needed anymore.
2020-08-24 16:56:23 +02:00
Ray Molenkamp
ee2e2f14ac numaapi: Sync with upstream
Fixes potential build error in some build configurations
2020-08-24 07:45:39 -06:00
Imre Palik
afbc727da2 Cycles: Fix missing dependencies in libcycles_device
The code uses OpenGL functionality, so is to be linked against
OpenGL libraries.

This makes it easier to integrate with cycles using CMake.

Differential Revision: https://developer.blender.org/D8371
2020-08-24 11:45:47 +02:00
Kévin Dietrich
aa1e4baa22 Cycles : add a Volume Geometry Node
This splits the volume related data (properties for rendering and attributes) of the Mesh node
into a new `Volume` node type.

This `Volume` node derives from the `Mesh` class since we generate a mesh for the bounds of the
volume, as such we can safely work on `Volumes` as if they were `Meshes`, e.g. for BVH creation.
However such code should still check for the geometry type of the object to be `MESH` or `VOLUME`
which may be bug prone if this is forgotten.

This is part of T79131.

Reviewed By: brecht

Maniphest Tasks: T79131

Differential Revision: https://developer.blender.org/D8538
2020-08-19 15:47:09 +02:00
Clément Foucault
482a51aabf Cleanup: GPUState: Remove stack from the state manager and rename it 2020-08-18 21:30:10 +02:00
Dalai Felinto
8ab0d0e399 Merge remote-tracking branch 'origin/blender-v2.90-release' 2020-08-18 14:55:44 +02:00
Dalai Felinto
83e3d25bca Remove (ifdef) RNA for simulation, point cloud and particles
For 2.90 release this should not be exposed in the RNA API.

In master this needs to be ON by default, that's all.

Differential Revision: https://developer.blender.org/D8589
2020-08-18 14:41:16 +02:00
Kévin Dietrich
1da0685076 Cycles: add a Pass Node
The Pass struct is now a Node and the passes are moved from the Film
class to the Scene class.

The Pass Node only has `type` and `name` as sockets as those seem to be
the only properties settable by exporters (other properties are implicit
and depend on the pass type).

This is part of T79131.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8591
2020-08-18 14:28:59 +02:00
Kévin Dietrich
c82166ffcd Cycles: move some Scene related methods out of Session
This moves `Session::get_requested_device_features`,
`Session::load_kernels`, and `Session::update_scene` out of `Session`
and into `Scene`, as mentioned in D8544.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8590
2020-08-18 11:50:37 +02:00
Philipp Oeser
c65c66320f Merge branch 'blender-v2.90-release' 2020-08-17 21:11:29 +02:00
Philipp Oeser
e157573fab Fix T77683: Cycles baking crash with motion blur enabled and no camera
specified

Maniphest Tasks: T77683

Differential Revision: https://developer.blender.org/D8593
2020-08-17 21:04:55 +02:00
Stefan Werner
1c892e6814 Cycles: Fix local intersections in Embree for non-instancd geometry.
Embree's occlusion filter was checking against the wrong object ID
and not exiting correctly in case of a mismatch.

Fixes T79723
2020-08-17 20:41:34 +02:00
Richard Antalik
118e78a844 Merge branch 'blender-v2.90-release' 2020-08-17 20:39:07 +02:00
Brecht Van Lommel
2b896fc481 Fix T79052: Cycles new sky texture fails with sun size zero
Clamp to a minimum angle to avoid precision issues.
2020-08-17 17:57:29 +02:00
Stefan Werner
d88721879b Cycles: Fix local intersections in Embree for non-instancd geometry.
Embree's occlusion filter was checking against the wrong object ID
and not exiting correctly in case of a mismatch.

Fixes T79723
2020-08-17 16:04:01 +02:00
Campbell Barton
9762c3892e Cleanup: spelling 2020-08-17 12:34:05 +10:00
Julian Eisel
e037c7230d Merge branch 'blender-v2.90-release' 2020-08-14 17:58:05 +02:00
Julian Eisel
04f703fca6 Fix warning when compiling on Linux with WITH_XR_OPENXR enabled 2020-08-14 17:57:24 +02:00
Julian Eisel
e8dfe91767 Merge branch 'blender-v2.90-release' 2020-08-14 17:18:09 +02:00