Skip to content

Commit

Permalink
Remove angle from linear gradient shader parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
mikke89 committed Aug 20, 2024
1 parent 7752d5d commit 3854487
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/cpp_manual/interfaces/render.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,14 +381,14 @@ The provided `name` refers to a particular shader effect type, each of which has
| Shader | Parameters |
| --- | --- |
| `linear-gradient` | `bool repeating`{:.value}: True if the gradient is repeating.<br>`Rml::Vector2f p0`{:.value}: Starting point.<br>`Rml::Vector2f p1`{:.value}: Ending point.<br>`float angle`{:.value}: The angle of the gradient line (rad).<br>`float length`{:.value}: The length of the gradient line (px).<br>`Rml::ColorStopList color_stop_list`{:.value}: Color stop list. |
| `linear-gradient` | `bool repeating`{:.value}: True if the gradient is repeating.<br>`Rml::Vector2f p0`{:.value}: Starting point.<br>`Rml::Vector2f p1`{:.value}: Ending point.<br>`float length`{:.value}: The length of the gradient line (px).<br>`Rml::ColorStopList color_stop_list`{:.value}: Color stop list. |
| `radial-gradient` | `bool repeating`{:.value}: True if the gradient is repeating.<br>`Rml::Vector2f center`{:.value}: Center point.<br>`Rml::Vector2f radius`{:.value}: Two-dimensional radius.<br>`Rml::ColorStopList color_stop_list`{:.value}: Color stop list. |
| `conic-gradient` | `bool repeating`{:.value}: True if the gradient is repeating.<br>`Rml::Vector2f center`{:.value}: Center point.<br>`float angle`{:.value}: Rotation of the gradient (rad).<br>`Rml::ColorStopList color_stop_list`{:.value}: Color stop list. |
| `shader` | `Rml::String value`{:.value}: A user-specified value.<br>`Rml::Vector2f dimensions`{:.value}: Dimensions of the paint area. |
Note that, the application itself, or plugins, can provide other shader types using [custom decorators](../decorators.html#custom-decorators) with their own set of parameters. The above table lists the ones that are built-in to RmlUi.
The parameters for the various `[...]-gradient` shaders have already been processed such that they are in a form suitable for rendering. In particular, the color stop lists have already been resolved, such that each color stop is given as a position with a *number* unit, where zero represents the beginning of the gradient and unity represents the end of the gradient. Specifically, the `Rml::ColorStopList` is a vector of `ColorStop` structs, having `color` and `position` members. The latter is specified as a `NumericValue` type whose unit is always a `NUMBER`{:.value}. Please see the CSS specifications for how to interpret these parameters: [`linear-gradient`{:.prop}](https://www.w3.org/TR/css-images-3/#linear-gradients), [`radial-gradient`{:.prop}](https://www.w3.org/TR/css-images-3/#radial-gradients), and [`conic-gradient`{:.prop}](https://www.w3.org/TR/css-images-4/#conic-gradients). Also, feel free to take a look at the built-in [OpenGL3 renderer](https://github.com/mikke89/RmlUi/blob/master/Backends/RmlUi_Renderer_GL3.cpp) in RmlUi, and how they are implemented there
The parameters for the various `[...]-gradient` shaders have already been processed such that they are in a form suitable for rendering. In particular, the color stop lists have already been resolved, such that each color stop is given as a position with a *number* unit, where zero represents the beginning of the gradient line and unity represents the end of the gradient line. Specifically, the `Rml::ColorStopList` is a vector of `ColorStop` structs, having `color` and `position` members. The latter is specified as a `NumericValue` type whose unit is always a `NUMBER`{:.value}. Please see the CSS specifications for how to interpret these parameters: [`linear-gradient`{:.prop}](https://www.w3.org/TR/css-images-3/#linear-gradients), [`radial-gradient`{:.prop}](https://www.w3.org/TR/css-images-3/#radial-gradients), and [`conic-gradient`{:.prop}](https://www.w3.org/TR/css-images-4/#conic-gradients). Also, feel free to take a look at the built-in [OpenGL3 renderer](https://github.com/mikke89/RmlUi/blob/master/Backends/RmlUi_Renderer_GL3.cpp) in RmlUi, and how they are implemented there
The `shader` shader is a generic shader which can be given a meaning by the application. The `shader(<string>)`{:.value} decorator directly hands over the provided string as a parameter, allowing the application to render the geometry accordingly. The dimensions of the paint area is provided as a parameter, in addition, the texture coordinates of its accompanying geometry is normalized `[0, 1]` to the paint area of the decorator.
Expand Down

0 comments on commit 3854487

Please # to comment.