User Tag List

Page 1 of 3 123 LastLast
Results 1 to 40 of 95

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

  1. #1
    1
    Unreal Engine Support
    Join Date
    Apr 2014
    Posts
    2,415

    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/questions/30148/translucent-material-function-layered-car-paint-sh.html

    Name:  Results.jpg
Views: 12291
Size:  287.0 KBName:  carpaint_1.jpg
Views: 12650
Size:  112.7 KBName:  carpaint_2.jpg
Views: 9579
Size:  82.1 KB
    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. #2
    0
    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.

  3. #3
    0
    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.



    Name:  XQFhJ0h.jpg
Views: 10437
Size:  218.9 KBName:  3mlijmc.jpg
Views: 9347
Size:  390.7 KBName:  e64ifqY.jpg
Views: 9247
Size:  178.4 KB


    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!

  4. #4
    0
    It definitely looks a lot better now!

  5. #5
    0
    Luminary

    Join Date
    Mar 2014
    Posts
    1,569
    that looks awesome

    Quote 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?

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

  7. #7
    0
    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.

    Name:  gyuq1n1.jpg
Views: 9005
Size:  268.7 KB
    Attached Images Attached Images  
    Last edited by Stimpanzee; 05-21-2014 at 03:24 PM.

  8. #8
    0
    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:
    Name:  4.jpg
Views: 13303
Size:  787.4 KB

  9. #9
    0
    Unreal Engine Support
    Join Date
    Apr 2014
    Posts
    2,415
    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

  10. #10
    0
    Crazy stuff. The results are incredible.

  11. #11
    0
    Looking pretty awesome!

    And congrats with the marriage.

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

  13. #13

  14. #14
    0
    Quote 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:
    Name:  4.jpg
Views: 13303
Size:  787.4 KB
    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 at 06:41 AM.

  15. #15
    0
    Supporter
    Join Date
    Jul 2014
    Posts
    1
    This looks immense. Would love a tutorial!!

  16. #16
    0
    Ill second that request please, it looks really good!

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

  18. #18
    0
    Yeah, can't wait to have your most recent setup to play with !
    Yup, proudly writing in European B2-class English.
    All grammar mistakes are under copyright protection from my english teacher. Thank you for her.

  19. #19
    0
    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 this one for so long. Once it's finished, any developer will be able to construct my shader system. =)

    -Vince

  20. #20
    0
    Mythic

    Join Date
    Apr 2014
    Posts
    2,225
    That sounds awesome! Thanks a lot for all of this Vince!

  21. #21
    0
    Alright, the tutorial will be out tomorrow! The plan was to finish it tonight, but I found a few areas where the system needed a little more attention.

    For now, here is a small example of the versatility of the shader. With a little experimentation using instances, it is possible to simulate most types of car paint surfaces.
    This link is to a small gallery of the shader in use on a motorcycle asset, with more advanced lighting.
    http://imgur.com/a/f8tnM


  22. #22
    0
    Alright, the tutorial is complete! It's still a little rough, so you will have to forgive me for the spelling/grammatical errors.
    If you have any questions or comments, feel free to message me.

    http://www.caferaces.com/p/tutorials.html


    Good luck everyone!
    -Vince

  23. #23
    0
    Mythic

    Join Date
    Apr 2014
    Posts
    2,225
    Quote Originally Posted by Stimpanzee View Post
    Alright, the tutorial is complete! It's still a little rough, so you will have to forgive me for the spelling/grammatical errors.
    If you have any questions or comments, feel free to message me.

    http://www.caferaces.com/p/tutorials.html


    Good luck everyone!
    -Vince
    Thank You, Thank You! I just quickly skimmed through, and found it is in my favorite format for material tutorials, Written with pictures!

    I will be starting the tutorial in the morning tomorrow, and will give you some feedback (and maybe some cool photos you can use to see how it looks on mine as I go through it (and try it out ).

    But again, thank you so much for all of your hard work, and for sharing it with all of use, it looks fantastic! and will be extremely valuable for my car racing game I have in the works!!

  24. #24
    0
    -Continuing work on the car paint shader-

    I've started to increase the versatility of the car paint shader. I am adding features like color masking and maybe even a grunge/rust layer. It's a little intense at the moment but I think the hard work will be worth it!

  25. #25
    0
    Hey guys, I've made a lot of progress with a masking system and currently putting together a grunge/rust layer system based on vertex color.

    I also solved the issue which was preventing normal maps from affecting the reflections. So orange peel! Here is a little sneak peak at what's now possible with an instance of the material.

    Attached Images Attached Images  
    Last edited by Stimpanzee; 09-29-2014 at 11:40 AM.

  26. #26
    0
    A little side project, for you all of you modern car materials people!

    Name:  r2Mz9dl.jpg
Views: 8627
Size:  382.8 KB

  27. #27
    0
    I've been doing a little work, revisiting transparency with my updated reflections and masking system. It is able to produce some good looking glass! I'm putting together a package to send to the marketplace. It will include: 3 variations of the car paint materiel, 3 variations of carbon fiber, and the new glass shader.

    Here is a little look at an updated car paint model with the glass shader.

    Name:  PUiqQNo.jpg
Views: 8729
Size:  839.1 KB

  28. #28
    0
    Quote Originally Posted by Stimpanzee View Post
    I've been doing a little work, revisiting transparency with my updated reflections and masking system. It is able to produce some good looking glass! I'm putting together a package to send to the marketplace. It will include: 3 variations of the car paint materiel, 3 variations of carbon fiber, and the new glass shader.

    Here is a little look at an updated car paint model with the glass shader.

    Name:  PUiqQNo.jpg
Views: 8729
Size:  839.1 KB
    Looking great and glad to see you are back working on it Stimpanzee! And also hope your wedding went great bud

    I've been working a little here and there on a good car paint material and it's not too bad. The metallic flakes aren't 100% and I'm actually doing some emissive boost to get them to pop however it doesn't look natural once you get close to it. I stepped away from it but want to come back to it shortly. Are you planning on distributing the material with the textures publically? I personally would love to see the normal maps you are using and how you go about composing the metallic flakes and getting them to pop based on the normal of a given flake and/or using the camera vector node.

    A guy did this for Siggraph 2014 (http://www.youtube.com/watch?v=KHT82-KYhRw) and I want to try and dig a little further in his paper and try to see if this is possible for real-time. Anyways, great progress and hope you are enjoying the weekend! Take it easy bud.

    Edit: Looks like you already did release the tutorial! Great work Stimpanzee and I'll need to link with you and get you an updated version of my Joystick Plugin to nail out the remaining issues but glad to see you got it up, going to read it now!
    Last edited by MC Stryker; 10-05-2014 at 08:11 PM.

  29. #29
    0
    Veteran
    Join Date
    Jul 2014
    Posts
    449
    Nice work, looks really good!

  30. #30
    0
    Mythic

    Join Date
    Apr 2014
    Posts
    2,225
    Quote Originally Posted by Stimpanzee View Post
    I've been doing a little work, revisiting transparency with my updated reflections and masking system. It is able to produce some good looking glass! I'm putting together a package to send to the marketplace. It will include: 3 variations of the car paint materiel, 3 variations of carbon fiber, and the new glass shader.

    Here is a little look at an updated car paint model with the glass shader.
    Looking really good Stimpanzee!! It's been a while since I have been able to work on the shader I created from your tutorial, however clearly you have made some great progress! The glass & carbon fiber additions looks really good man, nice work.

    I think I recognize the emblem (and the shape of the car fits the model)... Is that a Pontiac Firebird I see?
    [Free Community Project/Plugin] WIP Dynamic Ocean & Calendar Based Sky
    New Features:: Highly accurate sun/moon position, and lunar phase calculations built into the plugin (base class for the SkyDome blueprint)
    In Progress: Weather simulation w/ volumetric clouds

  31. #31
    0
    Thanks for the video link! It's cool to see their approach for flake normals. My system takes advantage of a masking flake texture/noise normal map to produce the flake. The custom map they use for rendering unique and randomized flakes is a good approach. I think that would be a great way of simulating dense flake layers.

    My textures are using much less dense flake patterns, and each flake is being handled by individual pixels. Essentially, the flake in my material is enhancing the look of a solid metallic surface, adding high contrasting highlights. I will have to see if I can find a way of generating a similar map to the video. I think that UE4 could definitely handle it! And it might look a lot better than my current setup!

    My original plan was to create a similar normal map, but after testing, the masking system seemed to work nicely. But after seeing these results, I am definitely going to have to revisit the normals.

    Cheers,
    Vince

    Quote Originally Posted by MC Stryker View Post
    Looking great and glad to see you are back working on it Stimpanzee! And also hope your wedding went great bud

    I've been working a little here and there on a good car paint material and it's not too bad. The metallic flakes aren't 100% and I'm actually doing some emissive boost to get them to pop however it doesn't look natural once you get close to it. I stepped away from it but want to come back to it shortly. Are you planning on distributing the material with the textures publically? I personally would love to see the normal maps you are using and how you go about composing the metallic flakes and getting them to pop based on the normal of a given flake and/or using the camera vector node.

    A guy did this for Siggraph 2014 (http://www.youtube.com/watch?v=KHT82-KYhRw) and I want to try and dig a little further in his paper and try to see if this is possible for real-time. Anyways, great progress and hope you are enjoying the weekend! Take it easy bud.

    Edit: Looks like you already did release the tutorial! Great work Stimpanzee and I'll need to link with you and get you an updated version of my Joystick Plugin to nail out the remaining issues but glad to see you got it up, going to read it now!

  32. #32
    0

    Rebuilding the Normals

    After seeing the video linked by MC Stryker, I was inspired to rebuild my normal maps for the flake. I am using a new normal map and included a new parameter within my material to enable "full flake" The parameter overrides the flake mask, which then boosts the glint effect from the new normal map.

    It has massively improved the look of the shader! Thanks for the link MC Stryker!

    You will have to excuse the crappy gif, because it certainly doesn't do it justice!


  33. #33
    0
    Quote Originally Posted by DotCam View Post
    Looking really good Stimpanzee!! It's been a while since I have been able to work on the shader I created from your tutorial, however clearly you have made some great progress! The glass & carbon fiber additions looks really good man, nice work.

    I think I recognize the emblem (and the shape of the car fits the model)... Is that a Pontiac Firebird I see?
    Thanks DotCam! I keep getting caught up in the improvements and variations. I think I might have inadvertently become a shader artist. haha

    And you are right about the Firebird! I found the model online, and it's been fun for testing. I am looking forward to wrapping up the shaders and getting back to my motorcycle game, though. It feels like I've been working on these materials for a long time!

  34. #34
    0
    Infiltrator
    Join Date
    Jul 2014
    Posts
    24
    Really interesting tutorial man. I followed all steps in your tutorial and get some nice results. Awesome. How do you made the carbon fiber material? I am trying the carbon fiber shading reusing some of your shading network but not getting so good results as yours. I guess it is cuestion of time tweaking some parameters and a good texture.

    You are a talented shader material man!

    Thank you!

  35. #35
    0
    Quote Originally Posted by iparra View Post
    Really interesting tutorial man. I followed all steps in your tutorial and get some nice results. Awesome. How do you made the carbon fiber material? I am trying the carbon fiber shading reusing some of your shading network but not getting so good results as yours. I guess it is cuestion of time tweaking some parameters and a good texture.

    You are a talented shader material man!

    Thank you!
    Thanks iparra! I'm glad you are getting good results from the tutorial!

    The carbon fiber material is very simple. The only complex portion of the shader are the reflections and reflection masking system. The rest of the material can be extremely simple. For the image on this post, I was using a 0,0,0 vector for diffuse, a solid 1 for metallic, and a .3 for roughness. The material relies heavily on the normal map.

    I crafted the normal map in Maya, modeling individual strands, and texturing the filaments. I used transfer mapping to produce the normals map and also a mask texture for something special, which I haven't shown off yet. I thought it was important to do a normal map from scratch. I learned a lot about carbon fiber construction in the process, which is a plus!

    Name:  CarbonFiber.jpg
Views: 9448
Size:  720.1 KB

  36. #36
    0
    Alright, another day - another update!

    I finished adding a new feature to the shader. Rust!

    The rust is being driven by vertex colors, so you can paint exactly where you want the rust to form. Then, there are a few parameters to fine tune the look rust.

    Name:  xrkB6vi.jpg
Views: 9249
Size:  667.7 KB

    And with a few shifted parameters...

    Name:  CDd7kWc.jpg
Views: 8153
Size:  706.8 KB

    The shader itself, is getting a little more difficult to work on - because of how large it has become!

    Name:  9hcqxvJ.jpg
Views: 8095
Size:  437.8 KB

  37. #37
    0
    Infiltrator
    Join Date
    Jul 2014
    Posts
    24
    Thank you Stimpanzee! I will give a try to your advice.


  38. #38
    0
    Took a bit of time to dial in the standard values for the dynamic rust system. Ended up playing around with an instance until I was happy with the results. Take a look!

    Name:  Hq4rhsE.jpg
Views: 8098
Size:  696.9 KB


    This is a good example of how adaptable the system is. The best part is that it can all be controlled through instance parameters, so not only can you dramatically change the look of the paint at runtime, it's also easy to dial in the right look!

    And of course the system is still running real time reflections based on a scene capture actor!

  39. #39
    0

    Video Update

    Back again, with a video this time!

    I have been running the shader in real time with the standard vehicle physics template. (I just fliped the visibility of the standard car mesh, and inserted a static car mesh into the blueprint.)

    The results are promising! Thanks to the shader, it is possible to run car paint and chrome with high quality reflections on dynamic objects!

    Take a look:

    Last edited by Stimpanzee; 10-20-2014 at 11:38 PM.

  40. #40
    0
    It's amazing to see how much you've improved this shader.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •