When a ray travels a long distance in Cycles, precision related
artifacts can start to appear.
In most situations these aren't noticeable, but with an orthographic
camera, specifically with HIP-RT, the issue can become
quite noticeable.
This commit adds a test for this issue by placing a orthographic camera
1000m away from a subject.
Relevant bug report: blender/blender#117961
Ref: blender/blender-test-data!44
Recently a bug was introduced leading to rendering artifacts on some
devices when rendering a world volume in a scene that also contained a
distant light. This has since been fixed (1).
This commit aims to add a test for this specific case so we can detect
these sorts of issues in the future.
(1) blender/blender@58b7543ede
Ref: blender/blender-test-data!48
This would change the image type in image_save_post, which would make the
logic in BKE_image_acquire/release_renderresult mismatched.
Also consistently call BKE_image_release_renderresult when the render result
is null, rather than only doing it half the time.
Pull Request: https://projects.blender.org/blender/blender/pulls/133503
* Ensure valid bit depth is set along with file type
* Guard against invalid inputs in stereo imbuf creation
* Remove some unused code
Thanks Yiming Wu for finding the cause.
Pull Request: https://projects.blender.org/blender/blender/pulls/133499
This add back the NDC offset that was present in the legacy overlay.
But instead of adding a new view for it, we add `ndc_offset_factor`
to `State` to simplify wire offseting
Instead of modifying the projection matrix, we compute the unit
offset and pass it to the shader which choose the appropriate
factor to apply to the vertex position.
The value is put inside `State` so that it can be referenced
easily by multiple overlays.
Later on (once we move the global UBO inside Overlay) we can
move this to a UBO.
This only implements it for wireframe and edit mesh vert and
edges.
Note: that there seems to be some code duplication with the
edit mesh vertex code. That's to be tackled in another commit.
Pull Request: https://projects.blender.org/blender/blender/pulls/133433
This adds a new `DNA_print.hh` header which contains functions to print DNA
structs with all their data members in a human readable form. This is intended
for debugging purposes.
The basic usage is very straight forward: `DNA_print_struct(TypeName, data);`.
For example: `DNA_print_struct(bNode, node);`.
There is also `DNA_print_structs_at_address` which is primarily useful when
debugging what is written to a .blend file.
This was originally developed for #133063, but is already quite useful on its
own.
Pull Request: https://projects.blender.org/blender/blender/pulls/133432
Before, it was only possible to apply modifiers through a multires modifier if
they were deform-only. The Geometry Nodes modifier is of course not deform-only.
However, often one can build a node setup, that only deforms and does nothing
else.
To make it possible to apply the Geometry Nodes modifier in such cases the
following things had to be done:
* Update `BKE_modifier_deform_verts` to work with modifiers that implement
`modify_geometry_set` instead of `deform_verts`.
* Add error handling for the case when `modify_geometry_set` does more than just
deformation.
* Allow the Geometry Nodes modifier to be applied through a multi-res modifier.
Two new utility types (`ArrayState` and `MeshTopologyState`) have been
introduced to allow for efficient and accurate checking whether the topology has
been modified. In common cases, they can detect that the topology has not been
changed in constant time, but they fall back to linear time checking if it's not
immediately obvious that the topology has not been changed.
This works with the example files from #98559 and #97603.
Pull Request: https://projects.blender.org/blender/blender/pulls/131904
Support thumbnail that shows the file contents instead
of the default blend file icon for all files in Finder.
Some files may still have the usual blender icon as thumbnail
depending on their contents.
blender-thumbnailer process is kept alive by the system
in the background and is invoked by QuickLook when needed.
The checkbox to disable the extension is present in
the Settings app.
It will NOT be an interactive "Preview" that allows richer
interactions like Panning viewport, or rotating 3D objects.
The python debugger in Visual Studio for has been broken for years
but the upstream project over at https://github.com/microsoft/PTVS
show hopeful signs of life once in a while, so there is hope that
at one point this will start working again. That being said people
do keep turning this option on and end up disappointed it isn't
working and they spend a whole bunch of time on trying to get it to
work. So for now rather than removing this functionality
completely, just disable it.
This makes the `material_index` attribute built-in on `CurvesGeometry` which
means that it's built-in on `Curves` and `GreasePencil`. While only Grease
Pencil can use it so far during rendering, we already depend on them on curves
when converting between curves and Grease Pencil.
Making the attribute built-in implies that it is locked to one domain and type
(`Curve` domain and `int32` type in this case).
This makes curves more consistent with meshes.
Pull Request: https://projects.blender.org/blender/blender/pulls/133488
When locking a material, the preview icon would get greyed-out (as would
the rest of the properties in the row).
This issue is that this defeats the purpose of an accurate preview of
the material. Artists want to know what the material _actually_ looks
like.
This moves the icon into a separate row and property so that
it doesn't get disabled.
Pull Request: https://projects.blender.org/blender/blender/pulls/133478
Cycles uses pixel buffers to update the display. Due to making things
work the vulkan backend downloaded the GPU allocated pixel buffer to the
CPU, Copied it to a GPU allocated staging buffer and update the display
texture using the staging buffer. Needless to say that a (CPU->)GPU->CPU->GPU
roundtrip is a bottleneck.
This PR fixes this by allowing the pixel buffer to act as a staging
buffer as well.
Viewport and final image rendering performance is now also similar.
| **Render** | **GPU Backend** | **Path tracing** | **Display** |
| ---------- | --------------- | ---------------- | ----------- |
| Viewport | OpenGL | 2.7 | 0.06 |
| Viewport | Vulkan | 2.7 | 0.04 |
| Image | OpenGL | 3.9 | 0.02 |
| Image | Vulkan | 3.9 | 0.02 |
Tested on:
```
Operating system: Linux-6.8.0-49-generic-x86_64-with-glibc2.39 64 Bits, X11 UI
Graphics card: AMD Radeon Pro W7700 (RADV NAVI32) Advanced Micro Devices radv Mesa 24.3.1 - kisak-mesa PPA Vulkan Backend
```
Pull Request: https://projects.blender.org/blender/blender/pulls/133485
This is due to missing depsgraph update and notifiers to redraw the
viewport region. `ensure_selection_domain` returns false when entire
domain elements are/ain't selected. This makes the `changed` boolean
false that further prevents update calls. Now fixed with bitwise
condition.
Pull Request: https://projects.blender.org/blender/blender/pulls/133463
Prior to this commit, the Fade Inactive Geometry overlay would inspect
the active object and compare each other object's mode and hide them if
they did not share the same mode.
This was incorrect in the following case:
* If multiple objects were all in similar modes, as can be the case
with "Lock Object Modes" off, or with multi-edit mode, then objects
would remain unfaded if they shared the same mode as the active
object.
To fix this, we explicitly check for both the active and the "other"
object being in edit mode and avoid fading in this case.
Ref: #87704
Pull Request: https://projects.blender.org/blender/blender/pulls/132255
Cycles supports OptiX on Maxwell and up architectures, but the
default in OSL is to generate PTX targeting Pascal and up. Adjust the
OSL target architecture to Maxwell to fix this.
Pull Request: https://projects.blender.org/blender/blender/pulls/133011
The recent addition of DEG_disable_visibility_optimization in #133358
almost fixed this, but it was not fully working. By ensuring objects
are evaluated we avoid modifying original objects.
If for some reason (like a Python handler) the object is still missing,
report an error in the bake operator.
Pull Request: https://projects.blender.org/blender/blender/pulls/133439
This commit adds a unit test for the `bke::pbvh::Tree::from_mesh` method
covering the basic mesh usecase. Further work to add the multires
and BMesh versions will come in subsequent commits.
Pull Request: https://projects.blender.org/blender/blender/pulls/133074
If a USD file has joint indices outside the range of the joints list,
it's possible for our code to assert or crash depending on build
configuration.
One particular file had 289000 indices, nearly all of which were outside
the list which contained just 1 joint value. Instead of continuing when
this is detected, trace an error and immediately return as it's probably
unsafe to continue. This also resulted in many thousands of warning
traces before.
Pull Request: https://projects.blender.org/blender/blender/pulls/133419
These geometry types don't work properly with attributes currently,
so the persistent base isn't really "persistent" and doesn't last after
exiting sculpt mode, but it's still useful for it to work within a
sculpt session. Enable that by adding temporary array storage in
`SculptSession`. During the sculpt refactor project I mistakenly
assumed that this didn't work well enough that anyone would use it.
Pull Request: https://projects.blender.org/blender/blender/pulls/133410