Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 18 Mar 2012
Offline Last Active Jan 11 2013 01:18 AM

Posts I've Made

In Topic: FFT Water Shaders

10 January 2013 - 02:54 PM

NVIDIA DX11 SDK has a compute shader implementation (OceanCS).  It follows the paper by Tessendorf. 

I've been reading through that SDK and a few other tutorials online.


I think i'm making some progress but I still just don't understand the math behind it.

In Topic: FFT Water Shaders

10 January 2013 - 11:59 AM

So I started reading up on DFT, I believe I understand a decent bit of the formula now. Allthough I stick have a good bit to go.

It isn't working but this is what I have so far:

	public float getWaveHeight(int index)
		float t = Time.deltaTime;
		float x_n = waveVerticeList[index].x;
		float N = meshLength; // Total vertice count
		float e = 2.71828f;
		float i = Mathf.Sqrt (-1.0f);
		float k = index;
		float sub = (2 * Mathf.PI) * k * N;
		float DFT = x_n * (Mathf.Cos (sub) + i * Mathf.Sin (sub));
		Debug.Log (DFT);
		// Fallback
		return DFT;
	public void runComputeShader()
		for (int i = 0; i < meshLength; i++)	
			waveVerticeList[i].y = getWaveHeight (i);
		parentMesh.vertices = waveVerticeList;
		//parentMesh.RecalculateNormals ();
Is it even in the right path? I'm not 100% sure what i'm doing hahaha.

In Topic: FFT Water Shaders

09 January 2013 - 08:51 AM

Thanks for the links i'll read through those as well.


Will post my results later this evening.

In Topic: FFT Water Shaders

08 January 2013 - 10:05 PM

Thank you so much for the explanation of the variables.


It's saved me a lot of stress and bafflement.


Here's 5 e dollars good sir.

In Topic: Optimized Unity Compute Shader Particlers

25 December 2012 - 02:52 PM

I did some tests and here's what I found.


With rendering of the pixels on at a short distance (Not right up against it) I got about 42 F.P.S. with 500K particles.  Then when you got up close it dropped to about 20-15.


With rendering off (Also not setting the buffers to the shader material) It got the same 42 F.P.S. on average (It occasionally would go to about 70fps for a few seconds).  But didn't have the drop off when you got close to where they would be, which makes sense.


So there's a definite bottle neck with rendering up close, but there's also a definite 20 fps drop happening on the compute shader to just control the particles.