Skip to main content
Share Your Experience: Take the 2024 Developer Survey
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 ...
Orren Ravid's 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 ...
Engineer's user avatar
  • 29.9k
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 ...
Stephane Hockenhull's user avatar
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 ...
wondra's user avatar
  • 4,930
4 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 ...
DMGregory's user avatar
  • 135k
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. ...
Jarrett's user avatar
  • 225
4 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 ...
DMGregory's user avatar
  • 135k
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). ...
Wyck's user avatar
  • 161
3 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. ...
Yudrist's user avatar
  • 963
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: ...
sam hocevar's user avatar
  • 23.9k
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'...
HDE 226868's user avatar
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 ...
JonS's user avatar
  • 299
2 votes

Diamond square texture: too-diamond-ish?

While this is an old question, it still ranks on google and the marked answer does not explain the artefacts seen in the output. I have just implemented this algorithm (for fun) in c# using linqpad ...
kas's user avatar
  • 21
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. ...
Pikalek's user avatar
  • 12.4k
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 ...
Bram's user avatar
  • 3,719
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 ...
J22o's user avatar
  • 482
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 ...
wondra's user avatar
  • 4,930
2 votes

How to get height from a mesh

The height of an object relative to an underlying terrain is the distance from its position \${P}\$ (plus an optional offset \$C\$ of choice) and the position projection \$P'\$ onto the terrain: ...
liggiorgio's user avatar
  • 4,831
1 vote

SRTM data represented in 3D using Unity Terrain

i used an application called L3dt, which can import many format of heightmap and export in many including RAW free version here (you can also email request a free trial of the Pro Edition): http://...
Big T Larrity's user avatar
1 vote

Creating terraced terrain

As an analogy to your graph, I submit $$min(slope * mod(x, 1), 1) + \lfloor x\rfloor$$ http://www.wolframalpha.com/input/?i=plot+(min(5+*+mod(x,+1),+1)+%2B+floor(x))+from+x%3D-5+to+5
Jimmy's user avatar
  • 9,029
1 vote
Accepted

Algorithm for "mipmapping" terrain vertex heights and normals

I've not dealt with LOD before. I will say, that I've always wondered if instead of averaging if you did some sort of minimum and maximum values for a group of vertices if that would produce better ...
user1118321's user avatar
  • 2,632
1 vote
Accepted

Height Maps for story driven terrain

A good introduction tutorial on procedural terrain can be found at the Red Blob Games blog. You will also find that at some point, height maps will not cut it any more. There will be no overhangs, no ...
Bram's user avatar
  • 3,719
1 vote

How to make a noise gradient?

You could take a linear gradient between equator and poles ranging from min at the poles (y = 0 and y = 100) to max at the ...
Olivier Jacot-Descombes's user avatar
1 vote

How to make a noise gradient?

Just because you use noise as your data, doesn't mean you can "modulate" the result. To get a gradient overlay on top of noise, just multiply it with a factor that ranges from 0.8 at north pole, to 1....
Bram's user avatar
  • 3,719
1 vote
Accepted

Applying Perlin Noise to Tiles

EUREKA! Introduction My initial question was about "How to Tiling with Perlin Noise" I had in mind creating a plane with tiles (kind of a grid) [width * height] and on those tiles i will paint ...
WhiteGlove's user avatar
1 vote

Drawing roads on heightmaps

When you place a road, you need to subdivide it into triangles based on the terrain triangles under it. Let's forget the y axis for a moment, and do things as if they were in 2d. First of all, get ...
Bálint's user avatar
  • 14.9k
1 vote

Using 2D Heightmap Data to generate terrain with the Marching Cubes Algorithm

You need to set a positions density to Mathf.clamp(perlin - pos.y, 0, 1); Instead of setting the values to either 1 or 0, this makes the top a bit more smooth. ...
Bálint's user avatar
  • 14.9k

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