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
0
votes
1 answer

Need to convert to a RAW file for a heightmap in Unity

I need to convert a grayscale heightmap I created into a RAW file to use in Unity. I have searched Google for a way to do this for a couple of hours, to no avail. Is there a way to do this without Photoshop? My file was saved as a JPG, but I could…
0
votes
1 answer

Matlab: Calculate apparent angle of horizon for points on elevation map

I have an elevation map of a mountainous area (large 2d array with z values) I want to know the height of the apparent horizon angle for all compass bearings for certain points on my height map. To illustrate, this website has some examples of what…
Swier
  • 4,047
  • 3
  • 28
  • 52
0
votes
2 answers

Implementing a 32-bit heightmap vertex shader in threejs

I am attempting to repurpose the heightmap shader example found here into one that will work with 32-bits of precision instead of 8. The work-in-progress code is on github: https://github.com/bgourlie/three_heightmap The height map is being…
w.brian
  • 16,296
  • 14
  • 69
  • 118
0
votes
1 answer

How do I update generate a normal map to match an equirectangular projection dilacement map

Im rendering a geodesic sphere of radius 1 in OpenGL and in my glsl tesselation shader multiplying the vertex by a value from a height/ displacement map which creates some large rays protruding from the sphere. I am looking for a way to be able to…
nich
  • 13
  • 2
0
votes
2 answers

Opengl terrain and tessellation shaders

Two questions: How do modern games set up their terrain vertices? Do they attach a height map image to a texture and then use it to set each vertex position, or do they just use a 3D software (like Blender) to create a file that contains these…
McLovin
  • 3,295
  • 7
  • 32
  • 67
0
votes
1 answer

Directx: HLSL Texture based height map. (Shader 5.0)

I'm trying to implement a GPU based height map the simplest (and fastest) way that I know how. I passed a (.png, D3DX11CreateShaderResourceViewFromFile()) texture into the shader, and I'm attempting to sample it for the current pixel value. Seeing a…
Rashid Ellis
  • 330
  • 3
  • 22
0
votes
2 answers

OpenGL crash on glDrawElements while trying to render Height Map

I'm writing a class to render a height map from a 32-bit bmp using modern OpenGL techniques. I had it working with immediate mode but wanted to try converting it to a modern OpenGL context. I'm using an element array buffer with the index data for…
0
votes
1 answer

Logic of 2D midpoint subdivide

I understand the concept but am having trouble implementing 2D subdivide. I have a 2D array representing a grid with the corners seeded. I believe I need 3 loops; 1 for the number of subdivide iterations, a second for each column in the row, and a…
Graham.Fraser
  • 369
  • 2
  • 12
0
votes
0 answers

Working out heightmap normals in DirectX using triangle strips

I'm trying to load in heightmap data but I'm struggling to figure out how to work out the normals. Have looked online but can't seem to find anything useful. I store the vertices using m_HeightMapVtxCount = (m_HeightMapLength - 1) * m_HeightMapWidth…
Chris
  • 49
  • 4
0
votes
2 answers

Converting grayscale image pixels to defined scale

I'm looking to use a very crude heightmap I've created in Photoshop to define a tiled isometric grid for me: Map: https://i.stack.imgur.com/I4EFu.png I'm aiming to loop through every pixel in the image and convert the colour of that pixel to a scale…
BeepBeep
  • 151
  • 3
  • 9
0
votes
1 answer

Alternatives to diamond-square for incremental procedural terrain generation?

I'm currently in the process of coding a procedural terrain generator for a game. For that purpose, I divide my world into chunks of equal size and generate them one by one as the player strolls along. So far, nothing special. Now, I specifically…
0
votes
1 answer

Java LWJGL - Heightmap not rendering correctly

I am trying to implement a heightmap into my game following Oskar Veerhoek's youtube tutorials. I follow the steps and I get a few methods: private static void setUpHeightmap() { try { // Load the heightmap-image from its resource file …
Divergent
  • 141
  • 2
  • 19
0
votes
2 answers

Fractal terrain/heightmap generation

I'm trying to re-implement something I did successfully a while ago, but I'm just not getting it quite right.. The fractal heightmap generation algorithm I'm using is essentially the recursive diamond-square algorithm. It appears to run to…
Matt Warren
  • 669
  • 8
  • 18
0
votes
1 answer

WebGL terrain grid shrinking after 128 pixels

I'm working on a heightmap algorithm using webgl. I thought I had it working but I realised a critical problem with my grid generation. If I set my grid size > 128 iterations, something strange happens: the grid stops growing on the z axis and I end…
alx
  • 71
  • 8
0
votes
1 answer

Mapping Heightmap to "Chunks" of Quadrilateralized Spherical Cube

I have a procedural planet generator in the works and my setup is I have a quadtree set up that splits the six faces of the cube into smaller, manageable quads. As the camera approaches the terrain, these quads split and as it recedes away from…