m.grl icon indicating copy to clipboard operation
m.grl copied to clipboard

Height Maps

Open Aeva opened this issue 11 years ago • 0 comments

issue revised 2017-02-25 Some ideas for height map implementation:

  1. ~~Generate a flat but thoroughly tesselated surface, possibly a square grid of non-fixed size.~~ done!
  2. This surface would always be rendered centered on the XY axis (eg, apply no world matrix), with maybe a mod offset to prevent jitter as characters move around. The vertex shader would be responsible for displacing the vertices according to the information stored in a texture or overrided with a plugin function.

One advantage of rendering heightmaps this way would be that noise could be applied to the image data so as to stretch it appealingly over much larger distances than would be practical to store, eg for terrain. But also by making them programmable, they could be used to simulate water.

Another advantage is not having to concern so much with level of detail, or partitioning the world; the size and density of the actual mesh is configurable, and I think with blending out to a cube map and/or use of atmospheric effects, this should be fine for a lot of cases.

Main disadvantage is that it puts a requirement on the vertex shader to actually implement. This might just be done as some kind of general purpose vertex deformation hook in the standard shaders + an include for support code. A warning could be thrown if this is not present when a heightmap is used.

Maybe in the future (eg #250, or whenever I go off the deepend with the glsl compiler stuff), there will be a better solution for managing this.

Aeva avatar Mar 07 '15 23:03 Aeva