Use a uniform to shift chunks #1

Open
opened 2022-10-22 20:41:31 +02:00 by Benjamin_Loison · 1 comment
Owner

To keep index only vertice representation (using 4 bytes per vertex), it requires to know which range of indexes are in which chunks. This can be done with an array of not repeated chunks. However passing this non constant size array as a uniform doesn't work.

However glium has an example which seems to use what we are looking for.

For the moment we use a plain vertice representation using 8 additional bytes per vertex.

Could similarly use a uniform to provide normals and biomes as only one of three normals, as far as I know, and one of four biomes are useful. However maybe uniform is overkill for this purpose.

To keep `index` only vertice representation (using 4 bytes per vertex), it requires to know which range of `index`es are in which chunks. This can be done with an array of not repeated chunks. However passing this non constant size array as a `uniform` [doesn't work](https://gitea.lemnoslife.com/Benjamin_Loison/LemnosLife_Rust/src/branch/uniform_chunk_shift). However glium has [an example](https://github.com/glium/glium/blob/3e143cf95f3c990f82e8aeeb170b15b339b23025/examples/gpgpu.rs) which seems to use what we are looking for. For the moment we use a plain vertice representation using 8 additional bytes per vertex. Could similarly use a `uniform` to provide `normal`s and `biome`s as only one of three normals, as far as I know, and one of four biomes are useful. However maybe `uniform` is overkill for this purpose.
Benjamin_Loison added the enhancementepiclow priority labels 2023-04-01 13:11:19 +02:00
Author
Owner
Cf https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Arrays
Sign in to join this conversation.