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
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
This thing absolutely rocks
Thank you a zillion!
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![]()
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
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
Nice shader!!! is it possible for you to add antialiasing on edges?
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.![]()
Extremely late to this thread; but thank you so much! These are amazing shaders...