Search Unity

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

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    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:
    550
    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.



    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.



    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
     
    blueivy, mehradfarzi, mulova and 3 others like this.
  6. HolBol

    HolBol

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

    Wolfos

    Joined:
    Mar 17, 2011
    Posts:
    951
  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:
    707
    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.
  11. zero_null

    zero_null

    Joined:
    Mar 11, 2014
    Posts:
    159
    It's really impressive even in 2018.
    The real time reflections are really slow on mobile. Even custom cubemap in reflection probe or baked has also some issues.
    Are there some new and easy ways to do in the latest version of Unity? Also the Car Paint Mobile Shader isn't available anymore on the Unity Asset Store.