User Tag List

Results 1 to 8 of 8

Thread: Convex Quadrilateral pixel shader

  1. #1
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,341
    Mentioned
    16 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,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    This thing absolutely rocks

    Thank you a zillion!

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    5 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
    Forum Moderator

    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,760
    Mentioned
    12 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
    Location
    UK
    Posts
    1,341
    Mentioned
    16 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,306
    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.

  8. #8
    Clicker Fusion 2.5 (Steam)Android Export Module (Steam)

    Join Date
    Mar 2018
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Extremely late to this thread; but thank you so much! These are amazing shaders...

Similar Threads

  1. Request pixel shader "Convex polygon"
    By SEELE in forum Hardware Accelerated Runtime
    Replies: 33
    Last Post: 4th August 2013, 10:17 PM
  2. Tilemap Pixel Shader (aka "texture atlas" shader)
    By MuddyMole in forum Hardware Accelerated Runtime
    Replies: 3
    Last Post: 10th May 2013, 08: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, 01:28 PM
  4. Sub-Pixel Positioning Pixel Shader
    By LazyCoder in forum Hardware Accelerated Runtime
    Replies: 15
    Last Post: 16th March 2008, 11:24 AM
  5. Pixel Shader Help
    By LazyCoder in forum Hardware Accelerated Runtime
    Replies: 15
    Last Post: 11th January 2008, 06: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
  •