• 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!

Legacy GM [SOLVED] Vertex Buffer Transparency

Anixias

Member
Hello. I am using vertex buffers and chunks to render an "infinite" randomly-generated world. For my water texture, I include dirt and a transparent floating blue plane above it. When the game submits the vertex buffer, however, it produces the following result:

As you can see, the water has a weird checkered effect. I know why, but I don't know how to fix it. When the vertex_submit function is called, the transparent water overwrites the triangles already there, rather than blending the alpha. I tried implicitly using the bm_normal blend mode, but it didn't help. Any ideas?
 

Mike

nobody important
GMC Elder
Its kinda hard to tell from a picture, but my "guess" would be your either generating overlapping polys at the edges - which would result in a darkening with the dark alphas adding together, or your water texture is bleeding into other textures and showing some texels from another image.
 

Anixias

Member
I know what's happening; this is my water texture:

The transparent part of the water should overlap the tiles above this one, yet it doesn't blend. It is like using the "replace" option on brushes in the sprite editor. Is there any way to fix this? Thanks.
 

Mike

nobody important
GMC Elder
Do you have a ZBuffer enabled? You need to build all "opaque" stuff first, then build the water, that way it shouldn't interfere.
 

Anixias

Member
So should I split the water texture into just the dirt on the bottom, and then water as a separate tile, and just loop back through the water tiles and draw the water part of the texture?

EDIT:
I haven't implicitly changed ZBuffer, so it should be true by default.

EDIT:
Solved. I just separated the dirt and water in the texture, drew the dirt, then drew the water as a different texture.
 
Last edited:
Top