FlashFX's rendering pipeline operates in the following stages:
Scene Graph (JavaScript)
Compositing Plan (determine draw order, blend modes, effects)
GPU Batching (group elements that share shader programs)
WebGL Draw Calls (submit geometry and textures to GPU)
Framebuffer Compositing (blend layers together)
Canvas Output (display or capture for export)
Each operation that submits geometry to the GPU is a draw call. Fewer draw calls means less CPU-GPU communication overhead and faster rendering.
FlashFX batches elements that share:
Elements that break batching:
When an image is imported or a rasterized text/shape is generated, it is uploaded to GPU memory as a texture. This upload happens:
Texture upload is expensive. Avoid situations where the GPU texture must be invalidated and re-uploaded on every frame (e.g., animating a filter that requires a full re-rasterize of vector content).
Certain operations require rendering to an intermediate offscreen framebuffer before compositing into the final output. Each offscreen buffer consumes GPU memory equal to its dimensions x 4 bytes per pixel.
Operations requiring offscreen buffers:
A complex composition with many elements using non-Normal blend modes or blur effects may require many simultaneous offscreen buffers. On devices with limited VRAM, this can cause rendering slowdowns, quality reduction, or in extreme cases, a tab crash.