Constructors
GridShader
#public GridShader(Transform2D transform, ColourShader background, Color lines, Color xAxis, Color yAxis, int frequency)
Create a new grid shader.
Parameters:
| transform (Transform2D) | Transform of unit grid. |
| background (ColourShader) | Background colour. |
| lines (Color) | Line colour. |
| xAxis (Color) | X axis colour. |
| yAxis (Color) | Y axis colour. |
| frequency (int) | Thick line frequency. |
GridShader
#Create a new grid shader.
Parameters:
| transform (Transform2D) | Transform of unit grid. |
| background (ColourShader) | Background colour. |
| lines (Color) | Line colour. |
| frequency (int) | Thick line frequency. |
Methods
ColourAt
#Evaluate this shader at a specific ray location.
Parameters:
| ray (Ray) | Coincident ray. |
| stack (IObjectStack) | Object stack context. |
Overrides: ColourShader.ColourAt
Dilate
Apply a dilation (or scaling) transformation to this shader.
Fade
Add a transparency layer to this shader.
Parameters:
| transparency (ValueShader) | Transparency layer. |
| combine (bool) | If true, overlay transparency is combined with existing transparency. If false, overlay transparency overrules the existing transparency. |
Returns: Modified shader.
Parameters:
| transparency (ValueShader) | Transparency layer. |
Returns: Modified shader.
ResolveColour
Utility function for resolving a colour with the background.
Parameters:
| colour (Color) | Colour to resolve. |
| ray (Ray) | Ray associated with colour location. |
| stack (IObjectStack) | Object stack context. |
Returns: Resolved colour.
Parameters:
| angle (Angle) | Rotation angle (counter-clockwise). |
Returns: Rotated shader.
Transform
Apply a custom transformation to this shader.
Parameters:
| transform (Transform2D) | Transformation. |
Returns: Transformed shader.
Translate
Apply a translation transformation to this shader.