From 087dd92f257e364f78db538b2a930f4d040e6040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 1 Feb 2025 13:55:36 +0100 Subject: [PATCH] Shaders: doc++ --- src/Magnum/Shaders/Line.h | 7 ++++--- src/Magnum/Shaders/Line.vert | 18 +++++++++--------- src/Magnum/Shaders/LineGL.h | 3 ++- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/Magnum/Shaders/Line.h b/src/Magnum/Shaders/Line.h index c380aa19b..a79a8d265 100644 --- a/src/Magnum/Shaders/Line.h +++ b/src/Magnum/Shaders/Line.h @@ -102,10 +102,10 @@ enum class LineJoinStyle: UnsignedByte { * @htmlinclude line-join-miter.svg * * In this style, the points `A`, `B` and `C` collapse to a zero-area - * triangle. If the miter length `l` would be larger than the limit set in + * triangle. If the miter length `l` would be larger than the limit set via * @ref LineGL::setMiterLengthLimit() / * @ref LineMaterialUniform::setMiterLengthLimit() or the angle between the - * two segments `α` would be less than the limit set in + * two segments `α` would be less than the limit set via * @ref LineGL::setMiterAngleLimit() / * @ref LineMaterialUniform::setMiterAngleLimit(), it switches to * @ref LineJoinStyle::Bevel instead. @@ -467,7 +467,8 @@ struct MAGNUM_SHADERS_EXPORT LineMaterialUniform { * * For convenience it's recommended to use the @ref setMiterLengthLimit() * and @ref setMiterAngleLimit() helpers instead of setting this value - * directly. + * directly. Default value is @cpp 0.875f @ce, which corresponds to a + * length of @cpp 4.0f @ce and angle of approximately @cpp 28.955_degf @ce. * @see @ref LineGL::setMiterLengthLimit(), * @ref LineGL::setMiterAngleLimit() */ diff --git a/src/Magnum/Shaders/Line.vert b/src/Magnum/Shaders/Line.vert index 108254d0d..5353ce47f 100644 --- a/src/Magnum/Shaders/Line.vert +++ b/src/Magnum/Shaders/Line.vert @@ -375,14 +375,14 @@ void main() { /* Decide about the line direction vector `d` and edge direction vector `e` from the `pointMarkerComponent` input. Quad corners 0 and 1 come from - segment endpoint A, are marked with the POINT_MARKER_BEGIN_MASK bit and - so their line direction is taken from `nextPosition`, quad corners 2 and - 3 come from B and are *not* marked with POINT_MARKER_BEGIN_MASK and so - their line direction is taken from `previousPosition`, with the - direction being always from point A to point B. The edge direction is - then perpendicular to the line direction, with points 0 and 2 marked - with POINT_MARKER_UP_MASK using it directly, while points 1 and 3 - don't have POINT_MARKER_UP_MASK and have to negate it: + segment endpoint A, are marked with the ANNOTATION_BEGIN_MASK bit and so + their line direction is taken from `nextPosition`, quad corners 2 and 3 + come from B and are *not* marked with ANNOTATION_BEGIN_MASK and so their + line direction is taken from `previousPosition`, with the direction + being always from point A to point B. The edge direction is then + perpendicular to the line direction, with points 0 and 2 marked with + ANNOTATION_UP_MASK using it directly, while points 1 and 3 don't have + ANNOTATION_UP_MASK and have to negate it: ^ ^ e e @@ -396,7 +396,7 @@ void main() { e e v v - The POINT_MARKER_CAP_MASK is then used below. */ + The ANNOTATION_CAP_MASK is then used below. */ highp const vec2 lineDirection = bool(annotation & ANNOTATION_BEGIN_MASK) ? transformedNextPosition - transformedPosition : transformedPosition - transformedPreviousPosition; diff --git a/src/Magnum/Shaders/LineGL.h b/src/Magnum/Shaders/LineGL.h index 895ac0055..2e8bab90d 100644 --- a/src/Magnum/Shaders/LineGL.h +++ b/src/Magnum/Shaders/LineGL.h @@ -1026,7 +1026,8 @@ template class MAGNUM_SHADERS_EXPORT LineGL: * * Unlike for example the SVG specification that uses * @ref LineCapStyle::Butt by default, the default value is - * @ref LineCapStyle::Square, in order to make zero-length lines visible. + * @ref LineCapStyle::Square, in order to make zero-length lines + * visible. * @see @ref LineGL::capStyle() */ Configuration& setCapStyle(LineCapStyle style) {