Hello,
I currently use a 4x4 transformation matrix within a vertex shader to skew (or is it shear?) my sprites. It works but it is also skewing the shape of individual pixels which gives a weird look to my pixel art.
Transformed by my current shader:
Transformed by Gimp’s perspective tool, notice the pixels are still square:
- What would be the best way of skewing
a sprites without affecting the pixel
shapes? - Is there a trick that could be used to correct the result of the vertex shader? Force all edges to be either vertical or horizontal? (that one is for you shader gurus… I know your out there!)
FYI I have also tried applying my transformation matrix to the texture coordinates but it’s giving similar results. I have also came accross an opengl article mentionning something about modifying the coordinates while doing something similar to a tex2d lookup but I didnt quite get it and lost the link
EDIT: Hey followers!
Ok, no definitive answer but there’s lots of people following this. How about a group brainstorm? Pitch in some ideas! No matter how far fetched it sounds just pitch it in, worst case it will serve to elimiate what doesnt/can’t work. Personally my shader knowledge is limited but im sure that as a group we can manage it! I’ll update this question with our R&D results as we go.
What doesnt work:
- 4x4 Transform matrix on the vertex also skew the pixel shape
- 4x4 Transform matrix on the texture coordinates also skew the pixel shape and causes the texture to move outside the sprite’s mesh, making parts of it disappear.