GithubHelp home page GithubHelp logo

fft-ocean's People

Contributors

gasgiant avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fft-ocean's Issues

Method to replace JONSWAP spectrum?

Thank you, this is a great model! Really beautiful result! I would be interested in changing the JONSWAP spectrum with a custom wave spectrum, is there a way to isolate the contributions from JONSWAP? I notice it being explicitly called in WaveSettings, but I want to be sure I have also edited all of the other dependencies that assume a specific spectrum

Ocean spectrum math

Hello

Could you please refer me to sources on your ocean spectrum equations? I am not familiar with half of whats going on for your InitSpectrum shaders.

I am very familiar with Tessendorf's initial spectrum math but you don't seem to be using that one. You seem to be using multiple functions i am unfamiliar with and there is a lot of magic numbers with no explanations for them also.

How does getWaterHeight works

Hi,

First thanks for this beautiful code and video.
I have a question regarding the function that get the water height in CPU : WaveGenerator::GetWaterHeight().
How does it works ? Why is it not just the sum of the height of all cascades ?

Thanks in advance

Confused by some of your shader code

Hey, me again.

I've so far got most of the FFT understood now but I am confused by some parts of your code.

You have permute shader which I don't know what that is or where it comes from? I see no mention of it in Tessendorf.

Also your scale shader pass is also confusing you have:

void Scale(uint3 id : SV_DispatchThreadID)
{
	Buffer0[id.xy] = Buffer0[id.xy] / Size / Size;
}

This equates to (xy*Scale) / Scale which basically simplifies to xy so you're not scaling anything since scale/scale =1..?

Shouldn't it be:

[numthreads(8, 8, 1)]
void Scale(uint3 id : SV_DispatchThreadID)
{
	Buffer0[id.xy] = Buffer0[id.xy] / (Size * Size);
}

I am basing it on this iDFT equation:

image

Also i am very confused by the cascade stuff, does each cascade require its own FFT for DY DX DZ ? How did you chose the numbers:

    [SerializeField]
    float lengthScale0 = 250;
    [SerializeField]
    float lengthScale1 = 17;
    [SerializeField]
    float lengthScale2 = 5;

Are these numbers arbitrary or is there a calculation you made to determine the ideal cascade scales?

Thanks!

Where does the turbulence calculation comes from

Hi,

In compute shader WavesTexturesMerger.compute where does this calculation comes from :

Turbulence[id.xy] = Turbulence[id.xy].r + DeltaTime * 0.5 / max(jacobian, 0.5);
Turbulence[id.xy] = min(jacobian, Turbulence[id.xy].r);

I see it's used for foam rendering, but I don't fully understand how it works.
Thanks in advance.

Random guassian numbers for spectra

Hi

Me again, I've slowly been learning the math for this as I want to understand it before I use it.

I read tessendorf's paper but wanted to ask something about the complex number generation for the Fourier amplitudes.

For h0 it is defined as : 1/sqrt(2) * (a + ib) * sqrt(Phillips(kVector));

And h0* (the conjugate) is: 1/sqrt(2) * (a - ib) * sqrt(Phillips(kVector));

Does the conjugate h0* use the same a and b values as the h0 term (but b is negative) or do you generate a second complex number entirely?

How do you compute normal from derivatives

Really nice work. I have been working on FFT ocean waves in UE4 for a couple of weeks. I really appreciate you since I referred to your repository heavily. But now I am struggling with normals when putting cascaded waves together. I don't understand why it works. How do you compute normal from derivatives?

float4 derivatives = tex2D(_Derivatives_c0, IN.worldUV / LengthScale0);
#if defined(MID) || defined(CLOSE)
derivatives += tex2D(_Derivatives_c1, IN.worldUV / LengthScale1) * IN.lodScales.y;
#endif

#if defined(CLOSE)
derivatives += tex2D(_Derivatives_c2, IN.worldUV / LengthScale2) * IN.lodScales.z;
#endif

float2 slope = float2(derivatives.x / (1 + derivatives.z),
    derivatives.y / (1 + derivatives.w));
float3 worldNormal = normalize(float3(-slope.x, 1, -slope.y));

o.Normal = WorldToTangentNormalVector(IN, worldNormal);

Visible gap between tiles/rings.

Hi. Really nice work.

However I notice rendering artefacts on top/right edge of each Ring.
It is present both in the Editor and in the gameview.
Looks like it is off by one?

image

URP Support

Hi!
I was wondering if you planned to convert the "Ocean" shader to URP ๐Ÿ™
Or you can help me to do so?

Best,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.