Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1075932 Posts in 44152 Topics- by 36119 Members - Latest Member: Royalhandstudios

December 29, 2014, 04:14:38 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)How the hell did I do this?
Pages: [1]
Print
Author Topic: How the hell did I do this?  (Read 659 times)
QuadrupleA
Level 1
*



View Profile WWW Email
« on: September 04, 2013, 11:17:35 AM »

I'm trying to write a shader to do some trippy, psychedlic backgrounds - I have a warped photo of myself that I generated a while ago that has a similar pattern to what I want:



Problem is, it was done 3+ years ago and I have no idea how I did it. Smiley Pretty sure it was a shader, using a "mirror" UV addressing mode, but I don't know how to reproduce that "increasing repetitions going inward" type of thing. I want that kind of tesselated / fractal look. I've tried some polar coordinate system experiments, but not what I want so far (I get spiraling effects).

Assuming I'm drawing a fullscreen quad with UV coordinates from 0,0 to 1,1, and a single sampled texture to repeat (perhaps with mirrored sampling enabled) does anyone have any clues what the hell I did?

I was a lot less experienced with shaders than I am now, so I suspect it was something simple I stumbled on (a mapping to a different standard coordinate system perhaps). Not even sure I knew shaders, perhaps it was just some builtin fixed-function mode.
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #1 on: September 04, 2013, 05:03:58 PM »

Probably something along the lines of this http://www.iquilezles.org/www/articles/deform/deform.htm I think - Staple of old demos Smiley

If not, you'll probably be able to recreate it using that anyway.
Logged

eigenbom
Level 10
*****



View Profile WWW
« Reply #2 on: September 04, 2013, 06:52:51 PM »

Reminds me a little of Escher's print gallery..

Logged

QuadrupleA
Level 1
*



View Profile WWW Email
« Reply #3 on: September 05, 2013, 09:49:41 AM »

Probably something along the lines of this http://www.iquilezles.org/www/articles/deform/deform.htm I think - Staple of old demos Smiley

If not, you'll probably be able to recreate it using that anyway.

Cool! This one did it:

float u = cosf( a )/d;
float v = sinf( a )/d;

Thanks for the tip.
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #4 on: September 05, 2013, 03:58:17 PM »

No worries, glad I was able to help.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic