Isotropix Forums

CarPaint shader using OSL Flake

General Discussion about Isotropix and CG related topics

CarPaint shader using OSL Flake

Unread postby esmith » Tue Apr 24, 2018 8:36 pm

Hello everyone, a bit ago we released a project with a bunch of alternative OSL based procedural. One that was missing however, was a Flake OSL shader. One of our engineers managed to get it working so I decided, as part of a bit of study, to make a Car Paint shader emulating the one in Arnold 5. It's the first version but it's setup the same. Base-coat, Flake-coat, Clear-coat. The color of the base-coat and flakes are driven by some constants. There is also a fractal noise distortion on the clear-coat to keep it from being absolutely perfect. Modify it's value with the "Clearcoat_Disturbance_Distortion_Level".
MetalFlake_CarPaint_Shaderv01.jpg


I'm using the 2 gradients to emulate the "flip flop" value in the arnold shader, which is fresnel you can alter it to adjust how much reflection you get from the flake and clear-coat as the surface more toward, or more away, from the render camera. I am pointing directly to the render camera at this point, you need to point it to your own camera for the shader to work properly.
GradientSettings.jpg
GradientSettings.jpg (96.82 KiB) Viewed 2479 times


CarPaint_OslFLAKE.zip
(51.42 MiB) Downloaded 269 times


I need to add the ultra fine hairline scratches to the clearcoat next, and add some more complexity to the base coat as well. I've attached the project to this thread.

Let me know how you get on. Will work really well if you need to surface an American Bass Boat or a 1970s bowling ball!!!
MetalFlake_CarPaint_v01.jpg
User avatar
esmith
 
Posts: 180
Joined: Mon May 22, 2017 4:11 pm

Re: CarPaint shader using OSL Flake

Unread postby ambassador1 » Wed Apr 25, 2018 7:17 pm

Cool, looking forward to this and the others being built into Clarisse :)
ambassador1
 
Posts: 259
Joined: Mon Dec 15, 2014 11:40 pm

Re: CarPaint shader using OSL Flake

Unread postby esmith » Thu May 03, 2018 9:25 pm

I've made a few more additions to this. Some nodes are disabled as they are not working correctly. I need to simplify some things, and I changed the projection type so UVs are irrelevant as this particular car models UVs were a disaster causing issues for me.

But it now has some scratches causing reflection errors, and things are scaled for a proper flake density. I still need to work on a simple surface dirt/dust solution, i'm making it to complicated now. And I will use a texture map in the end, for the fine surface scratches that might not even be visible at this distance.

Also if you paint a Toyota 2000GT Metallic Red your a bad person. But it's the car geometry i currently have ;-)

Image_Test_v4_00000.jpg
Attachments
FlakePaintExport_REF.project
(58.54 KiB) Downloaded 160 times
User avatar
esmith
 
Posts: 180
Joined: Mon May 22, 2017 4:11 pm

Re: CarPaint shader using OSL Flake

Unread postby esmith » Fri May 04, 2018 11:02 pm

That last project was broken, sorry if anyone tried to use it. I've gone in and simplified everything and now the normal mapped scratches are working correctly. As well a layer of clear coat with "smudges" on it to break up the perfect clearcoat is now also present, using a mask which is also driving where the fine scratches are located.

I'll render a little sequence out over the weekend, I think the final step is to get a better more realistic "fine scratches map" as in all my reference usually this is shown as a swirl pattern, which ideally you buff out, but you don't always get it all out.

CarPaint_Shader.jpg
Attachments
FlakePaintExport_REF.project
(59.35 KiB) Downloaded 196 times
User avatar
esmith
 
Posts: 180
Joined: Mon May 22, 2017 4:11 pm

Re: CarPaint shader using OSL Flake

Unread postby vandam » Fri May 04, 2018 11:49 pm

awesome! merci
vandam
 
Posts: 150
Joined: Wed Jun 21, 2017 9:22 pm

Re: CarPaint shader using OSL Flake

Unread postby esmith » Wed May 09, 2018 11:30 pm

Ok here is my render from a sequence over the weekend. Shown with everything turned on. Obviously there are some issues with my geometry, but in terms of the shader I'm pretty happy. I have quite a lot of distortion in the reflection normal of the clearcoat, which really gives the body work a proper "thin metal" feeling to me. It's a bit extreme here.

Also there is the dirt and hairline scratches.

Again next up is to use a proper map to make the hairline scratches photoreal. Then some tests on non metalic paints.

Image_Test_v5_00009.jpg
User avatar
esmith
 
Posts: 180
Joined: Mon May 22, 2017 4:11 pm


Return to General Discussion