Fractal noise terrain generating strange artefact lines
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 :)
My first impulse is to ask why you're manually computing octaves, instead of using noiseDetail?
http://www.processing.org/reference/noiseDetail_.html
If you just want more total amplitude out of your noise, multiply the output of noise by some scalar >1. If you want more detail to exist within that amplitude, increase noiseDetail.
The artifacts you're seeing are a necessary part of the fact that you're using octave-aligned perlin noise generated from the same seed and just stacking it up with no smoothing. And on top of that, some implementation-specific interpolation between generated values is going on behind the scenes. Either DO perlin noise yourself, or use the built-in perlin noise, don't try to do both.
看到你的照片,我不知道,但它闻起来/感觉像一个类型铸造问题。
链接地址: http://www.djcxy.com/p/37178.html上一篇: 基于高度图的地形上奇怪的正常世代
下一篇: 分形噪音地形产生奇怪的赝象线