Home Technical Talk

Unreal 4 Car Paint Shader

I'm coming from lots of Unity experience but relatively no shader experience especially with these networks or nodes.

Jumping into Unreal 4 and the basic PBL setup (Diffuse, Roughness, Metallic) what can I do to try and push more realism? Also this may be a good opportunity for other people to learn as well?

I know there are quite a few parameters like adding fresnel or noise, I'm looking for something similar to the VRay Car Paint Setup. Any info or help to get me going or any specific nodes to use (all i have are constants) would be great

A06RfMP.jpg

AhPF9Ny.png


Examples
section6_paint4_004.jpg

screen1.jpg?1251118764

Replies

  • Jacky
    Offline / Send Message
    Jacky polycounter lvl 6
    Get a Lerp node(hold L and click on the canvas) and a Fresnel. Plug Fresnel into alpha of the Lerp and two of your colors into A and B and plug Lerp to Diffuse, then tweak fresnel values until you get the looks you want.
  • Shift`
    I threw something quickly together, use the exponentIn to control the amount of Edge Bias.

    CarMaterialBase.PNG
  • ZacD
    Offline / Send Message
    ZacD ngon master
    The important thing about car shaders is making it look like the material has 2 layers, it has really sharp reflections and then blurred "sparkly" reflections. I'm not sure there's an easy way to do that with UE4s materials.
  • haiddasalami
    Offline / Send Message
    haiddasalami polycounter lvl 14
    Take a look at Forza's material talk at GDC for a bit more advanced look at car paint shaders. Theres some code there if I remember correctly from attending the talk. Was a good talk about their material system.
  • Jacky
    Offline / Send Message
    Jacky polycounter lvl 6
    Yeah, thats about it. You can also use fresnel to get different roughness/metallic values at different angles. You may want to use a noisy normal map and use its red and green channels for roughness to achiever that kind of sparkly reflections.
  • almighty_gir
    Offline / Send Message
    almighty_gir ngon master
    question:

    why would you add fresnel like that? it's already incorporated into the brdf.
  • /anty/
    Offline / Send Message
    /anty/ polycounter lvl 7
    Normally you need to have two layers. Base and clearcoat layer. Haven't tried yet but I guess will work. At leas I had it like that in UDK)
    Base layer needs to be with roughness aground 0.5, might have metallic input ( 0.5)
    Second "Top" layer needs to be the same as previous shader but with really low roughness and probably higher level of reflecivity ( 0.8- 1.0).
    Blend both layers linearly ( you can try to multiply lerp mask on fresnel)
    In theory this will recreate physical existence of car paint.
    As well you may try to ad some SSS to coating layer ( seen some samples for Arnold render, they used SSS with really low value on car paint, not sure that it will work, but worth to try))
  • BARDLER
    Offline / Send Message
    BARDLER polycounter lvl 12
    question:

    why would you add fresnel like that? it's already incorporated into the brdf.

    To fake the effect of two tone car paint.
  • almighty_gir
    Offline / Send Message
    almighty_gir ngon master
    this is why i don't make cars :D
  • curzed
    Awesome! Okay so I went ahead and added the fresnel and it already looks much better. I will try next adding normal map red and green channels as well as research Forza's GDC talk though I'm not much of a coder, it will still be useful.


    czoLNOV.jpg

    JZhcdfJ.jpg

    PZPvW1S.png
  • curzed
    Added normal map red and green channels for subtle noise, having issues with getting it show up more though. Its a 4096 texture with no mipmapping, what else can be done?

    yqJdMdr.jpg

    mGUHQGP.jpg

    jlzWNAl.jpg

    ZWNTxGc.png
  • curzed
    /anty/ wrote: »
    Normally you need to have two layers. Base and clearcoat layer. Haven't tried yet but I guess will work. At leas I had it like that in UDK)
    Base layer needs to be with roughness aground 0.5, might have metallic input ( 0.5)
    Second "Top" layer needs to be the same as previous shader but with really low roughness and probably higher level of reflecivity ( 0.8- 1.0).
    Blend both layers linearly ( you can try to multiply lerp mask on fresnel)
    In theory this will recreate physical existence of car paint.
    As well you may try to ad some SSS to coating layer ( seen some samples for Arnold render, they used SSS with really low value on car paint, not sure that it will work, but worth to try))

    I will try this next thanks! How do I get two layers going?
  • Jacky
    Offline / Send Message
    Jacky polycounter lvl 6
    Use the Fresnel calculation for roughness as well. Then plug that Add of the normal noise to A and a constant of 0 for the B. You may want to consider multiplying(or Lerping 2 roughness values by using it as a mask again) that noise with a higher value if you want to increase its effect, btw.

    Also, i don't think UE4's SSS is suitable for coating or car paint.
  • kalmax
    hello wanted to know how to create this material in udk 3
  • kalmax
    hello wanted to know how to create this material in udk 3
Sign In or Register to comment.