2
\$\begingroup\$

enter image description here

I'm using the simplex noise 2d plugin for unreal engine 4, which can also be understood by most programmers. I have already implemented chunk generation and dual-chunk noise elevation. However, each chunk has a unique heightmap and this results in jagged voxel terrains. Pseudo code:

//Chunk.cpp
for(int chunkWidth = 0; chunkWidth <= 10; chunkWidth++){
   for(int chunkHeight = 0; chunkHeight <= 10; chunkHeight++){
      noiseX = ((chunkWidth / 10) - 0.5) * Frequency;
      noiseY = ((chunkHeight / 10) - 0.5) * Frequency;
      Elevation = SimplexNoise2D(noiseX, noiseY) * 100;
      ChunkLoc = getActorLocation(self);
      SpawnMeshAtLoc(ChunkLoc.x + chunkWidth, ChunkLoc.y + chunkHeight, Elevation);
   }
}

I have another variable available: chunk2DCoord(2D vector coordinate for each chunk)

\$\endgroup\$
1
  • \$\begingroup\$ What is your expected result? What is "jagged" vs "non-jagged"? \$\endgroup\$ Jun 3 '17 at 11:37
2
\$\begingroup\$

I solved this problem by changing the parameters of this function. The iteration caused this problem. The x and y values of the noise function should encompass the values of a voxel's world position.

USimplexNoise::SimplexNoise2D(VoxelWorldLocation.x, VoxelWorldLocation.y);

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .