Is your feature request related to a problem? Please describe.
As TOPLAP says:
Live coding is where people write code while it runs to make live music/visuals/dance/art/etc.
Currently doing this in FragM isn't so easy due to a small number of small issues.
Describe the solution you'd like
- Double-buffering when rebuilding shaders, so that the last compiled shader can be used to continue rendering until there is a new successfully-built shader to use.
- Animation not to stop playback when compile fails.
- Animation time not to reset to 0 when compile fails.
Then there are some relatively simple additions that would further improve things:
- Allow main display widget to be popped out (so it can be made fullscreen on another desktop/projector, or easily input to OBS or other streaming/recording software that works based on system windows, while still being able to edit code, unlike full screen ESC with all subwindows disabled)
- A
uniform int CompileFailures; and uniform float TimeSinceCompiled; that counts the number of times shader compilation was attempted, and wallclock time, since this shader was compiled (eg for adding visual feedback for viewers if the log window is not shown, eg red mist descending...) Would need to be opt-in via preferences to avoid clashes with any existing frags out there that might already use these names (unlikely, but who knows).
Then some further advanced/niche things while I'm brainstorming just so I don't forget:
- Display code editor with (semi-)transparent background on top of the display window (might be possible with some Qt magic?) with a keyboard toggle to hide/show it (maybe by adjusting transparency)
- Support OSC (Open Sound Control) to allow setting uniform values (and maybe control other FragM things) by external software in real time (for example this could allow Supercollider or Pure-data or whatever else to control FragM visuals in sync with their music)
- Do the shader recompile in another thread with a shared OpenGL context, so animation rendering continues with the previous shader until the new one is ready (with my current shader library, the pause of a few 100ms is very unpleasant); not sure what to do if there are more edits before the background thread is ready
Describe alternatives you've considered
- Writing my own live coding tool(s) from scratch, but that's way too much work to get something as solid as FragM.
- Finding some exisiting tool better suited to live coding of GLSL and port all my shaders to it (still lots of work, awkward porting any fixes between two code bases as I'll still want to use FragM, a total nightmare with my shader library if multiple includes are not supported by the other tools)
Additional context
I was thinking about trying to use FragM live for a gig this Sunday, but the animation stop-and-reset-time-on-error is a show stopper (literally)... so I made other plans for now.
I'll try to fix 1,2,3 myself, 4 might be difficult due to not knowing much Qt, the rest are much lower priority,,,,
Is your feature request related to a problem? Please describe.
As TOPLAP says:
Currently doing this in FragM isn't so easy due to a small number of small issues.
Describe the solution you'd like
Then there are some relatively simple additions that would further improve things:
uniform int CompileFailures;anduniform float TimeSinceCompiled;that counts the number of times shader compilation was attempted, and wallclock time, since this shader was compiled (eg for adding visual feedback for viewers if the log window is not shown, eg red mist descending...) Would need to be opt-in via preferences to avoid clashes with any existing frags out there that might already use these names (unlikely, but who knows).Then some further advanced/niche things while I'm brainstorming just so I don't forget:
Describe alternatives you've considered
Additional context
I was thinking about trying to use FragM live for a gig this Sunday, but the animation stop-and-reset-time-on-error is a show stopper (literally)... so I made other plans for now.
I'll try to fix 1,2,3 myself, 4 might be difficult due to not knowing much Qt, the rest are much lower priority,,,,