#Creating a volumetric height map

1 messages · Page 1 of 1 (latest)

gray cargo
#

I'm not sure if "volume" is the correct term for it.
What I have is a 2D region in space, the yellow area, which is where I generate Chunks. I want to solve the value for position.y to set the elevation of the terrain.

My idea is to give a Compute Shader this yellow region, dispatch the shader and it returns something like a volume that stores the height.
I dont know if it is important for the question, but there will be a chain of Compute Shaders, where the volume is given to each shader to mutate its height value in some way. (like combining multiple noise maps together)

When the dispatch ends and I create a Chunk, that Chunk can sample the space in the volume where the Chunk exists, so when its mesh is produced its points are vertically offset.

#

I dont think that something like a render texture would be right for this, because I'm not exactly making some kind of greyscale image for the heightmap.

I picture it more like some location within a scene, where if a chunk happens to exist inside, the chunk inherits the height value.
Plus, if a Chunk was to exist outside this region (not that this would really happen), theres no height which can be sampled, so the chunk would end up being flat at y=0

steep kiln
tulip phoenix
gray cargo
gray cargo
tulip phoenix
#

I don't know compute shaders that well, but it sounds like using a "chain" of them would not be great for parallelization

#

But it probably depends

#

Like, how many vertices do you need to offset
Do the resolutions / vertex densities vary per chunk or otherwise
How often do you need to re-generate a height map
Is the vertex density different in some situations from the height map resolutions or do vertices always map one to one to height map pixels

#

Sometimes sampling even complex noise is better to do on the CPU if there aren't that many points to sample, and if it isn't efficient to generate a whole height map just for them