Interesting post from AnswerHub on how to setup a Layer Car Paint shader

is a worth taking a look if you’re looking at doing any types of vehicles or interesting shaders.

Take a look and please add to it here if you like.

Stimpanzee improved it nicely in the final image. :slight_smile:

Just to be clear, those values in the material setups were used to show the effect that can be achieved with fresnel and cosine so the user needs to tweak them until they get the looks they are after.

Hello everyone!

It’s been a while since I had some quality time to sit down and improve my car paint shader. Since my last post, I have dumped the concept of using a transparent material using separate geometry. Transparency can produce wonderful results with static objects, fairly easily. But my goal is to create a fully dynamic paint shader based on the current, physically based rendering system. After playing around with a few different methods, I have been able to create a paint shader with real time reflections and realistic paint flake.

The shader is simulating 3 surfaces, similar to the three major layers in metallic car paint: base, flake, and clear coat. Currently, is being handled by blending three separate material functions. My next goal is to clean the system up and squeeze everything into a single shader. One that can be used to create instances and includes parameters.

Once that is finished, I would like to put together a tutorial to share my system and my process of creating it with the community. shader is far from perfect, but I think it could act as a good stepping stone for other developers.

Current limitations are:
1 - normal map (orange peel) doesn’t affect the clear coat reflection, because capture maps is being driven through the emission channel
2 - the paint flake values override the value from the clear coat, which is beneficial when the flake is in highlight, but when the flake is reflecting a dark value, dark spots appear.
3 - clear coat is not handling highlights from scene lights correctly

These and a few smaller issues are in need of fine tuning. Although, I am certain other issues are currently unknown to me. Anything stand out in these images as wrong or inaccurate? I could use as many sets of eyes as I can get!

It definitely looks a lot better now!

that looks awesome:)

couple of questions, is the reflection set up in the material or is it a reflection capture? will work on a moving vehicle?

also just out of curiosity are you going to make your futuristic looking car drivable?

The reflections on the clear coat is being driven by a scene capture actor. It seems to be the easiest way to get accurate realtime reflections. It has a few shortcomings at the moment, because it’s not entirely accurate when applying it to my system. It’s a little expensive as well. Once I clean up the shader, I will post of few pictures of the material graph.

The car model is my interpretation of those plastic models, the ones car painters use to test their blends. It is nice to have for my own testing.

I have made some improvements to how the shader handles the clear coat. Light reflects at full value now, whereas before it was dimmed. I achieved by using the capture texture to help drive the alpha blend.

I have also integrated LPV lighting to my scene. It does improve the flake reflection brightness in dimly lit scenes.

Have a look:

In the video, my test model is being lit by the scene directional light, and a street light. With the light reflecting at full value, like bloom and camera flare help accentuate the shader’s affect.

image displays how LPV can improve the lighting in dimly lit scenes.

Hello all!

I have had some more time to improve the shader. It has been rebuilt, utilizing a single material, which allows for instancing. I wish did a lot earlier. It makes iterations and fine-tuning a piece of cake. I recommend to everyone working with complex shaders - start instancing your materials early in development. It will save you a lot of time compiling when experimenting!

In the future, my game will allow users to modify the parameters themselves. Attributes like: base color, flake color, flake size/density.
I would also like to integrate a damage system (dents, rust, and dirt)

Current issues:

  • Reflections are still not affected by the normal map. I have a couple of tricks up my sleeve, but I still need to implement them.

  • The capture actor has no function to affect a minimum render distance. In UDK, it was possible to set a minimum distance in the capture actor. would be handy, because currently the inner geometry of the bike (where the capture actor is placed) is being captured by the actor and rendered in the reflections.

I will have a lot more free time soon. I am getting married! Preparations and side projects for my wedding had consumed nearly all of my free time, but after June 28th I will have a considerable amount of time for production work. After my wedding, I will put together a written and video tutorial for the UE4 community. =)

Here is a sneak peak of the shader:

Hi Stimpanzee,

Nice looking shader!

Thank you for keeping going with updates! I’ll be very interested in seeing your tutorial and work with materials!

Thank you!

Crazy stuff. The results are incredible.

Looking pretty awesome!

And congrats with the marriage. :slight_smile:

If just did a tutorial was great!

Nice one man!

Amazing job Stimpanzee and congrats on getting married! I remember spending quite a bit of time back for a project doing in UE3 and remember getting caught up on the custom lighting model and implementing 2 different types of Specular highlights, ahh good times and probably tore out some hair in the process :smiley:

But looks like you are doing a stellar job on the material. Really looking forward to seeing finalized and also the texture/normal maps used. Congrats, and enjoy your wedding!!!

looks immense. Would love a tutorial!!

Ill second that request please, it looks really good!

Wow, that looks really nice. Good job, Stimpanzee! Hope marriage is going well and you’ll be able to knock out a tutorial soon :wink: Thanks!

Yeah, can’t wait to have your most recent setup to play with !

Sorry it’s been so long since I was last here, guys. I’ve had a crazy summer - just started teaching a college course as well, but… I’m working on a detailed tutorial which will be finished in the next few days! Didn’t mean to keep everyone hanging on one for so long. Once it’s finished, any developer will be able to construct my shader system. =)

That sounds awesome! Thanks a lot for all of Vince! :slight_smile: