Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-07-05Revert "Fix T98773: GPU Subdivision breaks auto selection in UV edit mode"Thomas Dinges
This reverts commit e2c02655c78b2c669468ae568ddf4b17953cc98d. It caused regression T99323 which is more severe than the original fixed T98773.
2022-07-05Fix T98884: Fix edge case crashes in gpu subdiv cache codeJoseph Eagar
2022-06-28Fix T99016: GPU subdiv artifacts in weight paint with smooth shadingKévin Dietrich
Flags in the smooth shading case were not properly set.
2022-06-28Fix color attribute interpolation with GPU subdivisionKévin Dietrich
Handling of 16-bits compression was missing, which gave values that were way off.
2022-06-28Fix artefacts with GPU subdiv and weight paint face selectionKévin Dietrich
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.
2022-06-28Fix T98735: GPU subdiv displays normals for all elementsKévin Dietrich
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.
2022-06-24Fix T98773: GPU Subdivision breaks auto selection in UV edit modeKévin Dietrich
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
2022-06-22Fix T98913: GPU Subdivision: "Show Wire" overlay glitchKévin Dietrich
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.
2022-06-22Fix T98813: crash with GPU subdiv in edit mode and instanced geometryBrecht Van Lommel
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
2022-06-22Fix T98866: GPU subdiv crash in edit mode with loose geometryKévin Dietrich
The BMesh case was missing when extracting the loose edges flags used for display, so the code was crashing on unitialized `MEdge` pointer.
2022-06-07Fix T98091: EEVEE: Volume: Crash caused by non-present gridClément Foucault
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
2022-06-03Fix T98571: corrupted face selection drawing with GPU subdivisionKévin Dietrich
Simple typo in rB55e3930b253e.
2022-06-01Fix T98526: broken corner attributes with GPU subdivisionKévin Dietrich
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).
2022-06-01GPU subdiv: Fix edit mode vertex color not being uploaded properlyJoseph Eagar
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.
2022-05-31Fix T97877: broken shadows with GPU subdivisionKévin Dietrich
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.
2022-05-30Cleanup: make formatDalai Felinto
2022-05-26Fix T98385: Color attributes not working with GPU subdivisionKévin Dietrich
Contrary to coarse extraction, GPU extraction uses the same buffer for the coarse data, only the final GPU buffer needs to be offset.
2022-05-26Fix T98392: GPU subdivision crash with knife toolsKévin Dietrich
The face dots normals may not be always requested, thus leading to a crash by null pointer dereference.
2022-05-25Fix vertex format for mesh attributes with GPU subdivisionKévin Dietrich
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.
2022-05-25Fix T96080: hiding elements does not work with GPU subdivKévin Dietrich
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.
2022-05-23Fix Eevee blackbody wrong with non-default scene linear color spaceBrecht Van Lommel
* 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
2022-05-23DRW: Fix signed/unsigned mismatches in shader codeJohannes J
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
2022-05-17Fix T98052: Eevee / Workbench background render crash with GPU subdivisionBrecht Van Lommel
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
2022-05-13Fix T97330: UV points missing with some modifiersKévin Dietrich
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
2022-05-11Fix T97895: Eevee support for Geometry Nodes Color Attributes.Jeroen Bakker
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.
2022-05-11Fix T97173: Color Attributes shading turns black after switching mode.Jeroen Bakker
Sculpt colors tagged the custom data as already created (cd_used), but should have been tagged as being requested (cd_needed).
2022-05-10DrawManager: Hide lock acquire behind experimental feature.Jeroen Bakker
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}
2022-05-09Fix T97853: Crash with edit mode X-ray and subdivisionHans Goudey
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
2022-05-06DrawManager: Make instance data persistent.Jeroen Bakker
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
2022-05-05DRW: Hair: Fix shader compilation of transform feedback shaderClément Foucault
Introduced by rBadbe71c3faba.
2022-05-05Fix T97835: crash when creating hair particle system on MacGermano Cavalcante
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`.
2022-05-04Fix T96845: artifacts with GPU subdivision and mirror modifierKévin Dietrich
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.
2022-05-04Cleanup: quiet strict-prototypes warningCampbell Barton
2022-05-03Fix T93179: geonodes UVs and Vertex colors do not work in EEVEEKévin Dietrich
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
2022-05-03Fix T96338: GPU subdiv crash switching to UV editingKévin Dietrich
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.
2022-05-02EEVEE: Rewrite: Implement nodetree support with every geometry typesClément Foucault
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
2022-05-02GPUShader: Remove GPU_SHADER_INSTANCE_VARIYING_COLOR_VARIYING_SIZEClément Foucault
This had only one use and it was for debugging. Remove the shader for now. This also simplifies the debug drawing even if slower.
2022-05-01Fix T97545 DRW: Crash cause by invalid `"` char in glsl sourceClément Foucault
Some old compiler do not like this character even if inside an `#error` directive.
2022-05-01Overlay: Port wireframe shader to use shaderCreateInfoClément Foucault
This should have no functional changes.
2022-05-01Overlay: Port image empty shader to use shaderCreateInfoClément Foucault
This should have no functional changes.
2022-05-01Overlay: Port outline shaders to use shaderCreateInfoClément Foucault
This should have no functional changes.
2022-04-30Overlay: Port edit uv shaders to use shaderCreateInfoClément Foucault
This should have no functional changes.
2022-04-29Fix rendering of wire curves when used as custom bone objectsSebastian Parborg
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
2022-04-29Fix T97686 DRW: Freeze when switching to material preview or render viewClément Foucault
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.
2022-04-29Fix wrong cast from uint to int (2)Germano Cavalcante
Error in rB3d877c8a0d06
2022-04-29Fix wrong cast from uint to intGermano Cavalcante
Error in rB3d877c8a0d06
2022-04-29Select Engine: port shader to use 'GPUShaderCreateInfo'Germano Cavalcante
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
2022-04-28GPUMaterial: Rework the deferred compilation to not use double locksClément Foucault
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.
2022-04-27Fix T97235: PBVH draw cache invalidation bugJoseph Eagar
The PBVH draw cache wasn't being invalidated in all cases. It is now invalidated whenever a PBVH node's draw buffers are freed.
2022-04-27Fix T96434: bad performance with viewport statistics and GPU subdivisionKévin Dietrich
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