No announcement yet.

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

  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by joshezzell View Post
    I gotta ask, how do you get a scene capture to interact with the material? I have been wondering how to get the reflection from a scene capture onto translucent objects for awhile now. Would be very useful for small bodies of water, like a lake or pond.
    The approach I took was to use a texture sample of the render target, which uses a CustomReflectionsVector node to handle world reflections. With the help from a tangent to world node, it is possible to convert Normal Map data into world space, through the CustomReflectionVector. (That one took me a while to figure out)

    So in theory you could use the capture for translucent materials like ponds or lakes. I have heard rumors that 4.8 might have support for SSR on translucent materials. This would be the way to go! Scene capture nodes require a lot of extra compute time, but it is possible to save out a cubemap. You won't have dynamic reflections, but you would still have the ability to use unique cubemaps for reflections.

    I would recommend waiting for SSR support on translucent materials. It should make things like water look great!


      Looks awesome! Thanks for posting kishars! It's cool to the the material working on a Porshe GT. I like the decals too!

      My materials will be up on the market place soon and will include a system for applying decals as well. AO support too, for traditional PBR functions and reflection masks. AO definitely helps sell the car's surface definition.


        Woo,that great!Wait you showcase on the market. Stimpanzee


          Materials Released on the Marketplace!

          It's been a long time, almost a year since I started working on a car paint material. I can happily say that my materials are finally available on the marketplace!

          I owe many thanks to the community. Special thanks to Tim H, Jacky, Dot-Cam, and the marketplace team! Thanks to your help, these materials reached a level that I never even imagined.

          I hope these materials help devs make the most jaw dropping visuals possible. I can't wait to see what people will come up with!

          Those who are looking for guidance/tutorials/documentation for the systems: You will be able to find what you are looking for at
          Video documentation will be live in the next couple of days, and will explain how to get the most out of the system.

          Good luck, and thanks everyone! I will keep updating this post with info on updates, and future material systems!


            I heard about this going through on yesterday Twitch stream! Congrats, Vince!

            Click image for larger version

Name:	carpaint.png
Views:	1
Size:	467.7 KB
ID:	1066425

            Keep up the awesome work and I look forward to the other packs you'll bring! I'm looking forward to your demo videos too.
            Tim Hobson | Learning Resources | Epic Games
            UE4 Documentation


              Hey awesome news man! Great to see it up on the marketplace!

              Can't wait to see what your next project will be
              Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap


                Video Tutorials - Marketplace Materials

                Thanks everyone!

                I just finished uploading the final video tutorial, going over the system. If anyone is interested in learning more about the flexibility of the system, or wants to learn about the materials they bought, you can find the full list of videos on my website:

                Or you can watch the playlist right here:

                Here is a little taste - Video 1 of 5


                  I followed tutorial on your website and result is amazing. I'm creating a garage setting for car renderings. as you have said, SceneCaptureCube method really is taxing, especially in interior with many lights. I only get 10-15 fps when walking around a car (exterior is fine). as I'm still fairly new to UE4 and I haven't managed to make clear coat shader to work. but, it's good you can save captured reflection to EXR file and use that instead of a real time capture and delete SceneCaptureCube, which skyrocketed my fps immediately. of course, this is only good if a car's not moving anywhere, which it isn't in my case. ;-)

                  thank you for sharing. shader is awesome, great work!
                  Last edited by heraSK; 02-21-2015, 05:06 AM.


                    Thanks Hera!

                    The scene capture cube is certainly one of the most taxing actors in any given scene. Thankfully there are some tools in place which allow us to get some performance scaling. Check out the video I have here:

                    I go over some of the techniques I use to bring up the FPS, using the capture cube.

                    In the future I would like to cut down the cost of performance even further. I think there might be a good way to get a hybrid system running. I am imagining a system where only certain angles of reflections are calculated through a 2D capture actor, and the rest are handled with the standard reflection tools. In theory, such a system could cut performance cost by 84%

                    Now that the first collection of materials have been released I can spend some time in R&D. Mad material scientist! I'll keep this post updated with my results. =)


                      Gdc - 2015

                      It is here! I am currently in San Francisco, waiting for the CA orientation to start. This year is going to be the biggest yet! For all those attending, send me a message if you want to chat or grab a beer.

                      Right before I left for Cali, I put together a quick scene with some old animations for my in development title: Cafe Races. I thought I would share it here! This game was the reason I started the car paint material project.


                        Stimpanzee, thank you for tutorial. Material looks great! But i have some trouble with reflection after packaging. I found nodes, that give this problem. I am asked this question here but dont have any answer. Have anybody tried to package this(or material that using cubemap generated by SceneCaptureCUbe) material in 4.9 (in another version i don't tried to package)?


                          Hey Stimpanzee I think you will enjoy this.

                          For an epic friday project a couple months ago I added a new secondary bottom normal map input to the clear coat shading model so you can get accurate shading for carbon fiber substrate as well as attempt to create metallic flakes using a noisy normal. It is not checked in yet (it needs to go through code review as I am not a full fledged coder) but there is a chance this will make it in by 4.11 or so. Currently this is implemented as a project setting that has to be enabled since there is some rendering overhead any time you introduce more dynamic branching into the deferred rendering path.

                          Click image for larger version

Name:	01.JPG
Views:	1
Size:	78.2 KB
ID:	1088783

                          Click image for larger version

Name:	02.JPG
Views:	1
Size:	57.8 KB
ID:	1088784

                          quick attempt at flakes with a normal map (tempAA is off since tempAA kind of removes the sparkles unfortunately):
                          Click image for larger version

Name:	sparkles.JPG
Views:	1
Size:	54.8 KB
ID:	1088785

                          The basic gist of how its done:
                          -New normal map input via "Custom Output" node (same system used for landscape grass)
                          -Normalmap is packed into gbuffer using vector to octahedron since we only have 2 spare gbuffer channels to store in (custom data had a single channel left and opacity). Note that this packed normal is 8-bit which is why I chose to make the bottom normal the secondary rather than the top (top requires full precision for smooth vertex normals).
                          -Still in the bass pass, the clearcoat mask value is packed as 7-bit and if there has been a custom-output clearcoat bottom normal node placed, write a 1 into the free bit in CC mask, else write a 0.
                          -Then its a branched IF inside of the clearcoat shading model that unpacks the bit from the clearcoat mask. If the bit is 0, do the standard clearcoat shader. If the bit is 1, do the extra work for the bottom normal.
                          Last edited by RyanB; 10-05-2015, 08:21 PM.
                          Ryan Brucks
                          Principal Technical Artist, Epic Games


                            RYAN MY GOD YOU'RE AMAZING!!!

                            I actually was going to request this feature be added to clear coat, but I thought you guys had more important things to do (this was back around 4.5's release). Thank you so much!

                            Out of curiosity, how much overhead are we talking?


                              I have not had time to test it for performance since messing with it. It can be difficult to say though since this kind of overhead cost can be very platform specific. Sometimes the overhead is merely from having more temporary variables in the overall shader file which even if many of them are not used (due to branch always being disabled etc), can cause the GPU to process things less efficiently. But sometimes that cost may only show up on ps4 for instance. In practice on PC with a decent video card it is probably hard to measure the cost since it will be very small. But when enabled, it makes all clearcoat materials go up in instruction count a bit. I can't remember exactly how much but it wasn't double or anything crazy. If you enable it in project settings but don't use the bottom normal, it will still add some cost to the clear coat deferred shading since it has to check if the pixels encoded the bottom normal mask. For materials that do not use it, it will not really do that much extra work but the extra variables in the shader may cost something small.

                              GPUs try to parallelize things they will 'make room' for variables they don't know they won't need which is why unused extra variables can hurt in some cases.
                              Last edited by RyanB; 10-06-2015, 09:22 PM.
                              Ryan Brucks
                              Principal Technical Artist, Epic Games