Convex Quadrilateral pixel shader

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • This is a pixel shader I made for Schrodinger, which deforms a texture to the shape of any convex quadrilateral.
    It's similar to Werbad's 3D shader, but doesn't require that any two edges be parallel.

    Please login to see this picture.

    Download: Please login to see this attachment.

  • Very nice job! I was never able to figure out the math for this. The Internet was pretty useless because it gave me huge sources that were way too complicated for a shader. I'm amazed that it's so simple after all.

    EDIT: Ooh, I thought that's perspective transformation. Whoops! I'm not AS impressed then :D

    Please login to see this link.

    Edited once, last by Looki (August 11, 2016 at 8:22 PM).

  • Thanks :)
    I don't really understand the maths behind it myself, but I eventually found a couple of code examples online that could be combined easily enough in a shader.

    I've also made a slightly improved version, which now includes all the features from Werbad's 3D shader (incl. texture offsets and lighting effect).

    Download: Please login to see this link.

  • Just give the image an alpha channel and a 1-pixel border, and you're all set, copperbob, though do note that it's not exactly the best smoothing ever, unless you also make the edges a bit semi-transparent. :)

    My Please login to see this link. (which I actually use), my Please login to see this link. (which I mostly don't use), and my Please login to see this link. (which I don't use anymore pretty much at all really). If there are awards for "'highest number of long forum posts", then I'd have probably won at least 1 by now. XD

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!