ambrosiogabe / MathAnimation

A simple C++/OpenGL application to create quick and dirty mathematically accurate animations
982 stars 49 forks source link

Make cached SVGs the same size as the output render (and half the size while editing) #77

Open ambrosiogabe opened 1 year ago

ambrosiogabe commented 1 year ago

Make sure that the cached SVGs are only as big as they need to be. So if the biggest SVG path that gets rendered to the final output is only 50px X 50px, make sure the cached SVG isn't any bigger than that.

While editing, the SVGs should be at 1/3, 1/2, or 2/3 the size depending on the viewport fidelity. Then during export it should be 1:1 where possible. If making the SVG 1:1 with the rendered size would result in too big of a texture, then clamp it at a reasonable cutoff value.

For example, if the final output is supposed to 8300px wide, that's ridiculous and I won't support that fully since GPUs have practical limits and the exported video is only 4K max right now. So instead of making the final output 8300px, clamp it to something like 2000px max.