Part of #116901.
Includes a general standardization of the code, removing constant
checks from hot loops, standardizing naming, tweaking BMesh face
iteration. And includes parallelization too.
Part of #116901.
To avoid resizing the buffer, the data is added to a temporary vector
first. That should be fine because the number of roots is expected to
be quite small compared to the size of the mesh.
Part of #116901.
The algorithm is very complicated to I didn't adjust it. The changes are just
removing the data struct and un-sharing some code to make things a bit
simpler. I also changed the loop to iterate over faces rather than triangles
to avoid the reverse triangle to face lookup. This removes the need to
create the `corner_tri_faces` map, saving 4 bytes per triangle.
Part of #116901.
A straightfoward change this time; the algorithm wasn't adjusted,
it was just put inside of a single loop. I did change some nested if
statements to continue statements to reduce indentation though.
Part of #116901.
The BMesh version of the algorithm was parallelized because BMesh has
edge to face topology lookup available.
This also allows removing `GPU_vertbuf_steal_data`, by just generating
the correct data type in the first place. Removing that should help dealing
with improvements to VBO data ownership in the future.
Part of #116901.
For meshes, extract vertex group weights to a temporary vertex-sized
array, then gather them to the final VBO array. This reduces duplicate
work, and eventually the gather step could be done on the GPU too.
Part of #116901.
Most of these loops were extremely simple, so function call overhead
would have been problematic in the existing code. However, they're
also so simple that they're most likely memory bound, so I wouldn't
expect a large performance change.
This PR establishes the beginning of the transition to data-oriented code
for sculpt brushes described in #118145. The final brush "API" design is
still in progress, and further iteration will be required as more brushes are
refactored and other areas can be cleaned up.
Currently the main goal is making the code paths more obvious and easing
future development, but this change itself may also give a performance
improvement. In a simple test with a large mesh, that was about 14%.
Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/121835
Sculpt brush cursor is still drawn when annotation tool is selected.
Use `SCULPT_poll` function for paint cursor poll function (`pc->poll`).
This new poll function checks whether active tool is brush. In case of
non-brush tools (transform, annotate), poll function will return false
which eventually prevents pc->draw() from drawing the brush cursor.
Fix is similar to !122657
Pull Request: https://projects.blender.org/blender/blender/pulls/122709
The Film-like curve mapping option in the RGB Curves node in the
compositor produces bad results when editing its RGB curves. That's
because Film-like curve mapping only works with the combined curve by
definition, since it is a hue preserving mapping. Furthermore, the
Film-like option ignored the white balancing step altogether.
To fix this, we hide the current curve option for the File-like option
and only allow editing the combined curve, handing the same case for
versioning and RNA updates. Further, we port the implementation from the
realtime compositor which is both correct and takes white balancing into
account.
Pull Request: https://projects.blender.org/blender/blender/pulls/122762
This was caused by #122706 which moved the
versioning after linking where the engine is
already changed to EEVEE-Next. This made the
versioning never run.
# Conflicts:
# source/blender/blenloader/intern/versioning_400.cc
Both these operators would quite often put the framed strips offscreen.
This was in part due to the padding need to make sure that the strips
were not going to be obscured by the scrub area or overlays not being
applied or calculated correctly.
In addition to that, the view positioning logic was not in sync with the
vertical clamping code. This lead to the operators positioning the view
into a forbidden state. So the clamping logic would adjust the view
afterwards and thus put some of the framed strips offscreen.
This patch unifies the logic used by the "frame X" operators and the
clamping code, making them play nice with each other.
Pull Request: https://projects.blender.org/blender/blender/pulls/122219
Add an overlay option to automatically display a label on reroute nodes.
This automatic label is propagated through chained reroute nodes and
is based on the explicit label of linked reroute nodes.
The automatic label is dimmed to distinguish it from manually set ones.
Pull Request: https://projects.blender.org/blender/blender/pulls/113368
The type for `bpy_struct.keyframe_insert()`'s `options` parameter was
instead applied to a non-existent `flag` parameter.
The description and type for `mathutils.Vector.Repeat()`'s `vector`
parameter was instead applied to a non-existent `tuple` parameter.
Also fix a reference to `BMElemeSeq` instead of `BMElemSeq`.
Ref: !122734
This patch implements blue-noise dithered sampling as described by Nathan Vegdahl (https://psychopath.io/post/2022_07_24_owen_scrambling_based_dithered_blue_noise_sampling), which in turn is based on "Screen-Space Blue-Noise Diffusion of Monte Carlo Sampling Error via Hierarchical Ordering of Pixels"(https://repository.kaust.edu.sa/items/1269ae24-2596-400b-a839-e54486033a93).
The basic idea is simple: Instead of generating independent sequences for each pixel by scrambling them, we use a single sequence for the entire image, with each pixel getting one chunk of the samples. The ordering across pixels is determined by hierarchical scrambling of the pixel's position along a space-filling curve, which ends up being pretty much the same operation as already used for the underlying sequence.
This results in a more high-frequency noise distribution, which appears smoother despite not being less noisy overall.
The main limitation at the moment is that the improvement is only clear if the full sample amount is used per pixel, so interactive preview rendering and adaptive sampling will not receive the benefit. One exception to this is that when using the new "Automatic" setting, the first sample in interactive rendering will also be blue-noise-distributed.
The sampling mode option is now exposed in the UI, with the three options being Blue Noise (the new mode), Classic (the previous Tabulated Sobol method) and the new default, Automatic (blue noise, with the additional property of ensuring the first sample is also blue-noise-distributed in interactive rendering). When debug mode is enabled, additional options appear, such as Sobol-Burley.
Note that the scrambling distance option is not compatible with the blue-noise pattern.
Pull Request: https://projects.blender.org/blender/blender/pulls/118479
PBVH_UpdateRedraw was always combined with PBVH_UpdateBB.
The use for the "redraw update" isn't clear anyway, since there are
more specific tags for everything that would require a redraw.
The Glare node shifts the color of the highlights when the threshold is
high. That's because the thresholding algorithm simply subtracts the
threshold from the RGB data, which is not expected to retain the same hue
of the color.
To fix this, we do the thresholding only on the luminance of the color
in HSV color space. This eliminates the color shifting and also helps to
smooth the edges of the highlights.
This is a breaking change, but it is more of a fix rather than a change
of behavior.
Pull Request: https://projects.blender.org/blender/blender/pulls/122570
Make use of USD's new UTF-8 support to allow our import/export code to
accept and generate appropriate USD files. This has been a long standing
shortcoming since USD's introduction, with incomplete and complicated
DCC-specific workarounds often attempted.
Summary of changes
- Export gets a new "Allow Unicode" option defaulting to "false". The
new Unicode USD files are not backward compatible. DCCs using older
versions of USD (before 24.03) will not be able to load such files so
we want to provide this as an opt-in option for now.
- Every location which used to call either `USDHierarchyIterator::make_valid_name`
or `pxr::TfMakeValidIdentifier` will now go through a new `make_safe_name`
API instead
- Export code is responsible for passing in the `allow_unicode` option
- Import code will always pass in `true` meaning Blender will happily
accept both existing and new Unicode USD files
Strangely, USD does not provide a convenient way of making valid UTF-8
identifiers and they left their old API unchanged. We had to roll our
own per their advice: https://forum.aousd.org/t/how-to-make-a-unicode-identifier-valid/1435
Pull Request: https://projects.blender.org/blender/blender/pulls/122471
When a popover includes panels, the calculation of whether the mouse
is over the panel header does not take into consideration local 2D
scaling. Therefore the hit area is in the wrong location if scaled.
Pull Request: https://projects.blender.org/blender/blender/pulls/122696