Skip to content

render to video/gif #52

@Vipitis

Description

@Vipitis

part of #8

So this is a long time goal and I want to explore some ideas and options.
The most naive implementation is to just request a bunch of frames using the current offscreen mechanism. I sorta got that working for a different project a while ago: Vipitis/shader_tracker@f90fd5c
Additionally I saw the approach here https://github.com/richinsley/shadertoy-arcana/blob/main/go/modules/shadertoyinterop.py where there is shared memory (on the CPU) serves as something like a frame server. I wonder if something similar could be done with an offscreen canvas and somehow calling ffmpeg on that? perhaps you can even keep it all in GPU memory when using hardware encoding?
It should also be much faster than real time (or much slower if you are going for extreme resolutions, framerates or complex shaders).

As a side thought: user input such a mouse and keyboard (once that is added) could be recorded/planned replayed. For the mouse those are just via uniform - but for the keyboard texture we might need to emulate canvas events (if that is how we implement it).

perhaps has a design goal it should be also be user friendly on the CLI for example:

Image.frag > wgpu-shadertoy --resolution 3840 2160 > movie.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions