Overlay-Next: Document each overlay class

This commit is contained in:
Clément Foucault
2024-11-24 01:02:48 +01:00
parent 6e6711772f
commit 37bb1dedf5
33 changed files with 146 additions and 9 deletions

View File

@@ -22,6 +22,10 @@ enum eArmatureDrawMode {
ARM_DRAW_MODE_EDIT,
};
/**
* Displays armature objects.
* This includes Object, Edit and Pose mode.
*/
class Armatures : Overlay {
using EmptyInstanceBuf = ShapeInstanceBuf<ExtraInstanceData>;
using BoneInstanceBuf = ShapeInstanceBuf<BoneInstanceData>;

View File

@@ -28,6 +28,10 @@
namespace blender::draw::overlay {
/**
* Displays geometry node viewer output.
* Values are displayed as text on top of the active object.
*/
class AttributeTexts : Overlay {
public:
void begin_sync(Resources &res, const State &state) final

View File

@@ -18,6 +18,11 @@
#include "overlay_next_base.hh"
namespace blender::draw::overlay {
/**
* Displays geometry node viewer output.
* Values are displayed as vertex or face colors on top of the active object.
*/
class AttributeViewer : Overlay {
private:
PassMain ps_ = {"attribute_viewer_ps_"};

View File

@@ -14,6 +14,10 @@
namespace blender::draw::overlay {
/**
* Displays extra object axes.
* It is toggled by Object Panel > Viewport Display > Axes.
*/
class Axes : Overlay {
using EmptyInstanceBuf = ShapeInstanceBuf<ExtraInstanceData>;

View File

@@ -12,6 +12,10 @@
namespace blender::draw::overlay {
/**
* Draw background color .
* It is toggled by Object Panel > Viewport Display > Axes.
*/
class Background : Overlay {
private:
PassSimple bg_ps_ = {"Background"};

View File

@@ -18,6 +18,18 @@
#include "overlay_next_base.hh"
namespace blender::draw::overlay {
/**
* Draw object bounds and texture space.
*
* The object bound can be drawn because of:
* - display option (Object > Viewport Display > Bounds)
* - display as (Object > Viewport Display > Bounds)
* - rigid body (Physics > Rigid Body > Collision > Shape)
*
* Texture space can be modified by (Data > Texture Space)
* and displayed by (Object > Viewport Display > Texture Space)
*/
class Bounds : Overlay {
using BoundsInstanceBuf = ShapeInstanceBuf<ExtraInstanceData>;

View File

@@ -46,6 +46,12 @@ struct CameraInstanceData : public ExtraInstanceData {
: ExtraInstanceData(p_matrix, color, 1.0f){};
};
/**
* Camera object display (including stereoscopy).
* Also camera reconstruction bundles.
* Also camera reference images (background).
*/
/* TODO(fclem): Split into multiple overlay classes. */
class Cameras : Overlay {
using CameraInstanceBuf = ShapeInstanceBuf<ExtraInstanceData>;

View File

@@ -21,6 +21,9 @@
namespace blender::draw::overlay {
/**
* Curve object display (including legacy curves) for both object and edit modes.
*/
class Curves : Overlay {
private:
PassSimple edit_curves_ps_ = {"Curve Edit"};

View File

@@ -15,6 +15,10 @@
namespace blender::draw::overlay {
/**
* Text objects related overlays.
* Currently only display cursor and selection of text edit mode.
*/
class EditText : Overlay {
private:

View File

@@ -13,6 +13,9 @@
namespace blender::draw::overlay {
/**
* Empty object type drawing, including image empties.
*/
class Empties : Overlay {
friend class Cameras;
using EmptyInstanceBuf = ShapeInstanceBuf<ExtraInstanceData>;

View File

@@ -14,6 +14,10 @@
namespace blender::draw::overlay {
/**
* Draw a specific color for front and back-faces on surfaces.
* Can be toggle in (Viewport Overlays > Geometry > Face Orientation)
*/
class Facing : Overlay {
private:

View File

@@ -15,6 +15,11 @@
#include "overlay_next_base.hh"
namespace blender::draw::overlay {
/**
* Fades surfaces not currently in the active edit mode.
* Can be toggle in (Viewport Overlays > Geometry > Fade Inactive Geometry)
*/
class Fade : Overlay {
private:
PassMain ps_ = {"FadeGeometry"};

View File

@@ -17,6 +17,9 @@
namespace blender::draw::overlay {
/**
* Draw fluid simulation overlays (water, smoke).
*/
class Fluids : Overlay {
private:
const SelectionType selection_type_;

View File

@@ -18,6 +18,10 @@
namespace blender::draw::overlay {
/**
* Draw force fields.
* Controlled by (Physics > Force Field)
*/
class ForceFields : Overlay {
using ForceFieldsInstanceBuf = ShapeInstanceBuf<ExtraInstanceData>;

View File

@@ -23,6 +23,10 @@
namespace blender::draw::overlay {
/**
* Draw grease pencil overlays.
* Also contains grease pencil helper functions for other overlays.
*/
class GreasePencil : Overlay {
private:
PassSimple edit_grease_pencil_ps_ = {"GPencil Edit"};

View File

@@ -23,6 +23,9 @@
namespace blender::draw::overlay {
/**
* Draw 2D or 3D grid as well at global X, Y and Z axes.
*/
class Grid : Overlay {
private:
UniformBuffer<OVERLAY_GridData> data_;

View File

@@ -16,6 +16,9 @@
namespace blender::draw::overlay {
/**
* Draw lattice objects in object and edit mode.
*/
class Lattices : Overlay {
private:
PassMain ps_ = {"Lattice"};

View File

@@ -14,6 +14,9 @@
namespace blender::draw::overlay {
/**
* Draw light probe objects.
*/
class LightProbes : Overlay {
using LightProbeInstanceBuf = ShapeInstanceBuf<ExtraInstanceData>;
using GroundLineInstanceBuf = ShapeInstanceBuf<float4>;

View File

@@ -34,6 +34,9 @@ constexpr int overlay_edit_text = V3D_OVERLAY_EDIT_EDGE_LEN | V3D_OVERLAY_EDIT_F
V3D_OVERLAY_EDIT_FACE_ANG | V3D_OVERLAY_EDIT_EDGE_ANG |
V3D_OVERLAY_EDIT_INDICES;
/**
* Draw edit mesh overlays.
*/
class Meshes : Overlay {
private:
PassSimple edit_mesh_normals_ps_ = {"Normals"};
@@ -447,6 +450,9 @@ class Meshes : Overlay {
}
};
/**
* Draw edit uv overlays.
*/
class MeshUVs : Overlay {
private:
PassSimple analysis_ps_ = {"Mesh Analysis"};

View File

@@ -15,6 +15,9 @@
namespace blender::draw::overlay {
/**
* Draw meta-balls radius overlays.
*/
class Metaballs : Overlay {
using SphereOutlineInstanceBuf = ShapeInstanceBuf<BoneInstanceData>;

View File

@@ -14,6 +14,10 @@
namespace blender::draw::overlay {
/**
* Make newly active mesh flash for a brief period of time.
* This can be triggered using the "Transfer Mode" operator when in any edit mode.
*/
class ModeTransfer : Overlay {
private:
PassSimple ps_ = {"ModeTransfer"};

View File

@@ -19,6 +19,10 @@
namespace blender::draw::overlay {
/**
* Display object and armature motion path.
* Motion paths can be found in (Object > Motion Paths) or (Data > Motion Paths) for armatures.
*/
class MotionPath : Overlay {
private:

View File

@@ -14,6 +14,10 @@
namespace blender::draw::overlay {
/**
* Display object names next to their origin.
* The option can be found under (Object > Viewport Display > Show > Name).
*/
class Names : Overlay {
public:
void begin_sync(Resources &res, const State &state) final

View File

@@ -11,6 +11,11 @@
#include "overlay_next_base.hh"
namespace blender::draw::overlay {
/**
* Display object origins as dots.
* The option can be found under (Viewport Overlays > Objects > Origins).
*/
class Origins : Overlay {
private:
StorageVectorBuffer<VertexData> point_buf_;

View File

@@ -15,6 +15,10 @@
namespace blender::draw::overlay {
/**
* Display selected object outline.
* The option can be found under (Viewport Overlays > Objects > Outline Selected).
*/
class Outline : Overlay {
private:
/* Simple render pass that renders an object ID pass. */

View File

@@ -19,6 +19,10 @@
namespace blender::draw::overlay {
/**
* Display paint modes overlays.
* Covers weight paint, vertex paint and texture paint.
*/
class Paints : Overlay {
private:

View File

@@ -18,6 +18,10 @@
namespace blender::draw::overlay {
/**
* Display particle system overlays.
* Covers particle edit and the legacy hair system.
*/
class Particles : Overlay {
private:
PassMain particle_ps_ = {"particle_ps_"};

View File

@@ -4,9 +4,6 @@
/** \file
* \ingroup overlay
*
* A depth pass that write surface depth when it is needed.
* It is also used for selecting non overlay-only objects.
*/
#pragma once
@@ -23,6 +20,10 @@
namespace blender::draw::overlay {
/**
* A depth pass that write surface depth when it is needed.
* It is also used for selecting non overlay-only objects.
*/
class Prepass : Overlay {
private:
PassMain ps_ = {"prepass"};

View File

@@ -19,6 +19,10 @@
namespace blender::draw::overlay {
/**
* Display object relations as dashed lines.
* Covers parenting relationships and constraints.
*/
class Relations : Overlay {
private:

View File

@@ -24,6 +24,11 @@
namespace blender::draw::overlay {
/**
* Display sculpt modes overlays.
* Covers face sets and mask for meshes.
* Draw curve cages (curve guides) for curve sculpting.
*/
class Sculpts : Overlay {
private:

View File

@@ -14,6 +14,9 @@
namespace blender::draw::overlay {
/**
* Display speaker objects.
*/
class Speakers : Overlay {
using SpeakerInstanceBuf = ShapeInstanceBuf<ExtraInstanceData>;

View File

@@ -18,6 +18,15 @@
namespace blender::draw::overlay {
/**
* Draw wireframe of objects.
*
* The object wireframe can be drawn because of:
* - display option (Object > Viewport Display > Wireframe)
* - overlay option (Viewport Overlays > Geometry > Wireframe)
* - display as (Object > Viewport Display > Wire)
* - wireframe shading mode
*/
class Wireframe : Overlay {
private:
PassMain wireframe_ps_ = {"Wireframe"};

View File

@@ -4,12 +4,6 @@
/** \file
* \ingroup draw_engine
*
* Overlay X-ray Fade:
*
* Full-screen pass that dim overlays that are behind scene geometry.
* This allows to have a nice transition between opaque (or 100% X-ray) and wire-frame only mode.
* This is only available if X-ray mode is enabled or in wire-frame mode.
*/
#pragma once
@@ -18,6 +12,11 @@
namespace blender::draw::overlay {
/**
* Fade overlays that are behind scene geometry.
* This allows to have a nice transition between opaque (or 100% X-ray) and wire-frame only mode.
* This is only available if X-ray mode is enabled or in wire-frame mode.
*/
class XrayFade : Overlay {
private:
PassSimple xray_fade_ps_ = {"XrayFade"};