Car material changes

Discussion in 'Car Modding' started by Johannes Rojola, May 26, 2012.

  1. Johannes Rojola

    Johannes Rojola Registered

    Joined:
    Sep 8, 2011
    Messages:
    1,038
    Likes Received:
    38
    I started this thread for studying and following common car material changes from build to build. I have pretty good test subject car, which has mixed mess of chrome, paint and even leather in its main body.

    For seeing Build85 in action, you have to re-export all GMT's. Also make sure you have newest Coreshaders and ISI plugins in your 3DS Max.

    Major change:
    Cubic/environmental reflections doesn't work like they used to. Full white in your alpha layer doesn't give full reflective chrome, it gives sort of milky finish like in this example:

    [​IMG]

    I am now starting to figure out which numbers to alter so I can get it to somewhere what it used to be.
     
  2. Johannes Rojola

    Johannes Rojola Registered

    Joined:
    Sep 8, 2011
    Messages:
    1,038
    Likes Received:
    38
    Update: your cube map fresnel properties are the key to control the reflectiveness. It might be that you need to change your alpha layer for better results.
     
  3. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,827
    Likes Received:
    611
    Excellent thread for me, have you recomanded value on the materials of the body. I'm a beginner on this part, and I need some references.

    I exproted again my car with the build 85 shader, and the results is not good for me.
    So I need to make darker my alpha channel of my Body to match to a more real render? Or need only to play with cube map fresnel properties of my body material? (if you have a value, it will help me a lot :) )
     
  4. Johannes Rojola

    Johannes Rojola Registered

    Joined:
    Sep 8, 2011
    Messages:
    1,038
    Likes Received:
    38
    For the such alpha layer like you see in my picture, I have now used following cube map fresnel numbers:

    min 0.1
    max 1.0
    exp 8.0

    Note! Reflections work only with HDR enabled and on tracks which have reflection maps set correctly, like in ISI tracks. I haven't tested in Joesville yet, but it has always been pretty buggy so I wouldn't suggest using that. For other tracks, game uses custom cube maps but the end result is pretty bad...

    Showroom seems not to be supporting HDR, so you can't really tell how you car looks from that.
     
  5. MaD_King

    MaD_King Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,827
    Likes Received:
    611
    Ok, thank you, I will test this.
     
  6. vicent-sollana

    vicent-sollana Registered

    Joined:
    Jan 21, 2012
    Messages:
    416
    Likes Received:
    17
    I´m going to test now,thanks.
     
  7. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    exp 8.0 seems rather high - may look too much like a silhouette/contour shader. I've always been using something between 4.0 and 5.0.
    Also, Ive noticed that materials without normal map will have fresnel calculated per-vertex rather that per-pixel. This may produce bad results for models with low tesselation and high fresnel exponent.

    Min / Max makes sense, but I'd use lesser max value - around 0.95 perhaps?

    EDIT:
    I've noticed that Cube Map T1 shader works as expected, with per-vertex calculated fresnel reflections. Hovewer, Tried the same object with "Bump Cube T1" and "Bump Cube Add Alpha Reflect T1" shaders and I got full reflections despite identical fresnel settings.
    I've used flat normalmap (128, 128, 255) - my goal was to see if fresnel will be calculated per-pixel for materials with a normalmap.

    [​IMG]

    Also, on upper image you can see reflectivity changes on the edge when I move the camera. I've used min=0.02, max=0.95 and exp=4.5
    With even higher exponent this effect of uneven reflections at edges at different camera positions will become even stronger. It exists also with per-pixel fresnel on poorly tesselated models, but is more apparent when using per-vertex fresnel and high exponent value.

    High exponent makes reflection rate non-linear comparing to viewing angle, while per-vertex fresnel will interpolate linearily between nearest vertices, therefore adding to allready existing inacurracy of the model.


    If I would increase polygon count on that cylinder 2 times, I would be unable to say if it's per-vertex or per-pixel fresnel :) Cylinder has only 18 quads, which gives 20 degrees on each edge.
    When looking at object from a bit further away I wouldn't be able to distinguish that aswell.
    Only closeup shots, when tesselation starts to be insufficient, reveal such things.


    EDIT2:
    Oh yeah, forgot to mention I only tested in Dev Mode, so screenshots are from Dev Mode aswell. I'm only experimenting with various stuff, so I keep it all in Dev Mode - not porting anything to game itself.
     
    Last edited by a moderator: May 27, 2012
  8. Johannes Rojola

    Johannes Rojola Registered

    Joined:
    Sep 8, 2011
    Messages:
    1,038
    Likes Received:
    38
    Yes the exp value is something I have not yet made my mind of. I tried 4-5 and the end results might start to look too reflective/shiny or something, but yes 7-9 is definitely a maximum. Of course the shades of the alpha map starts to come into play too. I could maybe go with 6 :D

    This is the current difference between HDR off and on, it is quite massive difference. E.g. chromes die almost completely.
    [​IMG]
     
  9. Tuttle

    Tuttle Technical Art Director - Env Lead

    Joined:
    Feb 14, 2012
    Messages:
    2,480
    Likes Received:
    775
    Total chaos...:)

    It's really mental to understand what is working, what is broken, what is my fault, what it isnt....:/

    It seems very difficult to obtain proper reflections using alphas and fresnels, as I've to export almost total black alphas to manage a proper reflection with very low fresnel values and sometimes fresnel generates white jaggies around objects...as you can see in other titles like Shift and pCARS...

    Another stuff I'm interested for, is how to work with object with different opaque/reflective parts, like a chrome gear knob mounted on a black opaque steel lever that are sharing the same texture. I've reflections and/or similar self emissive effects in every cubemap shader, even though on total balck alphas for opaque parts and with cubemap blends near to zero.

    Honestly I do not understand how to manage alphas to control reflections...and another issue is that devmode do not read reflection fresnel values from shaders, starting everytime with standard values.

    BTW, the awful self emissive effect in underexposed areas is always present, everytime I try to use the new reflection system...I think we need proper shadowmaps....
     
  10. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    No, that's something people need to deal with in their models.
    For example - air intake. You need to make specular map darker there to decrease reflections. The reason for this is that in reality you also have self-reflections.

    Check out this screenshot:

    [​IMG]

    Look at areas I marked - sky is reflected there. In reality, car's own reflection would be seen there.

    This has nothing to do with shadowmaps - reflections in rF2 are visible in shadows with exactly the same strength and that's proper. Shadows do not affect reflections.

    Since we do not have self-reflections in games (which would require raytracing or other heavy techniques), artists must "hunt" for such areas themselves and darken specular maps to limit reflections. It's a compromise but at the moment it's the only solution we have.
     
  11. Tuttle

    Tuttle Technical Art Director - Env Lead

    Joined:
    Feb 14, 2012
    Messages:
    2,480
    Likes Received:
    775
    Thanks K, very usefull infos...but I'm already using dark speculars on my actual project and this doesn't solve at all.

    I've a total black car and I've tried various solutions that seems not helping too much. I've tried flat speculars just to test..without solving. I've tried faked darkest AO with supersampling used as speculars and did not solve. I've tried various chopped solution but nothing changes....

    The car, and every part inside the cockpit, have a sort of self emission effect when the car is underexposed under a total shadow, but the reflection re-start looking fine on full sunlight. The most dramatic effect is for pure chrome parts...

    You can see the same issue in every ISI stock content...so I do not think is just me. :)
     
  12. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    Well I guess we need to wait for the shaders to get more mature.

    Specular maps should control all reflections, not just specular reflections. There's just no point in specular maps to control one effect if environment reflections and specular lighting are actually the same thing in real world.

    Specular reflection is just one extremely bright point on the cube map - the Sun. Due to it's dominant nature it's additionally controlled by shadowmaps - that's why it's applied using different algorithm than the rest of reflections. But as far as material properties go, it should ultimately be controlled by the exact same parameters and teextures that environment reflection is.

    So fresnel should affect both in the same way, specular maps should affect both in the same way, and since we got specular power setting we should also have a setting to control cubemap blur (game engine should provide sharp environment reflection as well as several blurred ones).

    At this point, I believe shaders are half way there. Will rF2 graphics engine ever get "there" - I don't know. But I think we may safely assume it will change more than once in the future as ISI's programmers understanding of various topics evolves....
     
  13. Tuttle

    Tuttle Technical Art Director - Env Lead

    Joined:
    Feb 14, 2012
    Messages:
    2,480
    Likes Received:
    775
    Sorry but if you're talking about real life, this is not correct at all. Shadows AFFECTS reflections in real life..:)

    A mirror do not have nothing to reflect if there is no light in the ambient but if you look at rF2 cars into the night, they're reflecting something that simply it is not illuminated at all...this is why they seems self emissive.

    This beautiful 'Nismo shot shows exactely what i mean;

    [​IMG]
    [​IMG]
     
    Last edited by a moderator: May 27, 2012
  14. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    Shadow is a result of an obstacle in a straight line between sun and an object. This means that object does not receive direct illumination from sun, neither it relfects the sun. That's all.

    Good luck seeing a shadow on a mirror in real life :) Assuming there's no dust on the mirror, of course.
     
  15. Tuttle

    Tuttle Technical Art Director - Env Lead

    Joined:
    Feb 14, 2012
    Messages:
    2,480
    Likes Received:
    775
    This is not what I said. ;)

    If I've a chrome switch into my cockpit, in a total occluded ambient with any kind of incident light normals above it...it reflect the occluded (almost dark) ambient and it can't produce light itself. It can just reflect the real life as it is...Maybe just a little barrel of the sky above the car...

    Of course I'm not thinking at backscattering or general back diffusions...and/or heavy processes as GI.

    The problem I'm encountering is that the parametric fresnel effect seems to have a sort of light emission not easy to control (look at the car above in the shadow/backlight)...and of course I'm sure will be fixed in the future.
     
  16. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    Those are self-reflections I mentioned (something dark is reflected), not shadows.

    If you mean that shadows affect objects that are reflected, then of course yes. But shadows do not affect reflections themselves (reflectivity).
    If reflected object is in shadow it will appear darker on reflection because it is in shadow, but when reflecting object is in shadow, then it will not reflect other objects any less.


    This is something I mentioned in my bug report here: LINK - see description of bottom right screenshot at second image.

    While rendering to cubemap, rFactor2 uses no shadows on objects (or they don't work). That's why objects in reflection can be brighter than they actually are when you look at them.
    So you actually have brighter cubemap than surrounding environment therefore giving the impression that reflections emmit some additional light.

    So the fresnel shader may be ok, but it's given too bright objects on cubemap.


    I guess we misunderstood each other a little :) There are reflections (material properties) that are independent of shadows and then there are reflected objects (stuff rendered into cubemap) and their appearance on cubemap should match their actual appearance in the scene. If they're rendered into cubemap without shadows, then there will be mismatch, and that's what's currently happening in rF2.
     
    Last edited by a moderator: May 27, 2012
  17. Tuttle

    Tuttle Technical Art Director - Env Lead

    Joined:
    Feb 14, 2012
    Messages:
    2,480
    Likes Received:
    775
    Yeah! We're saying and pointing at the same thing...:)

    BTW, the thread you've linked is JUST PERFECT. It optimally describes what I'm encountering.

    I'm happy to see I'm not alone...:cool:

    Thanks for posting those fantastic reports that IMHO should be pinned as a reference informations source. :p
     
  18. Tuttle

    Tuttle Technical Art Director - Env Lead

    Joined:
    Feb 14, 2012
    Messages:
    2,480
    Likes Received:
    775
    Look at those chrome parts (CubMap Specular Map T1) - Gear knob/lever/switchs;

    As you can see there is no way (at this time...) to avoid the strange emissive effect when those parts are into the shadow.

    I'm going to make some test with old style faked reflection (supersampling pre-rendered reflections) to avoid this issue as it is really bad...

    [​IMG]
     
  19. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    Yeah, but in this particular case, even in sunlight this gear lever should not reflect environment, but interior of the car and some sky on top.
    And in shadow it should still reflect car interior... and some sky on top. That little sky reflection on top would look exactly like that - kinda "emissive" (look at the gear lever on photo below).

    And that is realistic. I'll tell you what the real problem is - other objects don't reflect sky in the same way and therefore this single reflective object, although proper, stands out. Give reflective properties to other objects in cockpit and it will no longer stand out:

    [​IMG]

    But you can't do that for two reasons:
    1. Lack of self reflections mentioned before - this can be countered by specular maps to some extent
    2. Reflections (cubemaps) in game are always sharp - you would need blurred versions of env. cubemap for some materials. If you look at steering wheel or dashboard on the photo above - they clearily reflect sky, but it's a very blurry reflection

    Just look at the brown panel of the gear lever - it reflects sky and car interior. In game it would reflect sky on it's entire surface - try to imagine that on this photo and it will look bad.
    In game you would have to darken specular map on half of that panel, but it would only work for a specific eye position in cockpit. So you can do that more less for the point where driver's head is.

    This is what we did here:

    [​IMG]

    Look at dashboard - there is sky reflection on it (we used very blurry cubemap). Now look at the right one of these two bars on front window - you will see it kinda has two shadows on dashboard.
    One goes more to the right - it's ambient occlusion painted into diffuse texture.
    The other one goes to the left - towards driver, but not exactly - it looks more like a reflection of this bar on the dashboard and that's the intention - it's painted on the specular map to mask all reflectivity on that area of dashboard - no sky reflection will look like some black object is occluding the sky there :) (luckily for us that bar is black so it looks more less ok)
     
    Last edited by a moderator: May 28, 2012
  20. Tuttle

    Tuttle Technical Art Director - Env Lead

    Joined:
    Feb 14, 2012
    Messages:
    2,480
    Likes Received:
    775
    Nice stuff man.

    I'm using almost same tricks for some parts, working more on textures (AO baking/SS pre-render reflections/pre-rendered speculars etc..).

    Very interesting the part of your post about blurred cubemaps to simulate the anisotropic reflectance...:p

    BTW, I've redone some texture renders for chrome parts and I think this is the right way to do the job...for now. :)

    [​IMG]

    PS: the barrel sky on top of the gear knob in my shots has been pre-rendered in a HDRI/GI environment...so the effect is forced by the texture itself..
     

Share This Page