Search Unity

"Cool camera effect" - how was it done

Discussion in 'General Discussion' started by yuriythebest, Aug 7, 2012.

  1. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,125
    This is from an obscure game I found called "Subway Surfer"



    My assumption is that they used a wide FOV, perhaps some fish eye shader, and also that the track itself is bent and not straight
     
  2. Khyrid

    Khyrid

    Joined:
    Oct 8, 2010
    Posts:
    1,790
    Looks like fish eye effect.
     
  3. ddeaco

    ddeaco

    Joined:
    Jan 17, 2012
    Posts:
    44
    One way would be to use render to texture then apply that texture to a curved surface.
     
  4. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,834
    It's a pretty good game.

    I wonder if in their shaders when they pull in the Z coord, maybe they do some kind of math on the coordinate before passing it on to the fragment shader, that causes the Z location to be squeezed?
     
  5. Acumen

    Acumen

    Joined:
    Nov 20, 2010
    Posts:
    1,041
    You can find some of the wonderful assets in this thread as well as a tiny line about how they made the bend
    http://www.polycount.com/forum/showthread.php?p=1595445

     
  6. gfoot

    gfoot

    Joined:
    Jan 5, 2011
    Posts:
    550
    You'd need a reasonable amount of tesselation too. It doesn't matter what maths you do in your vertex shader, triangle edges will always be straight lines on-screen. So if you want your train tracks to be curved, you need lots of triangles on them.
     
  7. yuriythebest

    yuriythebest

    Joined:
    Nov 21, 2009
    Posts:
    1,125
    so would that be a camera shader or is it a special shader that actually bends the objects and must be applied to all geometry?
     
  8. tomvds

    tomvds

    Joined:
    Oct 10, 2008
    Posts:
    1,028
    Every shader of every object would need a custom vertex program that performs the bending.
     
  9. Acumen

    Acumen

    Joined:
    Nov 20, 2010
    Posts:
    1,041
    you know what these guys/devs are supecool and helpful human beings why don't you just send a polite email asking the same exact questions. I'm sure they might be able to help and/or guide you in the right directions. Worth a try for sure :)

    Also another thread over at polycount discussing the same issue, I believe. Often unity related even !
    http://www.polycount.com/forum/showthread.php?t=95951
     
    Last edited: Aug 8, 2012
  10. Devilbox-Games

    Devilbox-Games

    Joined:
    Jul 3, 2012
    Posts:
    205
    Someone produced a tutorial detailing Deathspank's rolling world effect a while back, it was for XNA but as the actual effect is shader based it should be easy to do in Unity. After spending a while searching for it, through numerous dead links and closed sites, I found it:

    http://www.madgamedev.com/2010/09/article-rolling-world-tutorial/4/

    It looks like there could be some horizontal distortion in that subway surfer game too, I would assume the effect could be altered to handle that too.
     
  11. spinaljack

    spinaljack

    Joined:
    Mar 18, 2010
    Posts:
    992
    Anyone know where I can find such a shader? That tutorial link seems to be dead.
     
  12. SQR

    SQR

    Joined:
    Jun 29, 2010
    Posts:
    10
  13. Berenger

    Berenger

    Joined:
    Jul 11, 2012
    Posts:
    78
  14. diekeure

    diekeure

    Joined:
    Jan 25, 2013
    Posts:
    221
    frosted and SunnySunshine like this.