🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

I don't understand how people apply LOD to an FFT

Started by
15 comments, last by JoeJ 4 years, 9 months ago

I've made a working FFT for an ocean via Tessendorf's paper.

 

And i've seen people mention they use a LOD system so there is less performance wasted on distance meshes from the camera. But from the algorithm - this makes no sense. 

The FFT equation requires a length (mesh vertex count along x and y) and resolution, if you change either one you get totally different result for the same input seed at any given time. So how exactly is that an optimisation or at all beneficial - it makes no sense..... 

I can't seem to find many people who understand the math to answer this question which is such a frustration to say the least. 

Advertisement
25 minutes ago, CelticSir said:

The FFT equation requires a length (mesh vertex count along x and y) and resolution, if you change either one you get totally different result for the same input seed at any given time

Is your question about the algorithm not downscaling detail (thus producing less work for GPU ), or, why it can remain volatile in the given parameter?

In distance, many verticies-triangles and many sampled pixel shader function outputs fall for same common color on output screen pixel, that can be Fourier frequency interpolated depending on projection parameters you got running, I do not get what might be confusive for you personaly ;)

2 minutes ago, JohnnyCode said:

Is your question about the algorithm not downscaling detail (thus producing less work for GPU ), or, why it can remain volatile in the given parameter?


Well i've seen people say they use LOD on the meshes, such that, distance meshes have less vertices. And so i take that to also mean that for each k vector which is calculated from the vertex vector of a mesh is used. But that seems impossible to me since the algorithm will then have different (Lx,Ly) for different LODs even with the same resolution N - you don't get the same end result. Granted no one really ever goes into much detail on what they are doing so i have to interpret what they mean and its a guessing game a lot of the time.

2 minutes ago, CelticSir said:

for different LODs even with the same resolution N - you don't get the same end result

This is highly specific but I will not be mistaken I believe if I say that the volatility of result is the actual down-scale, the value that can freely change since it is weighted in distance to result on the frequency curve as if it was hardly computed from high frequency input. So of course, it can be any mesh at any moment but frequency result will be the same? I welcome someone else to elaborate closer.

In rasterization stage, a single screen pixel is computed from processing a lot of meshes triangles finding the final intersecting closest triangle that pixel's center is through to evaluate, this comes to account in frequency transform of meshes.

1 minute ago, JohnnyCode said:

This is highly specific but I will not be mistaken I believe if I say that the volatility of result is the actual down-scale, the value that can freely change since it is weighted in distance to result on the frequency curve as if it was hardly computed from high frequency input. So of course, it can be any mesh at any moment but frequency result will be the same? I welcome someone else to elaborate closer.

I am not entirely sure what you're saying here....i'm not a great expert at this topic i have had to teach myself so you might need to dumb it down for me :P

Do you know the rasterization stage of triangle/s? In other words, a pixel on screen can cover entire world part, but the aim of rasterization stage is to compute the final weighted colour of that pixel in account for that actual world state. The rasterization stage would help you understand why that algorithm works in my opinion. It is the stage of actual graphical output happening in pixel shader function upon delivered interpolated verticies

 

32 minutes ago, JohnnyCode said:

Do you know the rasterization stage of triangle/s? In other words, a pixel on screen can cover entire world part, but the aim of rasterization stage is to compute the final weighted colour of that pixel in account for that actual world state. The rasterization stage would help you understand why that algorithm works in my opinion. It is the stage of actual graphical output happening in pixel shader function upon delivered interpolated verticies

 

I'm not seeing what that has to do with CPU calculations of the wave spectrum ?

This is what i have as a visual result:
https://i.imgur.com/yxMypQf.mp4

Both has the same resolution, they have different lengths however so vertices are more spread out in one than the other based on length.
 

Ahhm... no idea how ocean simulation works, but assuming the hight map is the sum of all waves in a FFT, couldn't you simply fade out the highest frequency term, so it becomes zero at the transition to half resolution? Simulation could run with one term less after that, and maybe halfing the spatial resolution would not be very visible as well.

I assume what you do is similar to the wave guided quadrangulation stuff i'm working on, here an image:

image.png.dc32d17e56a59a8d38ba2d19959f424d.png

My goal here is to generate waves af constant period length over the surface, but if i would add multiple waves of different frequencies and dynamics, i guess it would become similar to ocean simulation. However, my point is that this works on a irreguler mesh, with variable edge lengths and angles. And this makes me think halfing sampling resolution on regular grid should work without visual seams.

 

No. halving the resolution would change the result of the output. As does changing the length - seems changing either one whether independently or in unison gives the same problems.

3 minutes ago, CelticSir said:

No. halving the resolution would change the result of the output.

What i mean is to distrubute that change gradually, so it would not matter visually.

This topic is closed to new replies.

Advertisement