Mesh exploder

New 'Exploded' visualisation mode in BufferViewer with new exploder controls
hidden when not in 'Exploded' mode.

Change 'solidShading' and 'solidShadeMode' to 'visualisation' and
'visualisationMode'.

Hide the 'highlightVerts' widget when using 'Exploded' vis for both
real-estate and practical implementation reasons.
This commit is contained in:
Dan Hawson
2023-12-09 11:40:30 +00:00
committed by Baldur Karlsson
parent da3e2366ac
commit 442b48bb77
23 changed files with 634 additions and 197 deletions
+7 -2
View File
@@ -309,10 +309,15 @@ struct MeshDisplay
DOCUMENT("``True`` if the bounding box around the mesh should be rendered.");
bool showBBox = false;
DOCUMENT("The :class:`solid shading mode <SolidShade>` to use when rendering the current mesh.");
SolidShade solidShadeMode = SolidShade::NoSolid;
DOCUMENT(
"The :class:`visualisation mode <Visualisation>` to use when rendering the current mesh.");
Visualisation visualisationMode = Visualisation::NoSolid;
DOCUMENT("``True`` if the wireframe of the mesh should be rendered as well as solid shading.");
bool wireframeDraw = true;
DOCUMENT("Displace/explode vertices to help visualise vertex reuse vs disjointedness.");
float vtxExploderSliderSNorm = 0.0f;
DOCUMENT("Scales the exploded vertex displacement.");
float exploderScale = 1.0f;
static const uint32_t NoHighlight = ~0U;
};
+8 -3
View File
@@ -2895,7 +2895,7 @@ constexpr inline ResourceUsage RWResUsage(ShaderStage stage)
return RWResUsage(uint32_t(stage));
}
DOCUMENT(R"(What kind of solid shading to use when rendering a mesh.
DOCUMENT(R"(What kind of visualisation to use when rendering a mesh.
.. data:: NoSolid
@@ -2913,22 +2913,27 @@ DOCUMENT(R"(What kind of solid shading to use when rendering a mesh.
The mesh should be rendered using the secondary element as color.
.. data:: Explode
The mesh should be rendered with vertices displaced and coloured by vertex ID.
.. data:: Meshlet
The mesh should be rendered colorising each meshlet differently.
)");
enum class SolidShade : uint32_t
enum class Visualisation : uint32_t
{
NoSolid = 0,
Solid,
Lit,
Secondary,
Explode,
Meshlet,
Count,
};
DECLARE_REFLECTION_ENUM(SolidShade);
DECLARE_REFLECTION_ENUM(Visualisation);
DOCUMENT(R"(The fill mode for polygons.