Skip to content

Add six geometry and style effects, and reads without seams - #711

Open
sofian wants to merge 10 commits into
devfrom
feat-235-geometry-effects
Open

sofian wants to merge 10 commits into
devfrom
feat-235-geometry-effects

Conversation

@sofian

@sofian sofian commented Dec 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Six new effects, for a source or a layer, each with its Mix:
    • Kaleidoscope: 2 to 32 segments around a centre, with the rotation of the slice taken, of the result, and a zoom.
    • Mirror: four switches, Horizontal, From the Right, Vertical, From the Bottom, around a centre and at an angle.
    • Transform: position, scale and rotation; tiling in columns and rows, mirrored tiles, offset rows, skew; a pivot, a stretch in width and height, and what is seen outside the image (nothing, the edge, repeated, mirrored).
    • Pixelate: a number of columns of square blocks; round or diamond blocks, their width, a gap and its colour, which may be transparent.
    • RGB Shift: red, green and blue moved apart along an angle, or away from the centre as through a lens; the share of each channel.
    • Edges: the outlines of the image, their strength, thickness and threshold; lines of one colour or of the image's own, on black, the image or nothing.
  • The menu Add Effect gains the families Geometry and Stylize.
  • On a layer, an effect only reads the part of the image the layer shows: its part acts as a whole image.
  • Effects can read without seams: IMG_NORM_PIXEL_SEAMLESS, MapMap's own, described in docs/extensions/isf.md. Where the tiles of Transform or the blocks of Pixelate met, the graphics card read a smaller copy of the image and drew a grey line. This read picks the copy from the position before tiling, and anisotropic filtering is turned off while such an effect draws.
  • The names of colour models are written in capitals in the names of shaders: "RGB Shift", "HSV To RGB".
  • The shaders start from the ISF collection of VIDVOX (MIT License): Kaleidoscope, Mirror, Zoom, Rotate, Quad Tile, Pixellate, Chromatic Aberration and Edges, credited in each CREDIT and in resources/shaders/CREDITS.md.

Slice: « Série d'effets de base », second part. #235

Demo

  1. Open a project with a video on three shapes. Right-click a layer, Add Effect, Geometry, Kaleidoscope: only that shape changes. Move the number of segments.
  2. On a second layer, add Transform, unfold Tiling, set three columns and two rows, and turn on Mirror Tiles: the pattern repeats without seams.
  3. On the source, add Pixelate: the three shapes turn into blocks. Unfold Options and pick round blocks with a gap.
  4. Replace it with Edges, then RGB Shift, and lower the Mix: the effect fades out.

Tests

  • Every commit built and passed the unit tests on Ubuntu (Qt 6, QT_QPA_PLATFORM=offscreen), after a rebase on dev: 758 tests at the end.

  • New tests: each effect drawn on a source and on a layer, compared pixel by pixel, and unchanged at Mix 0 %; a tiled image read without seams on a mipmapped source; the families of the menu; the names with colour models.

  • The cost of each effect, measured on Ubuntu with --frame-stats-sync: a 1080p video on three shapes, at 30 frames per second, 3 runs of 16 seconds per case, the drawing of the input and output editors added. Without an effect: 5.10 ms. No frame was dropped.

    Effect On the source On each layer
    Kaleidoscope +1.8 ms +0.2 ms
    Mirror +1.6 ms +0.6 ms
    Transform, 3 × 2 tiles +2.1 ms +0.9 ms
    Pixelate +2.5 ms +0.5 ms
    RGB Shift (3 reads) +2.1 ms +0.6 ms
    Edges (8 reads) +3.5 ms +0.6 ms
    Color Adjustment, for comparison +1.0 ms +0.3 ms

    From one run to the next, the figures move by about 0.6 ms. Color Adjustment was measured in another session, whose case without an effect took 5.56 ms. On a source, most of the cost is the drawing of the whole 1080p image that an effect on a source makes each frame. Pixelate costs about 1 ms more than Color Adjustment there.

  • Not run: macOS and Windows (GitHub runs them), the measure on macOS and on the Raspberry Pi, which decides whether Edges stays.

@sofian sofian added this to the 1.0 milestone Dec 5, 2026
@sofian sofian self-assigned this Dec 5, 2026
@sofian
sofian requested a review from aalex December 5, 2026 13:18
@sofian

sofian commented Dec 5, 2026

Copy link
Copy Markdown
Member Author

Screenshots of the branch, on Ubuntu (MapMap on a hidden display, with settings of its own).

The menu of a layer, Replace Effect: the families Geometry and Stylize.

Replace Effect, Geometry: Kaleidoscope, Mirror, Transform Replace Effect, Stylize: Edges, Pixelate, RGB Shift

A video on three layers, with Kaleidoscope, Mirror (horizontal and vertical) and Transform (3 × 2 tiles, mirrored tiles):

Kaleidoscope, Mirror and Transform on three layers

The pages of Kaleidoscope, Mirror and Transform, their groups open:

Kaleidoscope Mirror Transform

The same video with Pixelate (round blocks, 20 % gap), RGB Shift (3 %) and Edges:

Pixelate, RGB Shift and Edges on three layers

The pages of Pixelate, RGB Shift and Edges, their groups open:

Pixelate RGB Shift Edges

At the default width of the panel, two labels are cut: "From the Bot…" (From the Bottom, in Mirror) and "Sample Rotat…" (Sample Rotation, in Kaleidoscope).

@aalex aalex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a lot of commented code in the *.fs shader files?

Comment thread resources/shaders/transform.fs Resolved
@sofian

sofian commented Dec 5, 2026

Copy link
Copy Markdown
Member Author

@aalex Ce n'est pas du code mis en commentaire : c'est l'en-tête du format ISF (Interactive Shader Format, de Vidvox). Un fichier ISF commence par un bloc JSON entre /{ et }/, que l'éditeur grise parce qu'il est entre /* */. Il décrit chaque paramètre de l'effet : son nom, son type, ses bornes, sa valeur par défaut, son libellé et sa description.

MapMap lit cet en-tête pour créer les réglages de l'effet. Chacun devient une propriété comme les autres :

  • il a sa page dans l'inspecteur, avec la description en info-bulle ;
  • il est enregistré dans le projet ;
  • il a son adresse OSC et MCP, et on peut le lier à une touche ou à un bouton MIDI.

Rien n'est codé à la main pour chaque effet : ajouter un fichier .fs suffit.

MapMap reprend aussi les ajouts de MadMapper au format, avec la même syntaxe : les groupes ("LABEL": "Groupe/Nom") et les générateurs. Il en ajoute quelques-uns à lui : les groupes repliés au départ (GROUPS), l'unité et les bornes du curseur (UNIT, SLIDER_MAX, STEP), et une lecture sans couture pour les pavages. Les autres logiciels qui lisent l'ISF ignorent ces clés, donc nos effets restent utilisables ailleurs (VDMX, MadMapper, etc.), et les fichiers ISF existants s'ouvrent dans MapMap.

Le reste des commentaires (//) documente le code, comme le demande AGENTS.md. Le calcul lui-même est court : environ 40 lignes pour Transform.

La référence, qui dit ce que MapMap lit de l'ISF et ce qu'il y ajoute : docs/extensions/isf.md.
https://github.com/mapmapteam/mapmap/blob/dev/docs/extensions/isf.md
La spécification ISF elle-même : https://docs.isf.video

@sofian

sofian commented Dec 5, 2026

Copy link
Copy Markdown
Member Author

The cut labels are shortened (8c5f7bc): From Right and From Bottom in Mirror, Slice Angle in Kaleidoscope. Projects keep the names of the settings (from_right, from_bottom, sample_rotation), which do not change.

Kaleidoscope, Options: Slice Angle Mirror: From Right, From Bottom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants