15 votes
Accepted

How can I generate a (relatively) linear dungeon path?

Requirements You want multiple paths from A to B. You want to work in grid space, presumably this is tile space for your side-scroller. You don't want paths to cross, or it will spoil game ...
user avatar
  • 29.1k
14 votes
Accepted

Need simple 3D terrain render with big texture map

I have been able to do this using the 3d modeling software Blender. I used UV mapping to map the texture and the displacement modifier to apply the height map. If you need some form of XNA code for ...
user avatar
12 votes
Accepted

Efficient algorithm to aggregate a heightmap to a lower resolution

Mipmapping is the way to do this. The algorithm already exists in hardware and it is extremely fast since GPUs are massively parallel devices. All you need to do is set up a 3D context in something ...
user avatar
  • 29.1k
6 votes
Accepted

Triangles go missing as Z changes

so, to rework from comments: this is Z-fighting. The math is very well explained here: http://chaosinmotion.com/blog/?p=555, and the ways to solve it here: https://www.opengl.org/wiki/...
user avatar
  • 211
6 votes
Accepted

Why can't I patch my procedural terrain together?

Before Diamond-Square begins, you'll have to make sure the outermost boundaries (and the maximum number of potential midpoints generated therein) are set equal on either side of the map (in x and y). ...
user avatar
  • 29.1k
5 votes
Accepted

How can I compute a "steepness" value for height map cells?

You almost have the right idea, but actually it is much simpler than you might think. The simplest way of measuring steepness is by finite differencing: ...
user avatar
  • 3,567
5 votes

Procedurally generated terrain that has some caves

You'll probably want to do a 2nd pass and carve caves after doing the regular quick height-map generation pass. Find a steep slope in the low-frequency height map layer (if you use multiple ...
user avatar
4 votes
Accepted

Simplex noise heightmap

Assuming you have translated this from the original Java code it looks like you have been a bit careless in adding brackets in a few places. For example the original code has: ...
user avatar
  • 191
4 votes

Height field/Shallow water eqation water simulation with ground height

In a nutshell, what makes a shallow water equation a shallow water equation is that the water height is not zero and it assumes no variation in the seafloor. Note: No fluid dynamics equation will ...
user avatar
  • 1,740
4 votes
Accepted

Linear Gradient with angle formula

It looks an introduction to linear algebra is in order, or more precisely the dot product: dot(a, b) = |a| |b| cos(Theta) Why is it helpful? Because of its ...
user avatar
  • 4,880
4 votes
Accepted

Alternate approach to generating rivers in a procedurally generated world creates very boring rivers

I think your problem is mostly a matter of scale. Your height maps are way too undetailed to do anything but shoot straight out to sea. They are more like small islands than entire vast continents. ...
user avatar
  • 965
4 votes
Accepted

Calculating normal map from height map using Sobel operator

So it looks like my problem was in the float32 height(const std::vector<char>& data, const int width, const int height, uint32 x, uint32 z) function. ...
user avatar
  • 215
3 votes
Accepted

How to achieve a layered terrain simlar to Godus

A hill like this could be created with the following algorithm: Start with a small circle in form of a regular n-gone (the mountain top). Create a larger "blob" on height 0 by taking the corner-...
user avatar
  • 112k
3 votes

Weird effect when generating gradients for height map

Here are four options that you can try: A) Scale & threshold existing output You can ensure that the gradient saturates at some maximum value before reaching any of the cell borders. This will ...
user avatar
  • 115k
3 votes

Simple Water surface simulation problems (GDC2008 Matthias Muller- Hello World)

The error is in the slide, the correct implementation is: ...
user avatar
  • 2,826
3 votes
Accepted

The GameObject transform automatically sets to (0, 0, 0) when i apply Perlin Noise

You told it to set the scale to zero when you wrote textureRender.transform.localScale = new Vector3(); That's because a new Vector3 is initialized to (0,0,0). ...
user avatar
  • 161
3 votes
Accepted

How to make a noise gradient?

Here are two different ways I might approach this problem, showing how they change as the effect intensity is cranked up & down. The outermost column on each side is just my gradient, computed as ...
user avatar
  • 115k
3 votes
Accepted

Deriving shadow position from a 2D heightmap

You can associate a "shadow height" with each cell on your map. This is the elevation something would need to have above 0 / "sea level" in order to rise out of the shadow and into ...
user avatar
  • 115k
2 votes

How can I make huge terrains in Unity?

We did implement huge terrains in Unity5 by processing SRTM data for the whole earth into height-maps for TerrainData objects with different Levels of Details[1]. ...
user avatar
  • 121
2 votes

UE4: Apply texture on landscape based on angle

To apply different textures based on height the general method is to, in a pixel shader; Find the height of the geometry at the current pixel position. Perform a texture lookup on the heightmap that ...
user avatar
2 votes

How do I convert a greyscale height map to .3ds format?

As tkausl suggests, it should be trivial to program a simple tool: Construct 2D grid Apply heights from the image Write it to OBJ format file Import into 3DMax
user avatar
  • 10.1k
2 votes

HeightMap from a graph

TL;DR: Use bicubic interpolation or spline interpolation. So, you're looking for a method of two-dimensional interpolation. Unfortunately, this isn't a perfect two-dimensional grid (mathematically, it'...
user avatar
2 votes

My perlin noise height map doesn't have smooth transitions and goes directly from black to white

There is a bug in the final normalisation code, fortunately it’s easy to fix. You only need to change: map2[x][y] = map2[x][y] * mapMultiplier into: ...
user avatar
  • 23.4k
2 votes

Drawing roads on heightmaps

I would suggest modifying the engine to expose the Landscape functions. Then add a button to the Landscape tool palette, to force a terrain rebuild after placing roads. Terraim rebuild routine could ...
user avatar
  • 299
2 votes
Accepted

How many datapoints are there generally in terrain height maps?

There really isn't a specific standard for point density, for a few good reasons. However, in my experience, a descent density is about 3-7 points per m^2. The reason that there isn't a standard is ...
user avatar
  • 482
2 votes
Accepted

Procedurally generated terrain that has some caves

A blog post at the accidental noise library addresses exactly this issue. It offers the solution of perturbing the xy values, and of a single-pass implicit solution that creates caves that narrow as ...
user avatar
  • 3,679
2 votes
Accepted

Diamond square texture: too-diamond-ish?

Your code cites the Wikipedia article, which in turn has a section called "Artifacts and Extensions" that observes a potential problem: The diamond-square algorithm was analyzed by Gavin S. P. ...
user avatar
  • 8,770
2 votes
Accepted

Creating terraced terrain

Does not seem to be as complicated as it looks like to implement the algorithm you suggested. The complexity of log(n) is also most likely an optimal one. In order to re-iterate: Find the lower ...
user avatar
  • 4,880

Only top scored, non community-wiki answers of a minimum length are eligible