Commit Graph

94140 Commits

Author SHA1 Message Date
Jeroen Bakker
3c9956fe55 Cleanup: Suppress compilation warning in eevee_lights.
Temporarily commented out LightModule::input_depth_tx until it is used to hide a
compilation warning.
2022-08-15 11:58:19 +02:00
Chris Blackbourn
77c867a5ee Cleanup: simplify sin_cos_from_fraction
Multiply numerator and denominator by 8 to split circle into octants.
Use symmetry and negation to increase precision.
2022-08-15 15:47:02 +12:00
Chris Blackbourn
4a11c0aabb Fix regression: crash with uv constrain to bounds without image
Merge confusion between cc1daa9b76 and 0d62e963b0.
2022-08-15 15:05:57 +12:00
Clément Foucault
659b63751d EEVEE-Next: Light: Add light evaluation support
This is the same implementation as the old one.
2022-08-14 20:40:04 +02:00
Clément Foucault
67d7792503 EEVEE-Next: Light: New light module
Compared to the previous implementation this has a limit of 65536 lights
per scene. Lights exceeding this limit will be ignored.

This also introduce fine grained GPU light culling, making rendering
many lights in a scene more efficient as long they don't overlap much.

Compatible light panels have been unhidden.

Note: This commit does not include surface evaluation, only light culling.
2022-08-14 20:40:04 +02:00
Clément Foucault
1226f5848d DRW: Add intersection and shape libraries for GLSL
These are meant to provide easy shape and AABB operation for culling.

They are currently incomplete but can be extended as one see fits.

The `common_debug_shape_lib.glsl` contains helper to draw thoses shapes.
2022-08-14 20:40:04 +02:00
Clément Foucault
0f7a5c4070 DRW: Debug: Fix print template
It was impossible to print literals like `drw_print(5)`.
2022-08-14 20:40:04 +02:00
Clément Foucault
89a2cb9297 DRW: Debug: Fix drw_debug_sphere not positioning and scaling the sphere
It was an oversight.
2022-08-14 20:40:04 +02:00
Clément Foucault
c81c5358ac GPencil: Engine: Make GL lights declaration optional
This avoid some macro name clashing with other engines where this struct
is not needed.
2022-08-14 20:40:04 +02:00
Clément Foucault
4b14fea38e GPU: Fix shader builder compilation
Was missing a stub.
2022-08-14 20:40:04 +02:00
Hans Goudey
407f11c55f Cleanup: Move object_vgroup.c to C++ 2022-08-14 14:32:54 -04:00
Hans Goudey
39bad22008 Cleanup: Add comments about deprecated flags 2022-08-14 09:19:40 -04:00
Hans Goudey
64f0c25a46 Fix: Incorrect access of mesh hide layers
Mistake in 2480b55f21
2022-08-13 22:34:11 -04:00
Harley Acheson
dcfe7f795c BLF: Adjustments to Static Font Details
Adjust static font details so that we can properly display Arabic
contextual letter forms. And so that alphabetical ligatures are loaded
from language-specific fonts.

See D15678 for more details

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

Own Code.
2022-08-12 11:57:53 -07:00
Sebastian Parborg
3de18e16dd Merge branch 'blender-v3.3-release' 2022-08-12 17:57:10 +02:00
Sebastian Parborg
c1c0473a7e Fix out of bounds read in LineArt if there are only interestion edges
In this case the array allocation would allocate an array of size zero.
This would then later lead to out of bounds memory reads.

Now the code will skip zero length allocations.
2022-08-12 17:56:36 +02:00
Germano Cavalcante
0efb6d8a83 Merge branch 'blender-v3.3-release' 2022-08-12 12:13:52 -03:00
Germano Cavalcante
82fe475f06 Fix T100370: Depth choice for "Add Cube" tool always using Surface
As the surface normal is calculated along with the coordinates, the
surface depth was always being used when surface orientation was set.

Therefore, even calculated, ignore the surface depth when it is not
required.

Also promote an optimization when neither orientation nor depth is required.
2022-08-12 12:13:24 -03:00
Bastien Montagne
6c6e59e846 Merge branch 'blender-v3.3-release' 2022-08-12 16:23:28 +02:00
Bastien Montagne
62eb21e3ce Fix T100203: Freeze using override_hierarchy_create with Object level property with custom getter function.
As suggested by @brecht, use the `BPy_BEGIN`/`END_ALLOW_THREADS` macros.

Note that there may be other bits of code needing this too.
2022-08-12 16:23:12 +02:00
Bastien Montagne
27105af938 Cleanup: unused debug variable. 2022-08-12 15:20:43 +02:00
Bastien Montagne
110356d8ad Merge branch 'blender-v3.3-release' 2022-08-12 15:18:37 +02:00
Bastien Montagne
47af1ce8ac Cleanup: leftover debug prints. 2022-08-12 15:18:10 +02:00
Bastien Montagne
4e5f9bbd34 Merge branch 'blender-v3.3-release'
Conflicts:
	source/blender/editors/space_outliner/outliner_tools.cc
2022-08-12 15:17:12 +02:00
Bastien Montagne
c73cc15e07 LibOverride: Rework Outliner contextual menu.
Follow-up to design discussions here at the studio, add liboverride
operations into their own sub-menu, with three main entries:
- Create: Create, or enable for user editing, override hierarchies.
- Reset: Keep overrides data, but reset all local changes to the
  reference linked data values.
- Clear: like reset, but also turn editable overrides back to system
  overrides (aka non user editable).

Those three options can all operate either on the selected items, their
content only, or both.

Advanced operations are moved into a "Troubleshoot Hierarchy" sub-menu,
where one can resync, resync enforced, and fully delete library
overrides. Those operations always affect a whole override hierarchy,
regardless of which items are selected or not.
2022-08-12 15:11:59 +02:00
Campbell Barton
886768a699 CMake: correct linking order regression
Library sorting from [0] caused WITH_GPU_BUILDTIME_SHADER_BUILDER
to fail. It's possible there are missing dependencies that caused
the change in order to break, for now revert that change.

[0]: 19b5524d1c
2022-08-12 22:13:50 +10:00
Campbell Barton
223d623891 Cleanup: remove use_normals arugment to MOD_deform_mesh_eval_get
Accessing the normals creates them on demand so there was no need
to pass an argument requesting them.
2022-08-12 22:10:02 +10:00
Campbell Barton
afc71a0512 Merge branch 'blender-v3.3-release' 2022-08-12 21:51:18 +10:00
Campbell Barton
f4aec3719f Merge branch 'blender-v3.3-release' 2022-08-12 21:51:16 +10:00
Campbell Barton
4dc9a8a21e Fix T100191: Crash with the wave modifier using normals in edit-mode 2022-08-12 21:49:06 +10:00
Brecht Van Lommel
4d2e2a6691 Fix T100350: missing brush falloff preview in sculpt mode 2022-08-12 13:46:34 +02:00
Bastien Montagne
d42b61014b Merge branch 'blender-v3.3-release' 2022-08-12 12:42:35 +02:00
Bastien Montagne
e0e4005582 Cleanup: Typos in comments. 2022-08-12 12:42:03 +02:00
Bastien Montagne
74645d969b Merge branch 'blender-v3.3-release'
Conflicts:
	source/blender/blenkernel/BKE_lib_override.h
2022-08-12 12:40:46 +02:00
Bastien Montagne
afd2e9ebc3 Fix (unreported) infinite tie building Outliner liboverride hierarchy tree.
In complex scenes featuring thousands of connections between IDs in
their liboverride hierarchies (e.g. Heist files), the time required to
check if tree items were available (before allocated a new one) would
become insanely long (O(n^2)).

This commit brings it back to roughly a constant time, only re-checking
the whole array for unused items once in a while (once every 10k times
currently), since in almost all cases is the index after `lastused`
value is not unused, and you have reached the end of the currently used
array of items, you actually need to 'allocate' a new one anyway.

It also improves the handling of `lastused` index, in particular in
`tse_group_add_element`.

This makes switching to the Outliner override hierarchy view in Heist
scenes from virtually infinite time (more than 30mins for sure) to about
20 seconds on my machine. Still far from being effectively usable.

Note that this is only a bandaid fix anyway, root of the issue is that
this view has to deal with way too many items in its tree, current code
is not designed for that. Either outliner has to improve its tree
handling (by only building subsets of the whole tree maybe?), or we have
to cull/filter out some of the ID relationships between overridden IDs
to make this view actually usable. Maybe limit the depth of the tree?
2022-08-12 12:37:10 +02:00
Bastien Montagne
7f44dc79a6 Fix (unreported) crashes in Outliner override hierarchy view.
Fix wrong assumption that 'embedded' IDs are only ever used by their
owners. This is especially not true with shape keys.

Also small optimization by adding an eraly abort when both IDs are the
same (i.e. an ID has a pointer to itself).
2022-08-12 12:37:10 +02:00
Bastien Montagne
12b3616895 IDType get_owner: add an optional hint about owner ID.
In some cases, there is a chance code already knows who might be the
owner of the given ID, in which case it can be more efficient to check
it first (especially in cases like embedded node trees or scene
collections, where the only other way is to loop over all possible
owners currently).

Will be used in next commit in some Outliner fix.
2022-08-12 12:37:10 +02:00
YimingWu
498e26fa0f Fix T100138: Use double for LineArt intersection record.
The use of `float` for intermediate intersection record led to some
inaccuracy which caused flickering in intersection lines. Now fixed.
2022-08-12 15:40:58 +08:00
Campbell Barton
b751275af2 Cleanup: repeated words in strings 2022-08-12 12:46:31 +10:00
Campbell Barton
996cb4008d Cleanup: repeated words in comments 2022-08-12 12:38:54 +10:00
Campbell Barton
266a125b11 Cleanup: use sizeof() for better readability 2022-08-12 12:21:47 +10:00
Campbell Barton
a1926c04b4 Cleanup: remove unnecessary ifdef 2022-08-12 11:25:10 +10:00
Campbell Barton
269e037ff4 Cleanup: replace misleading use of 'true' for the bit-field size
Also use a bit-field for SnapObjectParams.keep_on_same_target
2022-08-12 11:20:56 +10:00
Campbell Barton
c321572456 Cleanup: screw modifier comments & naming
Rename dist to dist_sq as it's the squared distance,
also prefer __func__ in temporary allocated arrays.
2022-08-12 11:18:00 +10:00
Campbell Barton
42698b2dd9 Cleanup: use enum type for argument 2022-08-12 11:02:37 +10:00
Campbell Barton
d4a082bc70 Cleanup: use short names for verts & polys as they're unambiguous
Follow conventions used in most existing code.
2022-08-12 10:56:27 +10:00
Campbell Barton
0c0c361123 Cleanup: replace magic number with flag 2022-08-12 10:48:15 +10:00
Campbell Barton
8649ac0ca8 Cleanup: early exit ui_but_extra_operator_icon_mouse_over_get
Early exit when the button has no extra icons, avoiding a redundant
transformation from mouse to button coordinates.
2022-08-12 10:41:39 +10:00
Campbell Barton
a2247c271c Cleanup: typo in selection check
In practice this is harmless as in most cases checking selected
vertices is enough, however as the intention is to check all 3 elements
it's best to do so.
2022-08-12 10:37:28 +10:00
Campbell Barton
282a861e11 Fix incorrect custom-data layer access for hide layers
Error in [0], missed in review.

[0] 2480b55f21
2022-08-12 09:16:09 +10:00