I am trying to display noise in B&W, im using library and got weird results, so i changed the library however this still keeps happening so i feel that the issue is with how i am displaying it, does anyone have any idea why it is doing this:
This is my code:
namespace BiomeGen
{
class Terrain
{
Texture2D map;
Color[] mapData;
FastNoiseLite noise;
public Terrain(GraphicsDevice grpDev, int width, int height)
{
map = new Texture2D(grpDev, width, height);
mapData = new Color[width * height];
noise = new FastNoiseLite();
noise.SetNoiseType(FastNoiseLite.NoiseType.OpenSimplex2);
}
public Texture2D getTexture()
{
int counter = 0;
for(int i = 0;i < map.Width;i++)
{
for(int j = 0;j < map.Height;j++)
{
int temp = (int)Math.Round((noise.GetNoise(i, j) + 1) * 127);
//Debug.WriteLine(temp);
mapData[counter] = new Color(temp, temp, temp);
counter++;
}
}
map.SetData(mapData);
return map;
}
}
}
and this:
_spriteBatch.Begin();
_spriteBatch.Draw(gener.getTexture(), new Vector2(0, 0), Color.White);
_spriteBatch.End();
and this:
Terrain gener;
Thanks in advance