Age | Commit message (Collapse) | Author |
|
This reverts commit e2c02655c78b2c669468ae568ddf4b17953cc98d.
It caused regression T99323 which is more severe than the original fixed T98773.
|
|
|
|
Flags in the smooth shading case were not properly set.
|
|
Handling of 16-bits compression was missing, which gave values that were
way off.
|
|
Addendum to previous fix, which was for point selection, this fixes the
face selection mode. The issue is caused by wrong flags used for paint
mode (the edit mode flag was always used). Also add back flag which was
accidentally removed in 16f5d51109bce849dff5379c60360f271622ac0f.
|
|
The normals flags were not setup properly which made normals for all
elements (vertices, faces) to be drawn when using the normals overlay.
Also remove usage of uints for the flag in the APIs.
|
|
When GPU subdivision is used, and the modifier is not set to be applied
on the cage, UV selection is not synced with the face selection in the
viewport.
This happens because the extraction, despite being in edit mode, is set
to `MESH` instead of `BMESH` (or `MAPPED` in some cases) like for CPU
subdivision, and since the mesh is not always synchrnised with the BMesh
the edit mode flags are not always updated.
With GPU subdivision, when creating the `MeshRenderData`, the condition
`has_mdata && do_final && editmesh_eval_final != editmesh_eval_cage` is
true which forces the `MESH` extraction. Following comment in D14485,
this replace the `has_mdata` in the condition with `use_mapped` which
solves the issue.
Differential Revision: https://developer.blender.org/D15248
|
|
Issue is caused by an off by one error which would map some edge loops to
the loops of some the next polygon in the list of polygon, which may not
be a topological neighbor.
|
|
Instancing with geometry nodes uses just the evaluated Mesh, and ignores the
Object that it came from. That meant that it would try to look up the subsurf
modifier on the instancer object which does not have the subsurf modifier.
Instead of storing a session UUID and looking up the modifier data, store a
point to the subsurf modifier runtime data. Unlike the modifier data, this
runtime data is preserved across depsgraph CoW. It must be for the subdiv
descriptor contained in it to stay valid along with the draw cache.
As a bonus, this moves various Mesh_Runtime variables into the subsurf runtime
data, reducing memory usage for meshes not using subdivision surfaces.
Also fixes T98693, issues with subdivision level >= 8 due to integer overflow.
Differential Revision: https://developer.blender.org/D15184
|
|
The BMesh case was missing when extracting the loose edges flags used for
display, so the code was crashing on unitialized `MEdge` pointer.
|
|
This was caused by the `copy_m4_m4` trying to copy the `object_to_texture`
from `drw_grid` which was `nullptr`.
Fixing this also exposed that rendering such volumes (without any valid
grid attributes) is not supported and we should follow what Cycles does.
Differential Revision: https://developer.blender.org/D15147
|
|
Simple typo in rB55e3930b253e.
|
|
Although reusing the same patch coordinate for all corner pointing the
same vertex works for interpolation vertices, it does work for
interpolation face varying attributes. So we need to keep the original
patch coordinates around for face varying interpolation. This was caused
by the previous fix (a5dcae0c641604c033f852e41841f58460c40069).
|
|
Also cleaned up the code a tad bit. Note that I
found two more bugs:
* GPU subdivision attribute interpolation
is producing visual artifacts.
* "Show on cage" mode for subdivision surface
just shows black colors.
|
|
Issues stems from the mesh not being watertight. This was caused by
floating point precision issues when evaluating patch coordinates at
patch boundaries (loops/corners in different patches pointing to the same
vertex). To fix this we ensure that all loops pointing to the same vertex
share the same patch coordinate. This keeps code simple, and does not
require to track precision issues in floating point math all over the
place.
|
|
|
|
Contrary to coarse extraction, GPU extraction uses the same buffer for
the coarse data, only the final GPU buffer needs to be offset.
|
|
The face dots normals may not be always requested, thus leading to a
crash by null pointer dereference.
|
|
A global variable was mistakenly used here which would accumulate the
vertex attributes (leading to an assertion failure after a while), use
the wrong number of components depending on the attribute data type,
among other issues.
|
|
Faces, edges, and vertices are still shown when GPU subdivision is
actived. This is because the related edit mode flags were ignored by the
subdivision code.
The flags are now passed to the various compute shaders mostly as part of
the extra coarse data, also used for e.g. selection. For loose edges, a
temporary buffer is created when extracting them. Loose vertices are
already taken into account as it reuses the routines for coarse mesh
extraction, although `MeshRenderData.use_hide` was not initialized,
which is fixed now.
|
|
* Port over new code tables from Cycles
* Convert Rec.709 to scene linear for lookup table.
* Move code for wavelength and blackbody to IMB so they can access the
required transforms, which are not in blenlib.
* Remove clamping from blackbody shader to bypass the texture read.
Since it's variable now easiest to just always read from the texture
than pass additional parameters.
* Fold XYZ to RGB conversion into the wavelength table.
Ref T68926
|
|
Fix the following error messages on Blender startup
since commit 308a12ac647d6f9b4ef2b6c403903e0aeb65a571.
This commit fixes T98194.
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D15007
|
|
The problem is that depsgraph evaluation happens before the OpenGL context
is initialized, and so modifier evaluation happens without GPU subdivision.
Later the BKE_subsurf_modifier_can_do_gpu_subdiv test in the draw code gives
a different result.
This just checks if the mesh has information for GPU subdivision in the draw
code, and if so uses it. This is only set if the test for supported GPU
subdivision passes in the modifier evaluation.
Additionally it may be good to perform OpenGL context initialization earlier
so background render can take advantage of GPU subdivision, but this is more
complicated.
Differential Revision: https://developer.blender.org/D14969
|
|
When extracting UV point indices, only the vertex points coming from the
original geometry should be drawn. For this, the routines (for subdivision
and coarse meshes) would only consider a vertex to be real if the extraction
type is `MAPPED`, and that an origin index layer on the vertices exist
with a valid origin index for the current vertex.
However, if the extraction type is `MESH`, which can happen with for
example an empty Geometry Node modifier, or with deferred subdivision,
this would consider every vertex to not be "real" and therefore hidden from
the UV editor.
This reworks the condition for "realness" to also consider a vertex to be
real if there is no origin layer on the vertices. The check on the extraction
type is removed as it becomes redundant.
This only modifies the check in the UV data extraction for point indices,
however similar checks exist throughout the extraction code, these will
be dealt with separately in master.
Differential Revision: https://developer.blender.org/D14773
|
|
Geometry nodes can generate color attributes that aren't on point or corner domain.
When not found in these domains it will be processed as a common attribute.
|
|
Sculpt colors tagged the custom data as already created (cd_used), but
should have been tagged as being requested (cd_needed).
|
|
The acquire locking of the draw manager introduced other issues.
The current implementation was a hacky solution as we know that the
final solution is something totally different {T98016}.
Related issues:
* {T97988}
* {T97600}
|
|
The mesh drawing code used a different mesh to check whether or not to
draw face dots and to actually retrieve them. The fix is moving the
responsibility of determining whether to use subsurf face dots to the
creation of `MeshRenderData` where the mesh used for drawing is
known, rather than doing it at a higher level.
Differential Revision: https://developer.blender.org/D14855
|
|
When resizing a viewport all engine instance data was cleared.
This wasn't the intended design and lead to performance regressions
in the image engine.
This patch makes sure that the instance data isn't cleared when
the viewport size changes. When using instance data, draw engines
are responsible to update the textures accordingly.
This could also reduce flickering/stalling when resizing the viewport
in eevee-next.
Fixes T95428.
Reviewed By: fclem
Maniphest Tasks: T95428
Differential Revision: https://developer.blender.org/D14874
|
|
Introduced by rBadbe71c3faba.
|
|
Recently `gpu_shader_3D_smooth_color_frag.glsl` had the uniform declarations removed.
For shaders without `ShaderCreateInfo` that require this source this results in the error:
```
ERROR (gpu.shader): hair_refine_shader_transform_feedback_workaround_create FragShader:
|
54 | fragColor = finalColor;
|
| gpu_shader_3D_smooth_color_frag.glsl:5:0: Error: Use of undeclared identifier 'fragColor'
| gpu_shader_3D_smooth_color_frag.glsl:5:0: Error: Use of undeclared identifier 'finalColor'
|
55 | fragColor = blender_srgb_to_framebuffer_space(fragColor);
|
| gpu_shader_3D_smooth_color_frag.glsl:6:0: Error: Use of undeclared identifier 'fragColor'
| gpu_shader_3D_smooth_color_frag.glsl:6:0: Error: Use of undeclared identifier 'fragColor'
```
So port that shader to use `ShaderCreateInfo`.
|
|
The coarse polygon count was set to the one of the BMesh instead of
the the one of the mesh used for subdivision, which caused the
compute shaders to output wrong data.
|
|
|
|
Overwriting UV map or vertex color data in Geometry nodes will move the
layers to another CustomData channel, and as such, will make attribute
lookup fail from the UVMap and Vertex Color nodes in EEVEE as the
CustomDataType will also be modified (i.e. no longer `CD_MTFACE` or
`CD_MCOL`).
As discussed in T93179, the solution is to use `CD_PROP_AUTO_FROM_NAME`
so that the render engine is able to find the attributes. This also makes
EEVEE emulate Cycles behaviour in this regard. `attr_load_uv` and
`attr_load_color` are also removed in favor of the generic attribute
API in the various GLSL shaders.
Although `CD_PROP_AUTO_FROM_NAME` is now used even for UV maps, the
active UV map is still used in case the attribute name is empty, to
preserve the old behavior.
Differential Revision: https://developer.blender.org/D13730
|
|
The crash is caused as the data for the UV editor is requested before
the data for the mesh as a separate draw update. Since building the UV
stretch angle buffer requires the position buffer, the latter is not
created yet in this case.
To fix this, create a local position buffer from the subdivision data. An
alternate fix was considered to remove the dependency on the position
buffer by interpolating on the GPU the coarse stretch angle buffer but
this did work. Maybe this will be revisited.
|
|
This commit introduce back support for all geometry types and all nodetree support.
Only the forward shading pipeline is implemented for now.
Vertex Displacement is automatically enabled for now.
Lighting & Shading is placeholder.
Related Task: T93220
# Conflicts:
# source/blender/draw/engines/eevee_next/eevee_engine.cc
# source/blender/gpu/CMakeLists.txt
|
|
This had only one use and it was for debugging. Remove the shader for now.
This also simplifies the debug drawing even if slower.
|
|
Some old compiler do not like this character even if inside an `#error`
directive.
|
|
This should have no functional changes.
|
|
This should have no functional changes.
|
|
This should have no functional changes.
|
|
This should have no functional changes.
|
|
In the current code we do not render any curves if they have not been
converted to meshes. This change makes the custom bone drawing try to
render mesh objects first and then falls back to curve objects if there
is no mesh data available.
Reviewed By: Clement
Differential Revision: http://developer.blender.org/D14804
|
|
This was caused by the compilation job being created suspended (to avoid
UI slowdown because of the material Preview Icons). The suspended job
wasn't passing the `WM_jobs_test` in `DRW_deferred_shader_remove` and
the material would still be in the compile queue with its status equal to
`GPU_MAT_QUEUED`. This would block the main thread in the waiting loop.
But since the job manager timer needs to execute in the main thread, the
compilation job was never being pushed out of its suspended state.
This lead to a complete lock situation.
The solution is to use `WM_jobs_customdata_from_type` which does exactly
what we need.
Also fixed a nullptr free.
|
|
Error in rB3d877c8a0d06
|
|
Error in rB3d877c8a0d06
|
|
Simple port with a few cosmetic changes:
- Attribute named "color" for indices VBO is now called "index"
- The indices VBO is now composed of `int`s instead of `uint`s (this simplifies the source)
Differential Revision: https://developer.blender.org/D14800
|
|
This uses refcounter instead of double thread mutexes. This should be
more robust and avoir use after free situation.
Also remove redundant structures and the use of scene as the job owner.
|
|
The PBVH draw cache wasn't being invalidated in
all cases. It is now invalidated whenever a PBVH
node's draw buffers are freed.
|
|
The subdivision is always recomputed on the CPU when displaying stats
if the mesh is animated which leads to bad performance.
This caches the subdivision topology counters from the draw code in the
mesh runtime and uses them for the viewport statistics.
Differential Revision: https://developer.blender.org/D14774
|