#Two sprites with slightly transparent color at same z-index -- guarantees around displayed color?

6 messages · Page 1 of 1 (latest)

cyan blade
#

I render some sprites on some tiles. There are red sprites and blue sprites. The sprites are just default sprites with their color defined and the color is semi-transparent. The sprites have the same z-index.

I was expecting the output to look visually consistent with itself, but that's not what is happening. It looks like sometimes the red sprite renders above the blue sprite and sometimes below - presumably due to instability in render ordering.

I don't think it's possible to affect the blend mode while using this simplistic approach, right? I would need to change to using a MaterialMesh so that I can set alpha_mode? And that approach would not be compatible with bevy_ecs_tilemap, right?

Thanks

shut radish
#

Humm the z index is what allows you to control the ordering of the drawing. So if two sprite have the same z it's not determined which will render first just offset the one you want to be on top

#

Think of it as if looking from the top with a camera an the z index acts as different layers in the depth of the camera

cyan blade
#

Yeah, I'm aware, they just have equal priority. I'm not going to create N different layers for each type of pheromone that could be placed on a spot. I was hoping the fact that one was spawned after the other would give a semi-stable rendering output

#

but in the screenshot all of the red tiles were spawned first and now the ant is in the process of spawning the blue tiles as it walks back across them

#

but there are two red tiles with blue on either side of them. Ultimately I'd prefer to blend the colors, but, barring that, it would be nice to tell a more visually consistent story