phandasm / waveform

Audio spectral analysis plugin for OBS
https://obsproject.com/forum/resources/waveform.1423/
GNU General Public License v3.0
525 stars 37 forks source link

custom shapes #6

Closed turtlewizard73 closed 2 years ago

turtlewizard73 commented 2 years ago

Hi! Is there any way to customize your code, by changing your Radial layout? I was thinking, is that possible to implement a different function instead of the circle, like oval shape or maybe something like a polinomial funcion?

Thanks!

phandasm commented 2 years ago

Radial layout is a simple transformation in the vertex shader so it should be pretty easy to change it to more or less whatever you want. The code is here: https://github.com/phandasm/waveform/blob/d32b5d39da1cab97a4d8b6c5e6c5fa8dbf865113/data/gradient.effect#L37

You don't even need to recompile (assuming you don't change the inputs), though waveform's internals make some assumptions about the size and shape of the result so you might need to make some changes to these if it's an issue: https://github.com/phandasm/waveform/blob/d32b5d39da1cab97a4d8b6c5e6c5fa8dbf865113/src/source.cpp#L636 https://github.com/phandasm/waveform/blob/d32b5d39da1cab97a4d8b6c5e6c5fa8dbf865113/src/source.cpp#L475