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.

180 questions
19
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
  • 3,830
  • 1
  • 14
  • 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,622
  • 7
  • 33
  • 50
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,028
  • 8
  • 37
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,165
  • 1
  • 12
  • 24
6
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,114
  • 3
  • 15
  • 28
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
  • 5,300
  • 1
  • 18
  • 46
4
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
  • 55
  • 11
4
votes
0 answers

Hydraulic heightmap erosion creating diagonal artifacts instead of desired result

Using this PDF as a base to model my own algorithms, the geological/geothermal erosion in the paper works fine: kr=0.25 ke=0.8 ks=1.5 kc=0.1 for(i=0;i
Lucas F
  • 41
  • 1
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,512
  • 2
  • 13
  • 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
1 answer

How to implement a simple height map to an Unity Shader

Let me start off by saying I know very little about shader programming. A lot of what I have here is stitched together from online resources and existing assets. I just need to know how to correctly integrate a height map into a unity shader. It…
Mike OD
  • 107
  • 1
  • 9
3
votes
1 answer

Need help on creating triangle mesh from height map (JavaFX)

I have a program that generates a height map (2D array of integers from 0-255) and builds a 3D view using a Shape3D "Box" object for each 'pixel' with a height proportional to its value in the height map. This creates a boxy-looking terrain that…
3
votes
0 answers

Render horizon silhouette using Metal in SceneKit

I'm working on simple side project and small part of it is rendering a terrain. I'm rendering the terrain using height map information. But here is my problem: I would like to render just a silhouette/outline of the terrain/horizon. Here is…
Martin Pilch
  • 3,055
  • 2
  • 31
  • 58
1
2 3
11 12