weBIGeo / webigeo

Rendering system for weBIGeo.
GNU General Public License v3.0
4 stars 0 forks source link

Tile access per tile id from shader #18

Closed pkomon-tgm closed 4 months ago

pkomon-tgm commented 6 months ago

For rendering overlays, it is necessary to determine whether there is an (overlay) texture available for a given tile to be rendered. For the compute pipeline, there will be cases where it is necessary to access neighboring tiles or even farther away tiles.

Therefore we want a generic solution that allows GPU shader code to lookup up available tile data by tile id.

One possible solution would be to have a hash map that maps tile-id to texture array index (or to a struct holding more than one index, if needed).

pkomon-tgm commented 6 months ago

On his fork, @adam-ce already implemented a hashmap for texture array index lookup. The hashmap uses a 2d texture for collision handling and one for actual lookups. The use of textures here is necessary because AlpineMaps uses OpenGL 3.3 Core, but storage buffers were only introduced in 4.3.

We will adapt this hashmap implementation for webigeo, but replace the texture with a storage buffers (probably slightly faster random access and no hash->u,v conversion).

pkomon-tgm commented 6 months ago

Implemented basic storing and clearing of hashmap entries in GPU storage buffer (50aeb89)

Next steps:

pkomon-tgm commented 4 months ago

Has been implemented for some time now, finally used in compute pipeline to calculate correct normals (0ca950cc225809c9a0f63a92dbdf6c5c8f766a7f). Closing this.