User Tag List

Results 1 to 7 of 7

Thread: Convex Quadrilateral pixel shader

  1. #1
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,305
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)

    Convex Quadrilateral pixel shader

    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.



    Download: Quad.zip

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    This thing absolutely rocks

    Thank you a zillion!

  3. #3
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)
    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

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,730
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Most things are simple, but to make themselves seem more important they try to out do Einstein.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  5. #5
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,305
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    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: http://1drv.ms/1SggQD1

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module

    Join Date
    Nov 2011
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice shader!!! is it possible for you to add antialiasing on edges?

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    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.

Similar Threads

  1. Request pixel shader "Convex polygon"
    By SEELE in forum Hardware Accelerated Runtime
    Replies: 33
    Last Post: 4th August 2013, 11:17 PM
  2. Tilemap Pixel Shader (aka "texture atlas" shader)
    By MuddyMole in forum Hardware Accelerated Runtime
    Replies: 3
    Last Post: 10th May 2013, 09:21 PM
  3. Can any one get the pixel shader to wok?
    By SEELE in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 11th August 2008, 02:28 PM
  4. Sub-Pixel Positioning Pixel Shader
    By LazyCoder in forum Hardware Accelerated Runtime
    Replies: 15
    Last Post: 16th March 2008, 12:24 PM
  5. Pixel Shader Help
    By LazyCoder in forum Hardware Accelerated Runtime
    Replies: 15
    Last Post: 11th January 2008, 07:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •