1
1
Commit Graph

120299 Commits

Author SHA1 Message Date
192719bdca Don't make a local variable to load the WorldClipPlanes. 2022-12-12 12:21:05 +01:00
275bbb8a4c Use GPU_SHADER; not GPU_VULKAN. 2022-12-12 12:20:23 +01:00
3a4d2df7b1 Vulkan: add cube map array. 2022-12-12 11:06:04 +01:00
c14af6b4d7 Prefix push constants to work around double macro expansion. 2022-12-12 09:47:04 +01:00
f676dbebf5 Merge branch 'master' into temp-vulkan-shader 2022-12-12 09:29:27 +01:00
40bc5aa7e5 Cleanup: Comment formatting in normal calculation
But it below the `else` case to make the control flow clearer, since
in the end that is more important. Also clarify the wording and fix
grammar slightly.
2022-12-11 23:28:01 -06:00
8c11c04448 Cleanup: Rename adjacent mesh loop accessors
But the common, more important part of the function names at the
beginning, to make them easier to find and more consistent.
2022-12-11 23:14:01 -06:00
2bb47e03f7 Cleanup: Use Span instead of MutableSpan for normals array 2022-12-11 23:09:03 -06:00
9e9ebcdd72 Mesh: Reduce memory consumption when calculating corner normals
Similar to previous commits, avoid using pointers that are redundant
to their corresponding index. Also avoid storing the edge vectors stack
in the data-per-loop when it can just be a function argument.

Face corner normals are calculated when auto smooth or custom
per-corner normals are used.

This brings the per-face-corner data from 64 to 24 bytes, as measured by
`sizeof`. In a large test file I observed a 20% performance improvement,
from 285 to 239 ms.
2022-12-11 22:47:46 -06:00
f06d7c98db Cleanup: Remove unnecessary MLoop argument
The loop was also retrievable with the index. This needed some care
though, because previously the index became "detached" from the
corresponding MLoop pointer for a short time.
2022-12-11 21:48:52 -06:00
0485baaf98 Cleanup: Reduce use of redundant local variables in normal calculation
Since face corner indices are available, using pointers to MLoop and
other data is redundant. Using fewer local variables means there is less
state to keep track of when reading the algorithm, even if it requires
more characters in some cases.
2022-12-11 21:33:29 -06:00
9338ab1d62 Mesh: Avoid storing redundant pointer in corner normal calculation
The `lnor` pointer was only used for fans containing a single face,
and can be retrieved for a specific loop from the common data anyway.
Also saves 8 bytes per corner during the calculation
2022-12-11 20:30:05 -06:00
178eb5bac5 Cleanup: Add accessor for node index
Add `bNode::index()` to allow accessing node indices directly without
manually de-referencing the runtime struct. Also adds some asserts to
make sure the access is valid and to check the nodes runtime vector.

Eagerly maintain the node's index in the tree so it can be accessed
without relying on the topology cache.

Differential Revision: https://developer.blender.org/D16683
2022-12-11 20:23:18 -06:00
05bf5c4e0e Nodes: simplify handling of function nodes in declaration
This adds an explicit post processing step to node declarations.
The purpose of this is to keep the actual node declaration functions
concise by avoiding to specify redundant information. Also it improves
the separation of the creation of the declaration from using it.
2022-12-11 19:38:26 +01:00
19491e5fc0 Nodes: extract function that builds the node declaration
This also makes it easier to add some post processing on top of
the node-defined declaration.
2022-12-11 19:12:19 +01:00
b2bee8416b Fix oslc precompiled binary not working on macOS due to wrong rpath 2022-12-11 15:08:34 +01:00
c2ca30ea24 Cleanup: avoid calling generic node update functions from versioning code
This made it harder to change these functions in the future.

No functional changes are expected and the versioning worked correctly
in my test with a files created in Blender 2.69.

Adding the sockets in the function was not necessary in my test, because
those were already added before as part of `node_verify_sockets` in
`ntreeBlendReadLib`. I kept it in just to be on the safe side.
2022-12-11 14:15:46 +01:00
f6b67f92a1 Cleanup: unused parameter 2022-12-11 12:39:59 +01:00
fe30856d83 Fix T102992: GPencil Array doesn't respect restriction in Offset
The problem was the bounding box was calculated using
all strokes, but if a filter is added, the bounding box must
include only selected strokes.

Fix by @frogstomp
2022-12-10 13:43:02 +01:00
eac8e820f2 Cleanup: move node tree field inferencing to separate file 2022-12-10 11:32:04 +01:00
Damien Picard
19d90c7a33 UI: fix several labels and tooltips
See the differential revision for details about each change.

Differential Revision: https://developer.blender.org/D15608
2022-12-09 16:10:14 -06:00
Iliya Katueshenock
a9cc10b5bb Geometry Node: Make collection info socket tooltips more consistent
Make hints and descriptions consistent with the new socket name.

Differential Revision: https://developer.blender.org/D16631
2022-12-09 16:10:14 -06:00
Iliya Katueshenock
a3251e66a7 Geometry Nodes: Image Input Node
Add a simple node to choose an image data-block.

Ref T102854

Differential Revision: https://developer.blender.org/D16644
2022-12-09 16:10:14 -06:00
Damien Picard
538d4cc998 UI: Fix and improve various labels and tooltips
Improve a few messages, but mostly fix typos in many areas of the UI.
See inline comments in the differential revisiion for the rationale
behind the various changes.

Differential Revision: https://developer.blender.org/D16716
2022-12-09 16:10:14 -06:00
Iliya Katueshenock
fc5f7a1e2d Cleanup: Use topology cache of group output node
Using a cache greatly simplifies access to the output node.
I touched on the most common and understandable cases for me.
The texture nodes were touched because it looked pretty generic.

Differential Revision: https://developer.blender.org/D16699
2022-12-09 16:10:14 -06:00
Iliya Katueshenock
ad05b78d09 Geometry Nodes: Improve viewer node domain choice for blur node
Add preferred domain based on the "Value" input field. Most often,
the domain must match the original domain for the value.

Differential Revision: https://developer.blender.org/D16730
2022-12-09 16:10:14 -06:00
07b67894e8 Fix macOS precompiled libraries built on Xcode 14 not working in Xcode 13
Disable some symbols amd linking features not available in Xcode 13.
2022-12-09 22:49:31 +01:00
3552f5d83c Build: don't bundle versioned dylib symbolic links on macOS
Apple notarization rejects packages containing them.

Similar to rpaths we handle generically this as part of the harvest step rather
than patches individual library builds systems.

Ref T99618
2022-12-09 22:49:31 +01:00
019b930d6b Fix build error with new USD libraries in debug mode
Solve conflict between TBB and Boost Python.
2022-12-09 22:49:31 +01:00
d5bcc1ef16 Cleanup: Tweak variable name in extrude node
These ranges aren't only used to index corners, also other arrays.
Also use const for some variables, mostly for aesthetic reasons.
2022-12-09 15:22:28 -06:00
d17db1d11a Geometry Nodes: Support original indices in extrude node
This allows using the "On Cage" feature in edit mode to interact with
original mesh elements via the newly created geometry. The original
indices are only set for new elements that copy attribute values
from original elements directly, so it can also be a helpful way
to visualize attribute propagation.

The change was simplified by refactoring the individual mode slightly
to create separate index maps for the new edges and vertices. That
simplified attribute copying a bit too.
2022-12-09 14:26:15 -06:00
46993958fd Geometry Nodes: Support original index layer in split edges node
This is partially a bug fix, since the original index layer wasn't
handled at all before, and could be left initialized. That was caused
by my recent change to modify a mesh in place rather than create a
new one. Also copy over any orco data, which was another unhandled
layer type.

It's also a new feature though, since it allows using the "On Cage"
feature of edit mode to adjust original mesh elements by selecting
the new ones. This brings the functionality inline with the Edge Split
modifier.
2022-12-09 14:26:15 -06:00
b000fc308b Cleanup: Resolve unused variable warnings in modifier 2022-12-09 14:26:15 -06:00
bcbd13201a deps_builder: python updates
- Added comment for additional tasks to do when bumping python
- updated sqlite to 3.39.4
- downgrade setuptools to 63.2.0 to avoid numpy build issues
- numpy 1.23.5
2022-12-09 12:27:44 -07:00
874319a344 Fix T103031: ViewLayer: Crash in indirect_only_get due to missing null check
Previous fix (rBe00f76c6a8cca) accidentally lost a null check.
Fixes T103031.
2022-12-09 20:20:21 +02:00
c85ca5e365 Fix T103015: Line art crash after recent refactor
Caused by 0940719b5a which neglected to assign the
mesh loops data.
2022-12-09 09:24:57 -06:00
0a56198139 Cleanup: Split sharp edge tagging from face corner normal calculation
Don't use the same "context" struct for tagging sharp edges from auto-
smooth / poly flags and actually calculating face corner normals. That
required more arguments, and it required breaking const slightly to
reuse the code. Also split apart pre-populating corner normals
with vertex normals, since it isn't related at all and is only used
in one code path.
2022-12-09 09:13:51 -06:00
9a7fa1b3e9 Cleanup: Use array in face corner normals calculation 2022-12-09 09:13:51 -06:00
34722fa8a0 Cleanup: Reduce indentation in mesh operator
Also use local variable for BMesh.
2022-12-09 09:13:51 -06:00
c20e456ee0 ImageEngine: Reduce memory size by dividing the region in smaller parts.
Image engine uses 4 gpu textures that are as large as the area being
drawn. The amount of needed GPU memory can be reduced by dividing the
region in smaller parts. Reducing the GPU memory also reduces the stalls
when updating the textures, improving the performance as well.

This optimization works, but is disabled for now due to some rounding
errors that drawn lines on the screen where the screen is divided.
2022-12-09 16:10:48 +01:00
bdd196661e Cleanup: ImageEngine-Move Responsibility of Texture Creation.
It used to be a number of fixed full screen images where the
responsibility was at image engine. Now moved the responsibility to the
drawing mode to make sure we can allocate non-full region-size textures
in a future refactoring.
2022-12-09 16:10:48 +01:00
595b302231 Cleanup: Remove unused method BatchUpdater::discard_batch.
Batch discarding is done by the owner of the batch.
2022-12-09 16:10:48 +01:00
255c7f26af Cleanup: Use enum class for image drawing flags. 2022-12-09 16:10:48 +01:00
83b78b1976 Cleanup: Equalize ImageEngine method names with Eevee-next.
- `cache_init` -> `begin_sync`
- `cache_populate` -> `image_sync`
- `draw_scene` -> `draw_viewport`
2022-12-09 16:10:48 +01:00
50ef008c61 Cleanup: Remove unused method from image_engine.
`get_gpu_textures` was created when the image engine didn't support
texture streaming and used the gpu textures that were stored in the
image buffer itself.
2022-12-09 16:10:47 +01:00
5ee116d448 Realtime Compositor: Implement Simple Star Glare node
This patch implements the Simple Star Glare node. This is only an approximation
of the existing implementation in the CPU compositor, an approximation that
removes the row-column dependency in the original algorithm, yielding an order
of magnitude faster computations. The difference due to the approximation is
readily visible in artificial test cases, but is less visible in actual use
cases, so it was agreed that this approximation is worthwhile.

For the future, we can look into approximating this further using a closed form
IIR recursive filter with parallel interconnection and block-based parallelism.
Which is expected to yield another order of magnitude faster computations.

The different passes can potentially be combined into a single shader with some
preprocessor tricks, but doing that complicated that code in a way that makes
it difficult to experiment with future optimizations, so I decided to leave it
as is for now.

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

Reviewed By: Clement Foucault
2022-12-09 17:05:30 +02:00
0d21b9e2da Cleanup: fix compile error on macos 2022-12-09 15:58:13 +01:00
fa27a5d066 Realtime Compositor: Implement Ghost Glare node
This patch implements the Ghost Glare node. It is implemented using
direct convolution as opposed to a recursive one, which produces
slightly different results---more accurate ones, however, since the
ghosts are attenuated where it matters, the difference is barely
visible and is acceptable as far as I can tell.

A possible performance improvement is to implement all passes in a
single shader dispatch, where an array of all scales and color
modulators is computed recursively on the host then used in the shader
to add all ghosts, avoiding usage of global memory and unnecessary
copies. This optimization will be implemented separately.

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

Reviewed By: Clement Foucault
2022-12-09 16:50:52 +02:00
a45284b855 BLI: remove deduplicated memory utility functions
These functions were originally implemented because:
- Not all of them existed pre C++17, but now we are using C++17.
- The call stack depth is quite a bit deeper with the std functions, making
  debugging slower and more annoying. I didn't find this to be a problem
  anymore recently.

No functional changes are expected.
2022-12-09 14:15:41 +01:00
7c5b7713f1 Fix T103001: Width of some compositor nodes is incorrect
Nodes which are common in multiple editors (RGB, Value, Switch, RGB to BW)
has less width in compositor editor. Patch changes compositor node width to
140 for consistency.

Reviewed by: HooglyBoogly

Differential Revision: https://developer.blender.org/D16719
2022-12-09 16:51:34 +05:30