BrokenSource / DepthFlow

🌊 Image to → 2.5D Parallax Effect Video. A Free and Open Source ImmersityAI alternative
https://brokensrc.dev
GNU Affero General Public License v3.0
407 stars 26 forks source link

Chore: Make the code extensible and usable outside DepthScene by refactor #43

Open Tremeschin opened 2 weeks ago

Tremeschin commented 2 weeks ago

The readme of ShaderFlow contains a modified DepthFlow shader with a Music Visualizer glued on top and it looks amazing.

The DepthFlow shader can be refactored into a standalone file defining a struct of parameters, and a single function to do the projections (might need to accept a Camera element as well), returning the final coordinate and other utils of the algorithm.

This would allow creating awesome derivative work out of it, instead of doing everything inside its own void main() function on GLSL !

Tremeschin commented 2 weeks ago

I've pulled off a shader rewrite into a DepthFlow struct so this is sorted out, the idea now is to either create a DepthModule inside shaderflow, but that would need an overhaul on the metaprogramming, at least splitting the current shader code before the main makes it usable outside..