Jump to content

Fast Fourier Transform in VEX


Erik1801

Recommended Posts

Hello, this is my first time posting here so ill do my best xD 

My problem is as follows;
Me and a friend have been working on a VEX program that renders the image of a Kerr Black Hole by using the correct math of General Relativity and the equations of motion of the Kerr Metric. So far, this has worked pretty well and we even got a Volumetric disk in the thing. Render times at the moment are about 16min for a 3k image btw, see attachment. 

Now, there are still several things missing from this. Besides physical stuff an important aspect i want to add is Bloom. And from the research i did, it seems like Convolutional Bloom is the way to go. Only one problem, that requieres the Fast Fourier Transform to convert the render into the frequency domain. The idea is to then apply a Gaussian filter to the frequency domain, perform an inverse FFT and blend the result with the render. In theory that should give nice bloom. 

Now, our attempts to do this failed at step one which is the FFT. This is not helped by the way VEX works where the attribute wrangler will run over every point individually. From what we gather we have to basically make a FFT function that takes in a huge ass array of numbers which represent the entire image as a Function and then do the FFT for that point to get the Frequency. This does mean we have to loop over every pixel, for every pixel. Not great but like its not like this is real time anyways. 

So far, we were not able to do it, either because a function we made just wouldnt finish or the return is nonsense. Like the 2nd attachment. (Keep in mind the 2nd image was a very earily attempt, but it gets the image across).

So yeah, if anyone has something working or can point us the right direction that would be great : D Thanks for reading !

Image_3+2.png

image (1).png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...