Magnogen / Graidients

Generate gradients and patterns using Neural Networks
https://magnogen.net/Graidients
10 stars 0 forks source link

Gotta go fast #1

Open Magnogen opened 2 years ago

Magnogen commented 2 years ago

It just takes way too long, especially at high(ish) resolutions like 2K.

Loading new canvas sizes also takes a while

Magnogen commented 2 years ago

Alright, done the first one - the image is now split up into configurable chunks. This makes a nice mosaic effect when constantly changing the network values.

I'll have to fix a few bugs, I'll make issues for em and link here.

Got started on the last one too, most of the way there, just gotta fix the bugs I mentioned.

As for the shader and webworker ideas, I have no idea how to start that so ig I'll just do some glsl research and such, but tbh I quite like the rendering animation anyway, so we'll see how it goes

Magnogen commented 1 year ago

THREADS

https://youtu.be/pQPqhZRUz3U

This is an excellent video - definitely look into using workers and typed arrays for speeding this up. The chunking I already have would definitely help too as each worker can just pass the chunked typed array back and the main thread can render it.

Magnogen commented 1 year ago

ARRAY BUFFERS

https://gist.github.com/postspectacular/bea4fdbaa1479cc11a064e453dd7fe17

Saw this on twitter - might be worth looking into it tbh, a potential 3-4x boost in speed? Interesting.

Edit: Just did this with Camaker - SO FAST

Magnogen commented 1 year ago

WEBASSEMBLY

https://blog.scottlogic.com/2019/05/17/webassembly-compiler.html

Interesting, this might be a further stretch, but could be worth it. Idk