Commit Graph

96576 Commits

Author SHA1 Message Date
Campbell Barton
2c204432df Merge branch 'blender-v2.83-release' 2020-06-03 00:59:52 +10:00
Campbell Barton
e69f70e11f Revert "Fix T67577: Add-on unregister can't access preferences on factory reset"
This reverts commit f18ed7ad890ee5c89fc6e6a22e76c732fb5fc1bc.

Better leave the fix for 2.9 series.
2020-06-03 00:59:45 +10:00
Campbell Barton
50994eace6 Fix T66967: skin modifier crash scaling skin radius to zero 2020-06-03 00:59:44 +10:00
Clément Foucault
b18c2a3c41 EEVEE: Refactor of eevee_material.c
These are the modifications:

-With DRW modification we reduce the number of passes we need to populate.
-Rename passes for consistent naming.
-Reduce complexity in code compilation
-Cleanup how renderpass accumulation passes are setup, using pass instances.
-Make sculpt mode compatible with shadows
-Make hair passes compatible with SSS
-Error shader and lookdev materials now use standalone materials.
-Support default shader (world and material) using a default nodetree internally.
-Change BLEND_CLIP to be emulated by gpu nodetree. Making less shader variations.
-Use BLI_memblock for cache memory allocation.
-Renderpasses are handled by switching a UBO ref bind.

One major hack in this patch is the use of modified pointer as ghash keys.
This rely on the assumption that the keys will never overlap because the
number of options per key will never be bigger than the pointed struct.

The use of one single nodetree to support default material is also a bit hacky
since it won't support concurent usage of this nodetree.
(see EEVEE_shader_default_surface_nodetree)

Another change is that objects with shader errors now appear solid magenta instead
of shaded magenta. This is only because of code reuse purpose but could be changed
if really needed.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D7642
2020-06-02 16:58:07 +02:00
Clément Foucault
b82cb0ad32 Cleanup: GPU: Remove GPU_shaderinterface_uniform_ensure 2020-06-02 16:46:38 +02:00
Clément Foucault
38cfcdd51b DRW: Remove defered uniform creation 2020-06-02 16:46:38 +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
Jeroen Bakker
0749cff957 Depsgraph: Remove unneeded RNA_path_resolve
Found during research of {T77124}. In `build_driver_data` an identical
 RNA_path is resolved twice. In stead of resolving it twice this patch
will construct the `property_exit_key` based on the resolution of
`property_entry_key`.

This change isn't noticeable for users. Just a cleanup as it isn't
needed to do the same logic twice.

Reviewed By: Sergey Sharybin

Differential Revision: https://developer.blender.org/D7872
2020-06-02 16:02:59 +02:00
Jeroen Bakker
752139556f BVHCache: Performance
This patch changes the BVHCache implementation. It will use
a primitive array in stead of the ListBase. The locking is also
changed from a global lock to a per cache instance lock.

The performance of `gabby.blend` available on the cloud increased from 9.7
fps to 10.5 fps.

Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D7817
2020-06-02 16:01:14 +02:00
Jeroen Bakker
bf34b0c8f4 DrawManager: Graph Task Scheduling
This patch uses a graph flow scheduler for creating all mesh batches.
On a Ryzen 1700 the framerate of Spring/020_02A.anim.blend went from 10 fps to 11.5 fps.

For each mesh where batches needs to be updated a sub-graph will be added to the task_graph.
This sub-graph starts with an extract_render_data_node. This fills/converts the required data
from Mesh.

Small extractions and extractions that can't be multi-threaded are grouped in a single
`extract_single_threaded_task_node`.

Other extractions will create a node for each loop exceeding 4096 items. these nodes are
linked to the `user_data_init_task_node`. the `user_data_init_task_node` prepares the userdata
needed for the extraction based on the data extracted from the mesh.

Note: If the `lines` and `lines_loose` are requested, the `lines_loose` sub-buffer is created
as part of the lines extraction. When the lines_loose is only requested the sub-buffer is
created from the existing `lines` buffer. It is assumed that the lines buffer is always
requested before or together with the lines_loose what is always the case (see
`DRW_batch_requested(cache->batch.loose_edges, GPU_PRIM_LINES)` in `draw_cache_impl_mesh.c`).

Reviewed By: Clément Foucault

Differential Revision: https://developer.blender.org/D7618
2020-06-02 15:54:45 +02:00
Campbell Barton
0a00fbd265 Fix T66967: skin modifier crash scaling skin radius to zero 2020-06-02 23:45:51 +10:00
Bastien Montagne
21443056b7 Turn most flags in BlenderDefRNA into proper bool. 2020-06-02 15:18:14 +02:00
Bastien Montagne
43ec8c287f Cleanup: RNA: use BlenderDefRNAtruct named members initialization. 2020-06-02 15:14:10 +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
Clément Foucault
bdda53fdb2 GPU: Texture: Replace internal sampler state by explicit state object
This makes it easier to track as well as allowing us to sample the same
texture with different sampling parameters (which should fix the related
T73942 in the long run).

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D7831
2020-06-02 10:47:56 +02:00
Campbell Barton
074d469165 Merge branch 'blender-v2.83-release' 2020-06-02 18:39:28 +10:00
Campbell Barton
ae2f21f378 Fix T76533: Gizmo uses active face center in edge selection mode
Only use the active face when it's selected.
2020-06-02 18:38:58 +10:00
Bastien Montagne
ea516bed72 Merge branch 'blender-v2.83-release' 2020-06-02 10:33:26 +02:00
Bastien Montagne
6aef27602a Cleanup: use C++'s nullptr instead of our own C NULL define, in C++ code. 2020-06-02 10:32:21 +02:00
Bastien Montagne
b724922f1a Merge branch 'blender-v2.83-release' 2020-06-02 10:26:14 +02:00
Bastien Montagne
428c0f9ad5 Fix T77192: Crash when opening bunny.blend file.
New depsgraph code handling drivers was not checking for possible NULL
rna_path, as done everywhere else in code...
2020-06-02 10:21:19 +02:00
Campbell Barton
c6957e50e8 Merge branch 'blender-v2.83-release' 2020-06-02 18:06:31 +10:00
Campbell Barton
81f817e7b4 Fix T72088: Missing header redraw when transform changes snap 2020-06-02 18:05:00 +10:00
Campbell Barton
17d8e7f833 Merge branch 'blender-v2.83-release' 2020-06-02 16:24:30 +10:00
Campbell Barton
de6c935261 Cleanup: code comments for mode switching
Comment on mode switching cases that are supported,
including the issue from recent regression T77217
which is easy to miss since it's not used in the default key-map.
2020-06-02 16:12:36 +10: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
Campbell Barton
f58e76119a Fix T77239: snap 3D cursor in edit-mode 2020-06-02 12:19:35 +10:00
Hans Goudey
4f3e686cad Cleanup: Remove Obsolete Current Frame Indicator Drawing Code
This code was made obsolete by the changes to the animation editor
scrubbing areas in D4654.

Differential Revision: https://developer.blender.org/D7898
2020-06-01 22:12:09 -04:00
Campbell Barton
8b63c6241d Fix snap3d crash (missing NULL check) 2020-06-02 10:50:53 +10:00
Pablo Dobarro
1d4bae8566 Sculpt: Cloth Filter
This tool is similar to the cloth brush, but it applies the cloth
simulation deformation to the whole mesh in an uniform way. The
simulation can be controlled using the mask to pin vertices and the face
sets to define force action areas.

It uses the same solver as the cloth brush which now no longer depends
on StrokeCache.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7857
2020-06-01 22:37:06 +02:00
Pablo Dobarro
3778f168f6 Sculpt: Pose Brush Face Sets FK mode
This Pose Brush origin mode simulates an FK deformation in the entire
model when clicking on the face sets, as they were controls of a fully
rigged character. Combined with the previous Face Sets modes that allow
creating IK chains, the pose brush should now be able to simulate most
of the common rigs deformations.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7839
2020-06-01 22:30:01 +02:00
Germano Cavalcante
5c54a609a9 Cleanup: Remove unused flag 2020-06-01 17:20:28 -03:00
Pablo Dobarro
91fb07f361 Fix mesh filter using the wrong face set as active
This was returning the wrong face set in cases where the active vertex
has more than one available face set.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7858
2020-06-01 22:18:59 +02:00
Hans Goudey
3cce8afe2c UI: Rename "View Camera Center" Op to "Frame Camera Bounds"
The current name isn't very specific about what the operator does.
The operation is more about lining up the edges with the viewport
edges than centering the view.

Differential Revision: https://developer.blender.org/D7866
2020-06-01 11:35:16 -04:00
Hans Goudey
b0038b8d73 Fix T77139: UI: Add "View Camera Center" to View Menu
The "View Camera Center" operator was not accessible by the new menu search.

Differential Revision: https://developer.blender.org/D7865
2020-06-01 11:34:07 -04:00
Hans Goudey
45dbc38a8b Fix T74552: Distribute negatives in number input
This applies a relatively simple solution for fixing some unintuitive
cases in unit handling.

Currently entering -1m50cm evaluates to -0.5m, and similarly 1'6"
evaulates to just half a foot. So effectively there's an implied + just
between the numbers, which is quite confusing.

This works by adding parentheses so the negative distributes to the
block of values before the next operator.

For example:
|         Before         |           After            |
| `-1m50cm + 1m -2m50cm` | `-(1m50cm) + 1m -(2m50cm)` |
|   `-4m + 0.5 / -1.1`   |   `-(4m) + 0.5 / -(1.1)`   |
|         `-1'6"`        |         `-(1'6")`          |
|        `-1e-2cm`       |        `-(1e-2cm) `        |

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D7813
2020-06-01 08:22:27 -04:00
Bastien Montagne
8d670546f9 Merge branch 'blender-v2.83-release' 2020-06-01 12:12:57 +02:00
Bastien Montagne
31cf87a29e Fix py api doc gen script after recent versionning changes. 2020-06-01 12:10:56 +02:00
Campbell Barton
19f3f6cd85 Merge branch 'blender-v2.83-release' 2020-06-01 19:00:23 +10:00
Campbell Barton
c204e3348c Fix T77217: Object mode toggle doesn't work
Toggling object mode to the previous wasn't working, also resolves a
case when toggling modes would cause an extra, unnecessary mode switch.
Own regression in 5159b8e1eadb3.
2020-06-01 18:56:43 +10:00
Campbell Barton
9936e23b85 Merge branch 'blender-v2.83-release' 2020-06-01 16:27:23 +10:00
Campbell Barton
10966926ce Merge branch 'blender-v2.83-release' 2020-06-01 16:27:18 +10:00
Campbell Barton
520f08aa56 Fix T77241: NDOF navigation doesn't work with the knife tool
Also allow NDOF with loop-cut.
2020-06-01 16:21:30 +10:00