Questions tagged [heightmap]

Heightmap is texture containing individual heights used to store terrain data.

Heightmaps textures are used to store geometric detail like terrain, object surface etc. It is used to simplify manipulation of such geometry and even speed up its rendering (if mesh generation moved into shaders).

In case the heightmap is stored in common raster image formats then for proper geometry restoration we need also additional info like: scale,position and orientation for such textures which are not stored in them. So those are usually stored in some separate config file, encoded into filename, or hardcoded into application that uses them.

196 questions
18
votes
1 answer

Mapping a height map to a grid-based contour format

I have a 2D height map in the following format 06 36 39 42 43 55 ... 37 40 43 43 45 46 ... 40 43 44 45 46 48 ... 44 44 46 47 48 50 ... 41 44 45 47 48 48 ... ... And I need to remap it into a grin based contour format (so it can further be mapped…
Sash
  • 4,448
  • 1
  • 17
  • 31
13
votes
5 answers

WebGL - Textured terrain with heightmap

I'm trying to create a 3D terrain using WebGL. I have a jpg with the texture for the terrain, and another jpg with the height values (-1 to 1). I've looked at various wrapper libraries (like SpiderGL and Three.js), but I can't find a sutable…
goocreations
  • 2,938
  • 8
  • 37
  • 59
10
votes
3 answers

How to make a smoother Perlin noise generator?

Using a Perlin noise generator to make the tiles of a map the noise is too spiky. It has many elevations and no flat places. They don't look like mountains, islands or lakes; they are random with a lot of peaks. 1D: def Noise(self, x): # I wrote…
Ender Look
  • 2,303
  • 2
  • 17
  • 41
8
votes
3 answers

GLSL shader: Interpolate between more than two textures

I've implemented a heightmap in OpenGL. For now it is just a sine/cosine curved terrain. At the moment I am interpolating between the white "ice" and the darker "stone" texture. This is done like this: color = mix(texture2D(ice_layer_tex,…
T_01
  • 1,256
  • 3
  • 16
  • 35
8
votes
2 answers

OpenGL Texture sampling different depending on camera position

I am rendering a point based terrain from loaded heightmap data - but the points change their texturing depending on where the camera position is. To demonstrate the bug (and the fact that this isnt occuring from a z-buffering problem) I have taken…
jProg2015
  • 1,098
  • 10
  • 40
7
votes
2 answers

Simulating fluid flow over a heightmap

I am looking for a way to approximate a volume of fluid moving over a heightmap. The easiest solution I can think of is to approximate it as a large number of non-drawn spheres, of small diameter (<0.1m). I would then place a visible plane…
Venatu
  • 1,264
  • 1
  • 13
  • 24
5
votes
1 answer

How to send non-normalized/unclamped values to GLSL shader using opengl textures?

I am trying to send an array of float values(height map) to GLSL as a GL_TEXTURE_2D. While I have the samplers set right, the issue comes from the clamping that happens when I upload the texture using glTexImage2D(). glGenTextures(1,…
Rathnavel
  • 85
  • 1
  • 15
4
votes
1 answer

Is there a built-in Three.js heightmap function?

I am currently working on a game in JavaScript, in Three.js. I am curious if I can add a height map to the walls that I have to make them more realistic (see image). An image of the game design with the wall that is 2D. All the tutorials that I have…
Codeitfast
  • 169
  • 13
4
votes
2 answers

How can you find the cuboid with the greatest volume in a heightmap? (with low complexity)

I need to find the cuboid with the greatest volume, contained within a 2D-heightmap. The heightmap is an array of size w*d where w is width, h is height and d is depth. In C, this would look along the lines of: unsigned heightmap[w][d]; // all…
Jan Schultke
  • 17,446
  • 6
  • 47
  • 96
4
votes
1 answer

C++ OpenGL Cube Map Perlin Noise to Sphere

I'm currently working on some Planet Generation mainly for fun and hoping to end up with some kick ass planets. I'm using a Cube which has been mapped into a sphere by normalization. The terrain isn't textured properly yet in this picture. This is…
Vangoule
  • 155
  • 2
  • 11
4
votes
1 answer

Tweaking Heightmap Generation For Hexagon Grids

Currently I'm working on a little project just for a bit of fun. It is a C++, WinAPI application using OpenGL. I hope it will turn into a RTS Game played on a hexagon grid and when I get the basic game engine done, I have plans to expand it…
4
votes
2 answers

Displacement Map UV Mapping?

Summary I'm trying to apply a displacement map (Height map) to a rather simple object (Hexagonal plane) and I'm having some unexpected results. I am using grayscale and as such, I was under the impression my height map should only be affecting the Z…
rrowland
  • 2,734
  • 2
  • 17
  • 32
4
votes
2 answers

Generating Heightmap from Image with GLSL Shader

Lately I've been playing around with webGl and I stumbled across a cool little demo here (source here) that I'd like to alter slightly to get some cool results. I'm interested in changing the way the terrain is generated. Instead of layering 10…
Glynbeard
  • 1,389
  • 2
  • 19
  • 31
3
votes
2 answers

How to optimize my custom mapformat (Java)

I'm creating a 3D game where I have a large open world (200×200 kilometers), that uses a heightmap. I divide the heightmap in 200×200 = 40,000 regions of 1000×1000 meter, and those are again divided in 20×20 = 400 chunks of 50×50 meter. The…
Gmfreaky
  • 67
  • 6
3
votes
2 answers

How to limit elevation over distance using the A* search algorithm?

My application finds or constructs routes that are shortest for trekkers in a hilly/mountain terrain using the A* search algorithm. Input files are .dem (Digital Elevation Model) and a roadmap file that contains existing routes. Code is in Python,…
Navneet Srivastava
  • 933
  • 2
  • 9
  • 14
1
2 3
13 14