• Create Account

# Sevvy325

Member Since 19 Dec 2012
Offline Last Active Dec 23 2012 05:17 AM

### In Topic: Implementing Simplex Noise for 2D terrain generation

20 December 2012 - 05:15 PM

As I see it, your actual rendering code is way too complicated - but maybe that's just my lack of familiarity with XNA. Can you post a screenshot of what your output looks like?

Right off the bat I see one issue: your fBM function is starting with integer coordinates for x and y (i.e. using the pixel's row,column address). Instead it should be using coordinates in the range 0,1 (i.e. x/width,y/height).

http://imgur.com/3InwG

Here is my output, I'm going to fix the FBM function now, I'll report back with results.

*EDIT* To clarify, the third square is the one mapped from the fractal Brownian-motion function.

*EDIT2* I changed the FBM function to be as such:

```public static float[,] fracBM(float[,] chunk, int octives, int seed)
{
const float lacunarity = 1.9f;
const float gain = 0.65f;
float frequency = 64.0f / chunk.GetLength(0);
float[,] fbm = chunk;
float sum = 0.0f;
float amplitude = 0.3f;
float x, y;
for(int l = 0; l < chunk.GetLength(0); l++)
{
for(int b = 0; b < chunk.GetLength(1); b++)
{
sum = 0.0f;
x = (float)b / (float)chunk.GetLength(1);
y = (float)l / (float)chunk.GetLength(0);
for (int i = 0; i < octives; i++)
{
sum += amplitude * noise(x * frequency, y * frequency);
amplitude *= gain;
x *= lacunarity;
y *= lacunarity;
}
Console.WriteLine(sum);
fbm[l, b] = sum;
}
}
return fbm;
}
```

and I'm still getting the same output :/

### In Topic: Implementing Simplex Noise for 2D terrain generation

20 December 2012 - 10:44 AM

Whenever I click either link, it takes me to the hastebin home page. I'm super excited to see what this has to offer though!