Search Unity

  1. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  2. Unity 2017.2 is now released.
    Dismiss Notice
  3. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  6. Unity 2017.3 beta is now available for download.
    Dismiss Notice

How to create the same realistic car effect in CSR Racing?

Discussion in 'Editor & General Support' started by tapiocaflash, Jul 6, 2012.

  1. tapiocaflash

    tapiocaflash

    Joined:
    Jun 19, 2012
    Posts:
    9
    I've downloaded and saw the realistic graphic in the recently released CSR Racing iphone/ipad title: http://itunes.apple.com/sg/app/csr-racing/id469369175?mt=8

    Am wondering how to achieve the same car rendering effect? Do you think all the reflection/glossy effects are done in real-time? If not what is the technique used to achieve the same effect? This is definitely beyond simple cubemap and this is in a mobile platform, so I am wondering what are the tricks used to achieve such a realistic graphics for cars. Note there are 2 main scenes where the cars are rendered ultra-realistic - one is in the racing mode whereby the surroundings are being reflected off the car body and another is in the typical studio light setup scene (where you pick and buy the cars using coins).

    Can anyone in the know shed some lights on how to achieve the same effect using Unity?
     
  2. tapiocaflash

    tapiocaflash

    Joined:
    Jun 19, 2012
    Posts:
    9
  3. Aras

    Aras

    Graphics Plumber Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,523
    Wild guess: have several premade cubemaps, and switch between them for the reflection.

    If you want fancier, blend between two closest cubemaps so that you don't get a "pop" when switching them.
     
  4. gfoot

    gfoot

    Joined:
    Jan 5, 2011
    Posts:
    548
    With the limited camera angle and repetitive environment lighting, perhaps they can use a constant images for the left and right faces of the cubemap (relative to the camera) and scroll the UVs on the other four faces according to the camera's X coordinate. You probably wouldn't notice the discontinuities. They can also stretch the cubemap longitudinally to reduce the amount of the car that reflects the unanimated front and back faces.

    Otherwise, bend the cubemap samples and rely again on repetitiveness (or as Aras said, switch to the next cubemap after a while - but I doubt they have the memory for that on iOS).

    I'm probably going for a curry with one of them tomorrow night, maybe I'll ask. :)
     
  5. wbronchart

    wbronchart

    Joined:
    Sep 5, 2012
    Posts:
    2
    Hi,

    I wrote the shaders for the cars on CSR. There's nothing really fancy going on there, just cheap trickery :)

    We have specific shaders for the race environment. For the reflections it has:

    1. A cubemap. It's a custom made texture that repeats nicely. We rotate the reflection vector in the shader depending on the car speed. This helps giving the car moving reflections.

    [​IMG]

    This looks ok on the bonnet, but on the side of the car it looks odd (because the cubemap is rotating the wrong way). We want it to scroll sideways over the car. So we don't want any of the cubemap reflections there. On the side we have:

    2. A repeating texture projected onto the side of the car that scrolls along.

    [​IMG]

    The second set of UV's is created from a top-down view on the car, flattened depending on height. This is done in the vertex shader.

    Hope this helped you!

    Waldo
     
    VictorCashDaShi, D4N005H and colin299 like this.
  6. HolBol

    HolBol

    Joined:
    Feb 9, 2010
    Posts:
    2,854
    That is genius.
     
  7. Wolfos

    Wolfos

    Joined:
    Mar 17, 2011
    Posts:
    705
  8. wbronchart

    wbronchart

    Joined:
    Sep 5, 2012
    Posts:
    2
    Yes, I did try that as a quick test. I rendered out a cubemap each frame, but mobile is just not powerful enough to do that (obviously). That's because you're essentially rendering to texture 6 times to create a cubemap.

    There's an other technique that just requires 2 renders to texture. It's called "Dual-Paraboloid Mapping". Here's a great article explaining what it is: http://graphicsrunner.blogspot.co.uk/2008/07/dual-paraboloid-reflections.html
     
    Last edited: Sep 6, 2012
  9. centralvox

    centralvox

    Joined:
    Oct 16, 2012
    Posts:
    7
    any tutorials abt Dual-Paraboloid Reflections..?
     
  10. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    650
    We added new feature with scrolled enviroment into our Car Paint Mobile Shader PRO. Its made with different approach (triplanar texturing but effects can be the same)
     
    JamesArndt likes this.