Closed Matt343 closed 3 years ago
I found these parameters are pretty good:
let freq = 0.25;
let scale = 5.0;
let seed = 666;
let octaves = 9;
let freq_warp = 0.05;
let scale_warp = 1000.0;
This is definitely more interesting than the noise we had before. It does take a lot longer to generate, but that's not a big problem for this example. It might be worth adding some output to say "generating noise, please wait."
I've also noticed that it results in some weird artifacts in the meshes. I'm assuming either the noise itself is getting some weird jaggy regions or the mesh normal estimation is having problems.
Of course, there is only one light in the scene so it's not going to look quite right when a triangle is not getting any light, but it basically looks like acne when there are noticeable patterns of darkness.
This is definitely more interesting than the noise we had before. It does take a lot longer to generate, but that's not a big problem for this example. It might be worth adding some output to say "generating noise, please wait."
I've also noticed that it results in some weird artifacts in the meshes. I'm assuming either the noise itself is getting some weird jaggy regions or the mesh normal estimation is having problems.
Of course, there is only one light in the scene so it's not going to look quite right when a triangle is not getting any light, but it basically looks like acne when there are noticeable patterns of darkness.
Yeah I was going for more of a stress test of the system than anything realistic, so I dialed up the warping to get more overhangs. I'll see about adding some console output.
The dark patches are strange, I don't get those on my machine at all
Ah, with your parameters I do see the dark patches. Seems to be related to triangles next to very sharp edges. It makes sense that the normals might be thrown off by that case I guess, depending on how they're generated.
Yea I made an issue for these artifacts: https://github.com/bonsairobo/building-blocks/issues/31
I think I understand pretty well what the issue is but I don't know of an obvious fix, other than trying to constrain the SDF to avoid sharp edges. Or maybe there is something to do in the shader to get interpolation that's aware of the surface curvature.
I have been messing around more with noise parameters because I've noticed some artifacts. I made all of the parameters load from a file so I can quickly test them out.
Here's a weird case:
noise: (
freq: 0.1,
scale: 50.0,
seed: 666,
octaves: 9,
freq_warp: 0.1,
scale_warp: 100.0,
),
I don't understand the noise well enough to say why this would happen.
I think after warping and resampling, we should be doing trilinear interpolation rather than just truncating the floating point coordinates. If I had to guess, this would help make the warping look a lot smoother. I will give it a try.
Yeah you're totally right, I was hesitant to try anything that would slow it down further :/
Yea I'm guessing the main bottleneck is hashing every point when calling ChunkMap::get_point
. We can probably figure out a faster way. The unfortunate part is that the warping will inevitably go out of bounds of any chunk array, but we can probably figure out what the bounds are and pad the array we're sampling. That might mean we write all of the chunks into one big padded array that we sample.
Dang I am having a hard time getting the trilinear interpolation to make this look any better. The warping seems nice in theory but I'm not able to make it look as smooth as the GPU gems article.
I think I'd like to try my heightmap with subtracted noise idea.
I will commit something close to what you've written but without the warping if that's OK. I will add you as a co-author. I think adding more octaves was a big improvement, so I will keep that.
Yeah I actually tried your heightmap idea before this, it just didn't seem like the heightmap was adding that much complexity that the fbm noise wasn't already providing.
That sounds good, I'll close this out then.
I implemented some of the basic terrain generation techniques outlined here: https://developer.nvidia.com/gpugems/gpugems3/part-i-geometry/chapter-1-generating-complex-procedural-terrains-using-gpu
Specifically, I added a base layer at y=0 and offset the noise lookup coordinates with a warp noise (which generates 3d offset vectors at each point). This gives us some amount of overhangs and interesting features to test against, although I didn't spend too much time tuning the relative frequencies and scales of the two noise textures to achieve anything super realistic.