3 ms·
You can still fit that information into one byte and convert it at compile time or runtime :) In a minecraft clone I made, each chunk consists of 16 subchunks
by _gabe_ 4y ago
You can still fit that information into one byte and convert it at compile time or runtime :)
In a minecraft clone I made, each chunk consists of 16 subchunks so that I only need 12 bits to represent the block position in the shader. Technically, the block position ranges from INT32_MIN -> INT32_MAX, but since each subchunk only consists of 16x16x16 blocks I can get away with storing the position in 12 bits and then passing in the subchunk's world position once as a uniform.