In their shadertoys, programmers have to handle everything, and redo everything from scratch every time. For repetitive basic utilitary features like GUI or font display it can thus be very boring, so that many just don’t embed any GUI and users have to tweak defines.
Fortunately, various community members have publish useful base elements that you can reuse !
( PS: coders, please do add the tag “gui” to your utilitary shaders: for now it gathers very little ! )
Bags of features:
- Super Shader GUI 98 : Windows98 inside !
Windows (move, iconify, scroll), sliders, checkbox, color picker.
- Physically Based Shading :
(open) menus & submenus, buttons, sliders, boxes selector (here, index color).
- UI easy to integrate :
Display label+value, slider (included in label), color picker.
- Sculpt tool , Interactive pottery :
Labels, sliders, checkbox, boxes selectors, keys.
- iResolution, iMouse, iDate, etc :
Display text and numbers, keyboard, draw lines, blend, hashs, date …
- Distance field outline mask :
Sliders, numbers, point picker…
- digits/sliders/kbd widgets – 2 : Sliders, checkbox, keyboard, digit-display
Isolated features:
Sliders & widgets :
- all (tag) : https://www.shadertoy.com/results?query=widgets
- 2D Canvas with UI : Sliders with value.
- Shader UI Toolkit : Sliders and checkbox.
- digits/sliders/kbd widgets – 2 : Sliders, checkbox.
- Window manager : Basic windows (move-resize).
color picker :
- minidemo #2: Continuous UI : color picker.
Mouse management:
- pick & pan objects: 3 methods : pick, select region, select by framing, using the new (nov,2020) mouse events.
- Pan zoom control : Mouse pan (with inertia).
- Reusable drag and drop : Drag & drop.
Keyboard management:
- iResolution, iMouse, iDate, etc : (includes special keycodes reminder )
- Key group toggles (utils) : key group toggles (for exclusive choice selector)
- 13 knot rope / arithmetic rope : memorizing independent states 0-39 associated to key 0-9 + shift, ctrl or alt.
Text & int/float numbers display:
- all (tag) : https://www.shadertoy.com/results?query=fonts
- more (including unrelated) : https://www.shadertoy.com/results?query=font
- iResolution, iMouse, iDate, etc : Text (immediate & optimized deferred mode), int4, float4.4
Specials:
- Message: sound in #2 : Sound shaders with no image: message it in the icon or people won’t know !
- More message types.
- Material Menu : Live previews menu.
- Editable grid of values : ( for crosswords, Sudoku, Suguru …)
- Compatibility test / enforce : Check compatibility issues or enforce compatibility.
Graphics:
- iResolution, iMouse, iDate, etc : Draw antialiased lines (round or square), blend, disk, circle.
- 2D Vector Field Flow : Draw arrows in fields.
- Photoshop Blends Branchless : All blending modes.
- Mode 7 WASD Walkaround : basic ASWD move on 3D terrain.
( No longer compiling: replace vec2 BUFF_RES with #define ).
Remark: coders, do account for non-Qwerty keyboards: replace or add arrows ! (codes 37-40)
- Raymarching Sample Code : Basic ray-tracing sample code ( camera rotations, etc).
- Missing ! : Some easy-to-reuse code for 2D and/or 3D walk-through.
–> Which shader would you advise ?