Announcement

Collapse
No announcement yet.

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

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

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

    This 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.

    Tim

    https://answers.unrealengine.com/que...-paint-sh.html

    Click image for larger version

Name:	Results.jpg
Views:	1
Size:	287.0 KB
ID:	1134427Click image for larger version

Name:	carpaint_1.jpg
Views:	1
Size:	112.7 KB
ID:	1134428Click image for larger version

Name:	carpaint_2.jpg
Views:	1
Size:	82.1 KB
ID:	1134429
    Tim Hobson | Learning Resources | Epic Games
    UE4 Documentation
    Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
    _____________________________________________
    Follow me on Twitter @TimHobsonUE4 | My Personal Website
    Photons Be Free: Mini-Tutorials and other Curiosities

  • #2
    Stimpanzee improved it nicely in the final image.

    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.
    FREE Color LUT Collection
    FREE Physics Driven Spacecraft Project
    GTA Style Vehicle Interaction
    Dynamic DoF(Depth of Field)
    Camera Crossfade
    Portfolio

    Comment


    • #3
      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, this 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. This 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!

      Comment


      • #4
        It definitely looks a lot better now!
        FREE Color LUT Collection
        FREE Physics Driven Spacecraft Project
        GTA Style Vehicle Interaction
        Dynamic DoF(Depth of Field)
        Camera Crossfade
        Portfolio

        Comment


        • #5
          that looks awesome

          Originally posted by Stimpanzee View Post
          I have been able to create a paint shader with real time reflections and realistic paint flake.
          couple of questions, is the reflection set up in the material or is it a reflection capture? will this work on a moving vehicle?

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

          Comment


          • #6
            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.

            Comment


            • #7
              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 this 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, effects like bloom and camera flare help accentuate the shader's affect.


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

              Click image for larger version

Name:	gyuq1n1.jpg
Views:	1
Size:	268.7 KB
ID:	1050769
              Attached Files
              Last edited by Stimpanzee; 05-21-2014, 03:24 PM.

              Comment


              • #8
                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 this 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. This 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:
                Click image for larger version

Name:	4.jpg
Views:	1
Size:	787.4 KB
ID:	1051025

                Comment


                • #9
                  Hi Stimpanzee,

                  Nice looking shader!

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

                  Thank you!

                  Tim
                  Tim Hobson | Learning Resources | Epic Games
                  UE4 Documentation
                  Wiki Troubleshooting Guides: Lighting | Swarm Agent | Destructibles |
                  _____________________________________________
                  Follow me on Twitter @TimHobsonUE4 | My Personal Website
                  Photons Be Free: Mini-Tutorials and other Curiosities

                  Comment


                  • #10
                    Crazy stuff. The results are incredible.
                    | Finite State Machine | Object-Pool Plugin | Auto-Save Plugin | Anti-Cheat Plugin |

                    Comment


                    • #11
                      Looking pretty awesome!

                      And congrats with the marriage.
                      FREE Color LUT Collection
                      FREE Physics Driven Spacecraft Project
                      GTA Style Vehicle Interaction
                      Dynamic DoF(Depth of Field)
                      Camera Crossfade
                      Portfolio

                      Comment


                      • #12
                        If just did a tutorial was great!
                        Unreal Engine 4

                        Comment


                        • #13
                          Nice one man!
                          KT Dev Blog:
                          https://sites.google.com/site/knight...evelopers-blog

                          Comment


                          • #14
                            Originally posted by Stimpanzee View Post
                            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 this 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. This 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:
                            [ATTACH=CONFIG]4368[/ATTACH]
                            Amazing job Stimpanzee and congrats on getting married! I remember spending quite a bit of time back for a project doing this 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

                            But looks like you are doing a stellar job on the material. Really looking forward to seeing this finalized and also the texture/normal maps used. Congrats, and enjoy your wedding!!!
                            Last edited by MC Stryker; 07-07-2014, 06:41 AM.

                            Comment


                            • #15
                              This looks immense. Would love a tutorial!!

                              Comment

                              Working...
                              X