I have a terrain generated of a Perlin Fractal Noise pattern that generates quite remarkable terrain. The problem I'm having is some veird lines going across both X and Z coordinates, I'm thinking it has to do with the fractal generation but as I generated a 2D picture of it I couln't see any artefacts. Artefact lines
The generation of the terrain is done by splitting up the terrain into chunks, which in turn are splitted up into tiles that depending on resolution has a size.
With each tile I calculate four corners in a similar manner for each corner piece:
float corner1 = mapHeight * fractal( x * tileSize +( posX * (mapSize) ) , z * tileSize +( posZ * (mapSize)) ,25000,0.5,16);
The fractal function:
float fractal(int x,int y,float gridSubs,float gain,int octaves){
float total = 0;
float freq = 1.0/gridSubs;
float amp = gain;
for(int f=0;f<octaves;f++){
total += noise(x*freq,y*freq)*amp;
freq *= 2.0;
amp *= gain;
}
return total;
}
EDIT: I haven't really gotten a good answer as to why this is happening but one possibility is that I had some strange values for the vertices position(though I shouldn't have).
I am still trying out a few ways to render the landscape efficently without clogging my GPU with vertices. With a few tests the artefacts are minimal and as far as I know might have to do with how the simple ligthing works in Processing, I will update this if I still cannot find a way around this.
If someone still knows a simple way to reduce the impact they make on the landscape or just have a good suggestion then please post below :)