Age | Commit message (Collapse) | Author |
|
This patch uses a graph flow scheduler for creating all mesh batches.
On a Ryzen 1700 the framerate of Spring/020_02A.anim.blend went from 10 fps to 11.5 fps.
For each mesh where batches needs to be updated a sub-graph will be added to the task_graph.
This sub-graph starts with an extract_render_data_node. This fills/converts the required data
from Mesh.
Small extractions and extractions that can't be multi-threaded are grouped in a single
`extract_single_threaded_task_node`.
Other extractions will create a node for each loop exceeding 4096 items. these nodes are
linked to the `user_data_init_task_node`. the `user_data_init_task_node` prepares the userdata
needed for the extraction based on the data extracted from the mesh.
Note: If the `lines` and `lines_loose` are requested, the `lines_loose` sub-buffer is created
as part of the lines extraction. When the lines_loose is only requested the sub-buffer is
created from the existing `lines` buffer. It is assumed that the lines buffer is always
requested before or together with the lines_loose what is always the case (see
`DRW_batch_requested(cache->batch.loose_edges, GPU_PRIM_LINES)` in `draw_cache_impl_mesh.c`).
Reviewed By: Clément Foucault
Differential Revision: https://developer.blender.org/D7618
|
|
|
|
This resolves a performance regression in 2.8x where every edit-mode
update performed an edit-mesh to mesh conversion.
Now the conversion will be lazily initialized if/when it's required.
New BKE_mesh_wrapper_* functions abstract over mesh data access.
Currently only edit-mesh and regular meshes are supported.
In the future sub-surface meshes may be supported too.
|
|
|
|
|
|
Since rBcf258b02f449, only wires and edges that are mapped to the
original mesh were drawn if the mesh was modified by modifiers.
Above commit was only meant for showing orig wires for paint mask
overlays [where final wireframe is not desired], so now only use
MR_EXTRACT_MAPPED when we are in a paint mode.
Maniphest Tasks: T75343
Differential Revision: https://developer.blender.org/D7333
|
|
Note this only changes cases where the variable was declared inside
the for loop. To handle it outside as well is a different challenge.
Differential Revision: https://developer.blender.org/D7320
|
|
These headers are not needed right away, but will be in the upcoming
commit.
|
|
This was already the case in most parts of the GPU API.
Use full name for descriptive-comments.
|
|
Also rename START to BEGIN (matching BEGIN/END for most iterator macros).
|
|
|
|
This check box alters how weights are displayed and painted,
similar to Multi Paint, but in a different way. Specifically,
weights are presented as if all locked vertex groups were
deleted, and the remaining deform groups normalized.
The new feature is intended for use when balancing weights within
a group of bones while all others are locked. Enabling the option
presents weight as if the locked bones didn't exist, and their
weight was proportionally redistributed to the editable bones.
Conversely, the Multi-Paint feature allows balancing a group of
bones as a whole against all unselected bones, while ignoring
weight distribution within the selected group.
This mode also allows temporarily viewing non-normalized weights
as if they were normalized, without actually changing the values.
Differential Revision: https://developer.blender.org/D3837
|
|
This patch adds a dedicated path to extract 16bit normals instead of packing them into 10bits/comp.
The tangents are also packed to 10bits/comp if not using the new High Quality Normal option.
Fix T61024 Degraded texture shading on dense meshes
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D6614
|
|
|
|
|
|
|
|
When using duplicate linked meshes, objects that are not in edit-mode will be drawn as
it is in edit mode, when another object with the same mesh is in edit mode.
This will not be the case when one of the objects are influenced by modifiers. The change
reflects more how it was done in Blender 2.79.
The current change introduces a draw manager method that checks in detail who is responsible
for the drawing (render engine or overlay engine). If the edit mesh is not the original or
the object that is drawn doesn't draw the original mesh the object will be drawn by the render
engine.
Known Limitation of this patch is that the rendering outside edit mode doesn't reflect the
latest changes until the user switches between object and edit mode. When there are no
modifiers in use, the updating is done immediately.
IMO this would be sufficient for blender 2.82, it also fixes parts of T72733.
The updating of the surface batches requires more development and is
post-poned for now.
Reviewed By: fclem, brecht
Differential Revision: https://developer.blender.org/D6737
|
|
|
|
Instead of changing the modifiers behavior, we make sure to always use
the data->totcol instead of the ob->totcol. Also we centralize getting
this number to avoid future issues.
Fix T72593 Blender crashes when separating mesh
Fix T72017 Crash on set visibility change
|
|
This way we remove the need for the srgb boolean uniform and a lot of code complexity. However, mesh update is going to be a bit slower.
I did not benchmark the performance impact.
This also fix a typo in draw_cache_impl_particles.c and fix hair not using vertex color in workbench.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D6610
|
|
There is a cornercase when the user edits an uvmap, that is not part of
the material (yet). When this is the case the uvmap was not added to the
uv buffer and the 'pos' alias was not created.
This change will always request the active uv map when uv editing.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D6534
|
|
Thanks to @campbellbarton for the fix.
|
|
Also resolves T72848, although updating multiple windows doesn't work,
this matches 2.7x behavior.
|
|
|
|
The lines index buffer can contain all edges (edit mode) or only loose
edges (object mode). When switching between these modes the wrong
content of the index buffer can be used.
This patch will clear the lines index buffer when a `loose_edges` is requested. Making sure it is always up to date.
Note that this is supporting an exising hack where the IBO is truncated
during the creation. We should find a different way how to solve these
kind of issues.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D6349
|
|
This is the unification of all overlays into one overlay engine as described in T65347.
I went over all the code making it more future proof with less hacks and removing old / not relevent parts.
Goals / Acheivements:
- Remove internal shader usage (only drw shaders)
- Remove viewportSize and viewportSizeInv and put them in gloabl ubo
- Fixed some drawing issues: Missing probe option and Missing Alt+B clipping of some shader
- Remove old (legacy) shaders dependancy (not using view UBO).
- Less shader variation (less compilation time at first load and less patching needed for vulkan)
- removed some geom shaders when I could
- Remove static e_data (except shaders storage where it is OK)
- Clear the way to fix some anoying limitations (dithered transparency, background image compositing etc...)
- Wireframe drawing now uses the same batching capabilities as workbench & eevee (indirect drawing).
- Reduced complexity, removed ~3000 Lines of code in draw (also removed a lot of unused shader in GPU).
- Post AA to avoid complexity and cost of MSAA.
Remaining issues:
- ~~Armature edits, overlay toggles, (... others?) are not refreshing viewport after AA is complete~~
- FXAA is not the best for wires, maybe investigate SMAA
- Maybe do something more temporally stable for AA.
- ~~Paint overlays are not working with AA.~~
- ~~infront objects are difficult to select.~~
- ~~the infront wires sometimes goes through they solid counterpart (missing clear maybe?) (toggle overlays on-off when using infront+wireframe overlay in solid shading)~~
Note: I made some decision to change slightly the appearance of some objects to simplify their drawing. Namely the empty arrows end (which is now hollow/wire) and distance points of the cameras/spots being done by lines.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D6296
|
|
Caused by 4ddf3215a7df
|
|
|
|
|
|
This changes the fix for T70302 by reducing the number of things we discard.
|
|
|
|
Use same Mesh* as extraction. We always use the final mesh for shaded geom.
|
|
|
|
|
|
... and modifiers.
This was caused by wrong mesh being taken into account when in edit mode.
|
|
|
|
Was caused by DRW_mesh_batch_cache_get_edituv_faces_stretch_area called
after DRW_mesh_batch_cache_create_requested. So it was created on the wrong
object/mesh.
|
|
This commit accidentally undid a bunch of previous commits. Only the intended
changes are left now.
|
|
|
|
When the result isn't used, prefer post increment/decrement
(already used nearly everywhere in Blender).
|
|
Support for UV Stretching overlay during multi object editing. The
VBO now holds the ratios per fase. In the shader these ratios will
be compared against the global ratios. The global rations are created
from all selected objects.
The current implementation does not fit well with the draw module. The
plan is to move the drawing of other spaces towards the draw manager what
leads to a better fit. Currently the details on this solution is unclear
but this requirement will become an attentionpoint in the future design.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D5665
|
|
|
|
Before there were two options: Paste to original layer called "Paste" and Paste to active layer called "Paste & Merge"
Now, by default the paste is in active layer and the "Paste & Merge" has been renamed "Paste".
For old "Paste", now is called "Paste by Layer" and it's not the default value anymore.
Note: Minor edits to add icons not present in Differential revision.
Differential Revision: https://developer.blender.org/D5591
|
|
The correct fix would be to avoid all those hacks but this is needed if
we want to be able to parallelize object vbo extractions.
This is the fixed version of the hack. The issue was that the ibo ranges
were saved before the batch were reset and the IBO was discarded, leading
to a read after free error. All previous reported crash were tested and
are now not reproductible.
|
|
This reverts commit d357e7b06535. This caused crashes in UV editor drawing and
updates in lookdev mode.
Fixes T69087, T69083, T69088, T69096.
|
|
The correct fix would be to avoid all those hacks but this is needed if
we want to be able to parallelize object vbo extractions.
|
|
|
|
This was due to the GPUIndexBuf ranges only computed when requesting
the triangles indices. If the tris were already calculated, the new shading
batches would never have the GPUIndexBuf ranges and instead use the full
triangle index buffer.
So since this only happen when shading data does not match, we just save
the previous GPUIndexBuf ranges and reuse them for the new batch.
This patch is a bit of a hack on top of a hack but it works fine.
|
|
In rB9c010c44f420, DRW_mesh_batch_cache_create_requested was changed to
take a scene (instead of toolsettings directly), but
DRW_draw_depth_object is calling this with with NULL, just checking for
this seems to fix...
Reviewers: fclem
Maniphest Tasks: T68675
Differential Revision: https://developer.blender.org/D5488
|
|
This is done because they don't have the same update frequency. UV can be
persistent even on geometry update (ex: skinned object) but tangents
can change if the normals change.
Also the name buffer per vbo was too small to contain all names.
|