solved, it was my shader
or that I compressed the resolution and expanded it
Hi, it’s the 3rd time that it happens to me, I work on a project that uses Mathf.PerlinNoise, I change something in my code, and then I get this:
THERE ARE LINES!
it becomes glithy, there are lines all over the place, but why?
this is the code:
//I generate it with:
private short[][] generateNoisLayer(short[][] layer, float scale,int min, int max) {
short[][] tmpLayer = copyMat(layer);
float seedx = Random.Range(0, 0);
float seedy = Random.Range(-0, 0);
//the values are ajusted so the max value will be the largest possible outcome
max = max - min;
for (int x = 0; x < 1920; x++)
{
for (int y = 0; y < 1080; y++)
{
tmpLayer[x][y] = (short)(min + (short)(Mathf.PerlinNoise(x / scale + seedx, y / scale + seedy) * max));
}
}
return tmpLayer;
}
//I call the method with:
debuglayer =
debuglayer = generateNoisLayer(elevation, 5.5f, -100, 100);
I draw the result with:
private Texture2D getMapDebug(short[][] map, float largestVal)
{
Texture2D tmp = new Texture2D(1920, 1080);
for (int x = 0; x < 1920; x++)
{
for (int y = 0; y < 1080; y++)
{
float normalized = (map[x][y] - (-largestVal)) / (largestVal - (-largestVal));
Color tmpC = new Color(normalized, normalized, normalized);
tmp.SetPixel(x, y, tmpC);
}
}
worldObj.GetComponent<Renderer>().material.SetTexture("_mapTexture", tmp);
tmp.Apply();
return tmp;
}
for the testing I set the seeds to 0, so I don’t use large floats, I tried setting the seeds to anything that you can think about, I tried restarting the PC. things that worked few hours ago, now give me glitches…

