• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Shaders Custom Vertex Buffer

I was watching this voxel video and how to optimize the amount VRAM used with OpenGL. In the video, each chunk has 32x32x32 blocks so only 6 bits are needed per dimension (18 bits in total).

Now I was wondering if there is a smart way of storing these values into a vertex buffer in GMS. I was thinking we could use one of the built-in vertex formats and pack multiple information into one vertex data. But is there a better way like actually creating a vertex buffer with three 6 bit data?

I might be asking too much from GMS
 
You know what, I'm really dumb and sleepy (I usually don't post questions before solving it myself) It appears there's a function called vertex_format_add_custom(). I don't know how I missed that.

However, it still doesn't provide the 3 6 bit data I wanted but I think that's really asking too much. I mean who thinks of storing 6 bit data? XD

Anyways, if anybody has some bright ideas, just let me know. If not, I'll just use vertex_format_add_custom()
 

vdweller

Member
Unfortunately GM is a memory hog in all regards. The best I could manage is pass coordinates and size of a UI button in a shader encoded in color values (32 bits) but that's as far is it goes I'm afraid and there are rounding errors due to the horrible floating point format (which isn't GM's mistake btw)
 
Top