Thin film OSL shader

nice tests lele. wonder the differents in rendertimes from start to end?

seconds.
The effect of the shader itself on rendertime is negligible, and so quick i’d call it invariant from test to test.

We used this thin film map just yesterday to add extra realism to a CU of an old plaster type picture frame. The frame is the really ornate type, painted gold. Took a pretty complex shader flow graph to get it to look the way I wanted it. The thin film was used in screen mode on top of the reflection channel of the base layer (in a composite map). Then we VRayBlended some VRayFlakes on top, which turned out great. Client was blown away by the subtle color variations.

So, thanks, Vlado!

Nice! I’m glad this came in useful :slight_smile:

Best regards,
Vlado

Ah, good idea on the screen mode composite map. It’s still magic to me how this works :stuck_out_tongue:

I dunno if that is the ideal way to use it, but it worked nicely for my purpose, and renders faster than a whole second material with a blend. My surface is already slow enough with VRayFlakes as a second material blended :stuck_out_tongue:

I desaturated and played with the hue a bit so I’m not sure how accurate this is but it’s an awesome shader.

I would like to test this OSL shader but it crashes max 2011 every time I try to load it! …any idea? …is it supposed to work with older releases?
PS the same happens with the other OSL (AFMFresnel)

Looking nice!

In the past we would achieve somewhat similar results with Tri planar falloff maps of different colors. More artist control, I guess, but more of a pain, and not accurate (though I don’t know how accurate this is after you tweak it).

LightWave has had a thin film shader for twenty years, and it was fun to play with. This one is much easier to use in production.

nvm got it to work, but only as osl texture in reflection map mode.

that’s how it ought to be used.
Make sure you turn fresnel off, as it’s got its own one!

makes sense…that’s why I had to crank the shader fresnel! I’ll correct it tomorrow.

lol! yeas, that’d make sense!
You can wire me a few hundred bucks at your own leisure :wink:

Wow!

Simon, who sits next to me in our office saw this and downloaded, gave it a test run … and wow, just wow!
Thanks so much for sharing!

By the way - I totally missed this just because you’re posting this in a max sub-forum. God knows how much goodies I’ve missed because of this (being a Maya user) … :wink:

A particular use of the iridescence shader, coupled with a flakes normal texture, in a blend material, to generate a carpaint with iridescent flakes.
Scene and shaders are attached, just grab yourself an HDRI in place of mine.



OSL_carPaint_with_iridescence.zip (30 KB)

And a slightly tweaked, less pronounced, shader (chiefly, i changed each layer’s influence, and the flakes’ normals orientation variance).

A word of notice: you WILL need many AA Rays AND a reconstructive filter on the rendered image to make sure the flakes won’t shimmer in an animation.
This is a need forced by the fact that the flakes map does no filtering on its own, so we have to burden VRay with it.
This last one was rendered with a fixed-12 and a sharp quadratic filter.

EDIT: made a mistake earlier. Corrected now, max 2014 scene added, along with the flakes OSL shader with descriptions for each spinner.



OSL_carPaint_with_iridescence_B.zip (28.4 KB)

Cool, Lele!

Seems to broken on 2015?

I get this error
In the material compiler output
Could not compile shader J:\Jobs\46761M_Mazda2Headlight_CP\3d\Projects\Maps\irridescence.osl (OSL to OSO)

yup same here…any ideas?