Browse Source

Shaders: doc++

pull/651/merge
Vladimír Vondruš 1 year ago
parent
commit
087dd92f25
  1. 7
      src/Magnum/Shaders/Line.h
  2. 18
      src/Magnum/Shaders/Line.vert
  3. 3
      src/Magnum/Shaders/LineGL.h

7
src/Magnum/Shaders/Line.h

@ -102,10 +102,10 @@ enum class LineJoinStyle: UnsignedByte {
* @htmlinclude line-join-miter.svg * @htmlinclude line-join-miter.svg
* *
* In this style, the points `A`, `B` and `C` collapse to a zero-area * 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 LineGL::setMiterLengthLimit() /
* @ref LineMaterialUniform::setMiterLengthLimit() or the angle between the * @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 LineGL::setMiterAngleLimit() /
* @ref LineMaterialUniform::setMiterAngleLimit(), it switches to * @ref LineMaterialUniform::setMiterAngleLimit(), it switches to
* @ref LineJoinStyle::Bevel instead. * @ref LineJoinStyle::Bevel instead.
@ -467,7 +467,8 @@ struct MAGNUM_SHADERS_EXPORT LineMaterialUniform {
* *
* For convenience it's recommended to use the @ref setMiterLengthLimit() * For convenience it's recommended to use the @ref setMiterLengthLimit()
* and @ref setMiterAngleLimit() helpers instead of setting this value * 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(), * @see @ref LineGL::setMiterLengthLimit(),
* @ref LineGL::setMiterAngleLimit() * @ref LineGL::setMiterAngleLimit()
*/ */

18
src/Magnum/Shaders/Line.vert

@ -375,14 +375,14 @@ void main() {
/* Decide about the line direction vector `d` and edge direction vector `e` /* Decide about the line direction vector `d` and edge direction vector `e`
from the `pointMarkerComponent` input. Quad corners 0 and 1 come from from the `pointMarkerComponent` input. Quad corners 0 and 1 come from
segment endpoint A, are marked with the POINT_MARKER_BEGIN_MASK bit and segment endpoint A, are marked with the ANNOTATION_BEGIN_MASK bit and so
so their line direction is taken from `nextPosition`, quad corners 2 and their line direction is taken from `nextPosition`, quad corners 2 and 3
3 come from B and are *not* marked with POINT_MARKER_BEGIN_MASK and so come from B and are *not* marked with ANNOTATION_BEGIN_MASK and so their
their line direction is taken from `previousPosition`, with the line direction is taken from `previousPosition`, with the direction
direction being always from point A to point B. The edge direction is being always from point A to point B. The edge direction is then
then perpendicular to the line direction, with points 0 and 2 marked perpendicular to the line direction, with points 0 and 2 marked with
with POINT_MARKER_UP_MASK using it directly, while points 1 and 3 ANNOTATION_UP_MASK using it directly, while points 1 and 3 don't have
don't have POINT_MARKER_UP_MASK and have to negate it: ANNOTATION_UP_MASK and have to negate it:
^ ^ ^ ^
e e e e
@ -396,7 +396,7 @@ void main() {
e e e e
v v 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) ? highp const vec2 lineDirection = bool(annotation & ANNOTATION_BEGIN_MASK) ?
transformedNextPosition - transformedPosition : transformedNextPosition - transformedPosition :
transformedPosition - transformedPreviousPosition; transformedPosition - transformedPreviousPosition;

3
src/Magnum/Shaders/LineGL.h

@ -1026,7 +1026,8 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT LineGL<dimensions>:
* *
* Unlike for example the SVG specification that uses * Unlike for example the SVG specification that uses
* @ref LineCapStyle::Butt by default, the default value is * @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() * @see @ref LineGL::capStyle()
*/ */
Configuration& setCapStyle(LineCapStyle style) { Configuration& setCapStyle(LineCapStyle style) {

Loading…
Cancel
Save