Skip to content

Examples

GradientMesh examples are grouped by rendering feature.

The visual assets are kept in the original GradientMesh repository. This documentation references the same source paths through GitHub raw URLs, so the images do not need to be duplicated in this GitHub Pages repository.

Visual examples

Each screenshot is generated from a dedicated Gideros example script, so the visual documentation stays reproducible and easier to maintain.

Gradient overlay over landscape texture

This example applies procedural gradient colors over a landscape texture.

It is useful for:

  • hero images;
  • game menus;
  • splash screens;
  • atmospheric backgrounds;
  • quick mood exploration.
Landscape image with procedural gradient mesh overlay

Generated from:

lua
require "examples/gradient_overlay"

Source image path in the GradientMesh repository:

text
docs/images/gradient-overlay-landscape.png

The gradient_overlay example originally supported loading palette data from remote gradient collections. Since some older palette sources may no longer be available, the example is documented as a procedural mesh overlay and can be adapted to use local or fallback palettes.

Texture masking over rotated polygon meshes

GradientMesh can map an image texture onto polygon-based mesh geometry.

This makes it possible to clip, rotate, tint, and antialias images using mesh vertices instead of pre-rendered bitmap masks.

Texture mask over square and rotated polygon mesh

Generated from:

lua
require "examples/texture_mask_rotated_mesh"

Source image path:

text
docs/images/texture-mask-rotated-mesh.png

Hexagon portrait texture mask

This example maps a portrait texture onto regular hexagon meshes.

It shows how the same portrait can be clipped through polygon geometry while preserving the image and adding a subtle vertex-color tint.

Portrait texture masked through regular hexagon meshes

Generated from:

lua
require "examples/hexagon_portrait_texture_mask"

Source image path:

text
docs/images/hexagon-portrait-texture-mask.png

Radial shapes, holes, and deformation

Radial gradients are generated by creating rings of vertices around a center point.

By changing the number of edges, scale factors, and inner radius, the same algorithm can produce:

  • circles;
  • ellipses;
  • polygons;
  • donuts;
  • deformed radial shapes.
Radial gradient shapes with hole and deformation

Generated from:

lua
require "examples/radial_shapes_hole_deform"

Source image path:

text
docs/images/radial-shapes-hole-deform.png

Splash texture masks

Splash examples combine texture masks with radial color interpolation.

This is useful for expressive backgrounds, particle-like effects, menu accents, and creative coding experiments.

Radial gradient splash texture masks

Generated from:

lua
require "examples/radial_gradient_splash_masks"

Source image path:

text
docs/images/radial-gradient-splash-masks.png

Example map

ExampleFocusOutput
gradient_overlay.luaGradient overlay over texturedocs/images/gradient-overlay-landscape.png
texture_mask_rotated_mesh.luaSquare and rotated-square texture maskingdocs/images/texture-mask-rotated-mesh.png
hexagon_portrait_texture_mask.luaPortrait texture masking over hexagonal meshesdocs/images/hexagon-portrait-texture-mask.png
radial_shapes_hole_deform.luaRadial shapes, holes, and deformationdocs/images/radial-shapes-hole-deform.png
radial_gradient_splash_masks.luaSplash texture masks with radial gradientsdocs/images/radial-gradient-splash-masks.png

Built with VitePress and deployed with GitHub Pages.