Z
Zephyr Schwarzwolf
Guest
Hi GMC !
For my top-down game, I'm using a Z-Tiling shader for depth sorting. The method is the same used by Ariak in this tutorial.
For some reasons, few sprites are not tilted on the same angle (probably because "visible" images don't use all available pixels on every frames. Moreover, I set the origin on the bottom of the "visible" image, not on the bottom of the sprite itself) I don't really want to change that. My animations are more definites and it works perfectly for collisions.
Anyway, the major issue is that the alpha channel has to be piggybacked for the shader to work...
It causes a difficulty to use image_alpha, makes all tilted sprites full opaque, and limits sprites height to 255.
So, I'm searching for a system where I wouldn't be forced to use the alpha channel to encode the height of my sprites.
I would like to replace that "col.a" by another thing... But what ? Obviously, I can't just use sprite_height (It would be so great...)
I saw somewhere that it would be possible to use vertex buffers to replace the alpha technic ? But I don't know how to deal with them in that case...
Thank you in advance.
For my top-down game, I'm using a Z-Tiling shader for depth sorting. The method is the same used by Ariak in this tutorial.
For some reasons, few sprites are not tilted on the same angle (probably because "visible" images don't use all available pixels on every frames. Moreover, I set the origin on the bottom of the "visible" image, not on the bottom of the sprite itself) I don't really want to change that. My animations are more definites and it works perfectly for collisions.
Anyway, the major issue is that the alpha channel has to be piggybacked for the shader to work...
It causes a difficulty to use image_alpha, makes all tilted sprites full opaque, and limits sprites height to 255.
So, I'm searching for a system where I wouldn't be forced to use the alpha channel to encode the height of my sprites.
Code:
float top = 1.0-mod( col.b * 255.0, 2.0); // upper vertex
object_space_pos.z -= 255.0*col.a*top; // z-tilting
object_space_pos.y += col.a/10.0; // z-fighting
I saw somewhere that it would be possible to use vertex buffers to replace the alpha technic ? But I don't know how to deal with them in that case...
Thank you in advance.