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

## Recommended Posts

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.

##### Share on other sites
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

Edited by JohnnyCode

##### Share on other sites
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.

##### Share on other sites
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.

##### Share on other sites
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

##### Share on other sites

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

##### Share on other sites
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.

##### Share on other sites

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:

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.

##### Share on other sites

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.

##### Share on other sites
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.

## Create an account

Register a new account

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 9
• 11
• 15
• 21
• 26