Commit Graph

120055 Commits

Author SHA1 Message Date
Hans Goudey
81c4b7b23e Subdiv: Simplify loose edge subdivision neighbor retrieval
- Directly check for vertices with two edge neighbors instead of looping
- Use arrays of C++ types as return values
- Use lambda to avoid repetition for each edge vertex
- Use `edge_other_vert` utility
2024-05-20 23:07:14 -04:00
Hans Goudey
c5bec86e71 Cleanup: Use C++ types, return values for loose edge subdivision 2024-05-20 23:07:14 -04:00
Clément Foucault
8f9fa07cc1 Fix: EEVEE-Next: Fix compilation error in GLSL
`common` is reserved keyword apparently
2024-05-20 22:44:11 +02:00
Hans Goudey
1910bb1a95 Cleanup: Correct mesh draw cache struct names 2024-05-20 15:40:47 -04:00
Hans Goudey
44a647197e Cleanup: Avoid storage for active element geometry node
Recently we haven't been adding separate storage structs just to
store a single enum, partially with the hope these will be changed
to sockets in the future, but also because it isn't worth the boilerplate.
Missed in the review of #121333.
2024-05-20 15:12:15 -04:00
Colin Basnett
2fe92c63d3 Geometry Nodes: Add Active Element tool node
This pull request adds an "Active Element" node that exposes the active
vertex, edge, or face index to the geometry node tool context. The
presence of an active element is available as a boolean.

This node enables the creation of "active-to-selected" style operators.

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/121333
2024-05-20 21:01:30 +02:00
Iliya Katueshenock
1904e2fc8d Geometry Nodes: treat rotation as vector data type in link-drag-search in some nodes
If there is implicit conversion between rotation and vector type, so these search items
make sense.

Pull Request: https://projects.blender.org/blender/blender/pulls/121754
2024-05-20 20:30:52 +02:00
Hans Goudey
f181027f6b Cleanup: Rename variable in mesh modifier evaluation
`mesh_final` isn't really the final mesh but the "current" mesh. Adding the
extra word here isn't helpful. This also helps to reduce the size of the diff
in #119968 where the mesh variables have much smaller scopes.
2024-05-20 13:37:15 -04:00
Clément Foucault
8d4576d165 Fix: EEVEE-Next: Discrepancy in GGX pdf and eval function 2024-05-20 19:32:05 +02:00
Hans Goudey
f9f7f25e8d Fix #121880: Node clipboard loses links for dynamic declarations
Some nodes like the simulation input have sockets that depend on
other nodes in the tree, via dynamic declarations. The first fix here
is remapping those inter-node references before adding links and
updating declarations. The second is storing link references with
socket identifiers instead of socket pointers. This is necessary
because the new sockets aren't added to the socket map when the
node is copied. Avoiding pointer storage is also less fragile in general.

Pull Request: https://projects.blender.org/blender/blender/pulls/122013
2024-05-20 19:20:41 +02:00
Hans Goudey
c4fc19f064 Cleanup: Use reference argument for BKE_mesh_copy_for_eval 2024-05-20 13:18:24 -04:00
Hans Goudey
5025c57679 Cleanup: Use references in mesh_data_update.cc 2024-05-20 13:11:18 -04:00
Hans Goudey
a6ecfe2f79 Cleanup: Rename DerivedMesh.cc and header
After recent commits, the .cc file is only used for actual object data
evaluation in the depsgraph, and the header is only used for the old
DerivedMesh data structure that's still being phased out.
2024-05-20 13:11:18 -04:00
Hans Goudey
25b059549b Cleanup: Rename mesh_data_update to mesh_data_update
Mesh object evaluation is unrelated to DerivedMesh nowadays. Change the
name to something similar to the other evaluation functions called in
BKE_object_handle_data_update.
2024-05-20 13:11:18 -04:00
Hans Goudey
5733f6e906 Cleanup: Move mesh evaluation functions to C++ namespace
And move them out of the DerivedMesh header so that can just be used
for the actual DerivedMesh code.
2024-05-20 13:11:18 -04:00
Jacques Lucke
4e3f455f80 Cleanup: move PointerRNA_NULL closer to type definition
This simplifies zero-initializing `PointerRNA` in structs even when
just `RNA_types.hh` is included. Previously, one had to use
`RNA_access.h` to access it. It's also `constexpr` now which can
have small performance benefits in theory.
2024-05-20 18:49:52 +02:00
Clément Foucault
d4b4107d32 EEVEE-Next: Use PDF instead of BSDF for denoising
This adds PDF computation for eval functions as
well as using PDF for spatial denoising.

This seems to not do have any impact but at least
it seems more sounds than bsdf / pdf. Also
computing pdf is cheaper than whole bsdf.

Pull Request: https://projects.blender.org/blender/blender/pulls/121858
2024-05-20 18:13:09 +02:00
Hans Goudey
040bfcee12 Cleanup: Remove unused DerivedMesh code 2024-05-20 11:52:08 -04:00
Hans Goudey
ce104c33d6 Cleanup: Move CDDerivedMesh to new legacy file
Grouping the legacy DerivedMesh code in the same place helps keep
the actively maintained code clearer and clarifies what we are hoping
to remove in the future.
2024-05-20 11:45:57 -04:00
Hans Goudey
f73f3451d9 Cleanup: Move legacy DerivedMesh code to a separate file
Move to a file with the more consistent "mesh_legacy" naming, out of the
modifier evaluation code which has nothing to do with this anymore. That
file can be renamed in a separate step.
2024-05-20 11:40:09 -04:00
Hans Goudey
19aa5b793d Cleanup: Fix const correctness of node find socket function 2024-05-20 11:16:34 -04:00
Hans Goudey
907941309b Cleanup: Remove unused node function declaration 2024-05-20 11:08:27 -04:00
Hans Goudey
5a9a04a990 Cleanup: Use StringRef for node find socket function 2024-05-20 11:08:19 -04:00
Hans Goudey
9b1c6fb04b Cleanup: Use const for edit mesh deformation arguments 2024-05-20 10:14:41 -04:00
Hans Goudey
9e019c33fc Cleanup: Remove unused logger for USD point reader 2024-05-20 10:04:55 -04:00
Hans Goudey
1efbc78b0d Cleanup: Add comment about edit mesh BMesh ownership 2024-05-20 10:00:31 -04:00
Hans Goudey
4e622fbccd Revert "UI: Remove icon usage in brush tool RNA enums"
This reverts commit fd5a790f36.

Fixes #121700
2024-05-20 09:50:28 -04:00
Hans Goudey
cdf59b7355 Refactor: Move preview image runtime data to runtime struct
Follow up for 5445fae9cf

Pull Request: https://projects.blender.org/blender/blender/pulls/122009
2024-05-20 15:24:03 +02:00
Hans Goudey
5445fae9cf Refactor: Use more standard storage for PreviewImage runtime data
Using a non-virtual derived struct for polymorphism is error prone,
especially combined with the requirements of DNA. Instead, use a
separately allocated runtime struct as done for many other DNA structs.

In a followup commit, the remaining runtime members of `PreviewImage`
could be moved to the new runtime struct.

Pull Request: https://projects.blender.org/blender/blender/pulls/121509
2024-05-20 14:25:44 +02:00
Omar Emara
434ad164a8 Fix #121940: Viewport compositor works on part of render
The Viewport Compositor only operates on part of the render when doing
viewport rendering when in camera view. That's because the code wrongly
assumed camera offset even when doing viewport renders, which do not
exist in that case.
2024-05-20 14:27:31 +03:00
Habib Gahbiche
a241790e8f Fix image viewer sampler does not consider image offset
When viewer image is drawn with offset (because of translation in compositor), the sampler doesn't consider the offset, resulting in wrong sampled values

Pull Request: https://projects.blender.org/blender/blender/pulls/121992
2024-05-20 10:56:12 +02:00
Hans Goudey
70b008d18d Cleanup: Fix header location of color attribute fill function
The function was declared in a BKE header but defined in
the sculpt_paint editors module. Move it to the slightly-less
arbitrary ED_sculpt.hh header instead.
2024-05-19 23:28:50 -04:00
Hans Goudey
5687072223 Cleanup: Sculpt: Use return values, C++ types 2024-05-19 23:28:50 -04:00
Hans Goudey
a72dbea01a Cleanup: Sculpt: Use return values for neighbor averaging functions 2024-05-19 23:28:50 -04:00
Hans Goudey
c7feda34ab Cleanup: Private member naming in PaintingKernel 2024-05-19 23:28:50 -04:00
Hans Goudey
85e5f38279 Cleanup: Use lambda instead of simple callback
Pull Request: https://projects.blender.org/blender/blender/pulls/121980
2024-05-20 02:58:15 +02:00
Hans Goudey
0ef1541834 Cleanup: Use C++ arrays in mesh batch cache 2024-05-20 02:58:13 +02:00
Hans Goudey
da32aeb455 Cleanup: Use C++ types for various mesh array arguments
Also remove duplicated code for creating an array of BMesh positions
2024-05-20 02:58:13 +02:00
Hans Goudey
e916cd5d69 Mesh: Simplify triangle draw extraction slightly
- Don't store triangulation or triangle face indices in MeshRenderData.
  This makes more automatic use of the lazy calculation and saves the
  calculation of the face indices in some cases.
- Don't use the "extractor" abstraction for the triangle index buffer.
  This is part of the ongoing transition described by #116901.
- Pass the "face sorted" data directly to the triangle index buffer
  creation. That's the only place that needs it. This makes the
  dependencies more explicit and might make better use of CPU cache.
2024-05-20 02:58:13 +02:00
Hans Goudey
3f6217c208 Cleanup: Sculpt: Use const and references
Just a general propagation of const and references, mainly for
`Object` and `SculptSession` variables, but also others.

Pull Request: https://projects.blender.org/blender/blender/pulls/121993
2024-05-20 02:56:25 +02:00
Campbell Barton
669fad29e9 Cleanup: clarify doc-strings for BLI_fftw
Reserve comments immediately before the function for doc-strings in
the header. Otherwise both are candidates as doc-strings.
2024-05-20 10:29:22 +10:00
Campbell Barton
d8a05e20a0 Cleanup: resolve missing declaration warnings 2024-05-20 10:25:31 +10:00
Campbell Barton
096eed9d7f Cleanup: spelling in comments 2024-05-20 10:23:54 +10:00
Campbell Barton
db617bc07b Cleanup: quiet warning mixing int/enum 2024-05-20 10:13:20 +10:00
Campbell Barton
72627a9d84 CMake: correct GCC's template-id-cdtor warning being suppressed 2024-05-20 10:10:55 +10:00
Iliya Katueshenock
14233be92f Nodes: hide reroute input socket in sidebar
The same as d27a1c47fa. Reroute node is
value-less and there is no actual value of input socket that should be used.

Pull Request: https://projects.blender.org/blender/blender/pulls/121150
2024-05-19 21:35:10 +02:00
Vitaljok
7d5cd60023 EEVEE-Next: adding framebuffer viewport reset to Film
Fix #121782

`GPencil` engine renders on the whole framebuffer.
If `Render region` is used, the result of GP rendering is scaled from whole
framebuffer down to the selected region.

The fix adds framebuffer viewport reset after rendering.
This resolves the problem for downstream consumers of
the framebuffer (e.g. `GPencil`).

The final result is somewhat similar to the `EEVEE Legacy`.
Now `EEVEE` rendering is done in the selected region, while `GPencil`
is rendered on whole viewport as before.

Pull Request: https://projects.blender.org/blender/blender/pulls/121979
2024-05-19 19:02:02 +02:00
Clément Foucault
5a83346b47 Fix: EEVEE-Next: Broken Shader compilation 2024-05-19 16:58:40 +02:00
Jacques Lucke
d1782f13c8 Nodes: show extra info tooltip when hovering over text
Previously, the tooltip was only shown when hovering over the icon.
2024-05-19 14:41:28 +02:00
Clément Foucault
71d5e49db8 Fix: EEVEE-Next: Nvidia shader compilation error
Fix #121968
2024-05-19 13:52:50 +02:00