Page 1 of 1

Audiio waveform mesh deform

Posted: Sun Nov 13, 2011 8:08 am
by StevenM
http://www.youtube.com/watch?v=In99mCPm694


Just experimenting a bit - applied a mesh expression over a net here - split stereo. CPU version a still runs @ 30 FPS. My Limit though - doubling the size brings the CPU down to 19 fps. Would hope to see some liquid maybe smart particle - effects with the GPU versions.

I wish I could figure out how to use shaders - Hopefully some examples in the future will help me get the ball rolling. Having trouble with variable types. The audio array data is an interlaced array in stereo pairs - I don't know how to deinterlace in the shader using a sampler1d type.

Also, -since the latest beta - if I save preset with an array error (even though I shouldn't) - I need to restart FL Studio to get ZGEViz working again. The error "cannot use this on Render" will not clear - even after I fix the error.

Posted: Sun Nov 13, 2011 10:46 am
by VilleK
Hi Steven,

Already creating samples I see, good work! I guess it would look better with some smoothing on the audio data, not sure if that should be done with a visualizer setting or leave it to the effect developer to solve with scripting.

Yes shader creating is really tricky and I am by no means an expert on them myself.

Using the GLSL-function texelFetch you can send in an integer coordinate which means it is easy to split stereo-pairs:

http://www.opengl.org/sdk/docs/manglsl/ ... lFetch.xml

Simply use even coordinates for left channel and odd for right.

You need to know the size of the array (to know the upper bound of the texture) but you can send that into the shader using a ShaderVariable that you set to AudioArray.SizeDim1 using an expression.

Posted: Sun Nov 13, 2011 12:18 pm
by StevenM
not sure if that should be done with a visualizer setting or leave it to the effect developer to solve with scripting.
If it's possible - think anything that could be built in to the visualizer including smoothing would be appreciated. Just as long as the control is off by default like the rotate and zoom.

I think that a gain/amplitude parmeter is going to be a part of every audio wave form driven script. Smoothing - should be, but that is a little difficult (for me anyway) to figure out.

Posted: Sun Nov 13, 2011 12:39 pm
by StevenM
Yes shader creating is really tricky
Indeed - not used to the paradigm and the way data is handled at all - but I guess that is what makes so fast.

I'll have a closer look at texel fetch - and try it later, thanks.