3Dickulus / FragM

Derived from https://github.com/Syntopia/Fragmentarium/
GNU General Public License v3.0
349 stars 30 forks source link

array textures (for animated GIF, image sequences, or short videos) #117

Closed claudeha closed 4 years ago

claudeha commented 4 years ago

Is your feature request related to a problem? Please describe.

I saw an example on the forums with Nyan Cat animated orbit trap, using an image with 6 squares concatenated, aka "texture atlas". This could be achieved much more cleanly (no bleeding artifacts when mipmapping etc) with array textures.

Describe the solution you'd like

Describe alternatives you've considered

Working right now (but only for very short cases) is one uniform sampler2D per layer, but that is less flexible (awkward GLSL code), and the number of samplers is limited (minimum supported by GL is around 16 iirc, while array textures can have 100s-1000s of layers).

Additional context Nyan Cat is best cat.

3Dickulus commented 4 years ago

https://fractalforums.org/code-snippets-fragments/74/fragm-transparency-experiment/3154/msg17402#msg17402 (Firefox says mp4 file is corrupt but plays just fine with mplayer)

the method outlined at this link and the method demonstrated in the vid have no layer limits, the only requirement is a folder full of images from the sequence you want to use, this does not require uploading the entire vid to GPU so the image sequence is only limited by hard drive space.

claudeha commented 4 years ago

Thanks for the link. A useful technique.

But array textures are not only useful for sequential videos (eg, imagine a frag that displays a collection of images in a virtual exhibition environment), so would be nice to have in any case.

3Dickulus commented 4 years ago

I agree

A useful technique.

imho the preferred technique for using image sequences, can be any format, EXR for best quality

Arrays only in special circumstance and not as a commonly used feature

also arrays are a modern GL feature so back burner this one (sampler2DArrayWidget) until we have a stable "modern GL" release ready to begin implementing widgets for modern GLSL commands

as the engine is modernized all of the frags will have to be dragged, kicking and screaming, into a modern state with a tutorial how-to frag for each new feature as they become available.