Repository navigation
Conversation
aalex
left a comment
There was a problem hiding this comment.
Why is there a lot of commented code in the *.fs shader files?
|
@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 :
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. |
|
The cut labels are shortened (8c5f7bc): From Right and From Bottom in Mirror, Slice Angle in Kaleidoscope. Projects keep the names of the settings ( |












Summary
IMG_NORM_PIXEL_SEAMLESS, MapMap's own, described indocs/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.CREDITand inresources/shaders/CREDITS.md.Slice: « Série d'effets de base », second part. #235
Demo
Tests
Every commit built and passed the unit tests on Ubuntu (Qt 6,
QT_QPA_PLATFORM=offscreen), after a rebase ondev: 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.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.