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
diff options
context:
space:
mode:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2022-03-02 17:10:26 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2022-03-02 17:19:55 +0300
commit6883c47bb5930be5a95d1c2e8e06fce2d3b68681 (patch)
tree9c5fc32c03e6994a33827f2e7eaaa6d857f5554d /source/blender/blenkernel/BKE_subdiv_mesh.h
parent4a95c3466fafcd3e9116cd0d7fdcc63f2dc38bd2 (diff)
Fix T94729: GPU subdivision does not support meshes without polygons
There are two issues revealed in the bug report: - the GPU subdivision does not support meshes with only loose geometry - the loose geometry is not subdivided For the first case, checks are added to ensure we still fill the buffers with loose geometry even if no polygons are present. For the second case, this adds `BKE_subdiv_mesh_interpolate_position_on_edge` which encapsulates the loose vertex interpolation mechanism previously found in `subdiv_mesh_vertex_of_loose_edge`. The subdivided loose geometry is stored in a new specific data structure `DRWSubdivLooseGeom` so as to not pollute `MeshExtractLooseGeom`. These structures store the corresponding coarse element data, which will be used for filling GPU buffers appropriately. Differential Revision: https://developer.blender.org/D14171
Diffstat (limited to 'source/blender/blenkernel/BKE_subdiv_mesh.h')
-rw-r--r--source/blender/blenkernel/BKE_subdiv_mesh.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_subdiv_mesh.h b/source/blender/blenkernel/BKE_subdiv_mesh.h
index 73a3e8ed02e..2eae5338ae0 100644
--- a/source/blender/blenkernel/BKE_subdiv_mesh.h
+++ b/source/blender/blenkernel/BKE_subdiv_mesh.h
@@ -30,6 +30,7 @@ extern "C" {
#endif
struct Mesh;
+struct MEdge;
struct Subdiv;
typedef struct SubdivToMeshSettings {
@@ -49,6 +50,14 @@ struct Mesh *BKE_subdiv_to_mesh(struct Subdiv *subdiv,
const SubdivToMeshSettings *settings,
const struct Mesh *coarse_mesh);
+/* Interpolate a position along the `coarse_edge` at the relative `u` coordinate. If `is_simple` is
+ * false, this will perform a B-Spline interpolation using the edge neighbors, otherwise a linear
+ * interpolation will be done base on the edge vertices. */
+void BKE_subdiv_mesh_interpolate_position_on_edge(const struct Mesh *coarse_mesh,
+ const struct MEdge *coarse_edge,
+ bool is_simple,
+ float u,
+ float pos_r[3]);
#ifdef __cplusplus
}
#endif