Metal conducter shader

(pixelgrip) #1

i was on the search ,for a good and simple index of refraction equation,that can calculate complex IOR with n and k extinction values,and that i can use for the thin film shader.i found some usefull equation ,that i was testing as stand alone conductor shader,to see if its accurate enough ,for the thin film shader implementation in cycles.

first testrender with gold values from the refractive index website.i used the 0.6 for red, 0.56 for green and 0.45 um for blue on the website and put the given n and k values into the the result.

edit,the equation seems to do the work.i am not sure about the accuracy.if someone knows some reference renderings with n k datas for comparison,a link would be helpfull.

btw the hdri looks a bit yellowish,this was used in the thinfilm paper renders.



(pixelgrip) #2

iron oxide

Brass (Cu-Zn alloy),i changed the hdri for more neutral lighting

gold with CIE 1964 wavelengths used at refractive index site (645,525,444nm)

(pixelgrip) #3

at the searching for reference material datas, i found this thread,so someone has the same idea before,but with OSL,with good results.

anyway ,like i sayed ,my equation is for the thin film shader, i allready rebuilded.this works with cycles GPU.or is this done before for GPU too?so i can stop my work with this. least i have something to copper,looks close to me.i have used the same wavelengths (650,532,450nm)

(RickyBlender) #4

Some one did a PBR nodes set up for that a while ago

metal looks good

did u try the Principle nodes ?

happy bl

(pixelgrip) #5

RickyBlender,thanks i know this thread ,this thin film shader is still OSL, isn’t it?
for this reason, i started a thin film shader rebuild for GPU a while ago.

no i didnt tryed the Principle nodes with the conductor shader if you mean that.

btw new copper render with roughness and bump for more realism look

(spiderbrigade) #6

Hi pixelgrip,

The only thread I’m aware of is this one from a few years ago, but it focuses only on refractive index AFAIK and doesn’t incorporate extinction. So your approach is going to much more correct. I think I mentioned Prutser’s OSL script already in your other thread, which is the only other attempt I’m aware of at tackling this. If you get that functionality (thin film and multi-wavelength n,k) working in pure GPU-compatible cycles it will be a HUGE deal for anyone trying to get realistic metals. Your current thin-film script is already a great thing, but as I mentioned before there’s some guesswork involved in replicating specific metal-film effects accurately. Being able to plug in measured values directly will make it a lot easier.

For instance this is using your thin film shader to emulate the thin layers of oxide that form on iron as it heats up - guesswork on the IoR and thickness values to get approximate color bands.

Keep up the great work, it is VERY much appreciated.

(pixelgrip) #7

Hi spiderbrigade,wow your heatup emulation looks great.thanks for the link,i read it and as you meantioned ,there is no use of the extinction.

in the past weeks i have learned alot about thin film,dielectrics and conductor materials.the first most confusing thing, with the extinction value is,that it behaves different on metal vs dielectric for dielectrics there is no use of a k value.if there is a need for absorption in dielectrics,than the beer lambert equation fits very well for this(like the refraction shader or sss shader).in metal the extincion works the otherway way simply sayed.if the transmitted light hits the metal,and the higher the k value is,the less the light gets transmitted,so its gets reflected more,simply explaned.

(RickyBlender) #8

i like the copper with bumps or not
color is nice
but also would it be possible to add some green corrosion to that ?

any sample file to test this ?

might be more realist using the Principle shader
which has a better Fresnel correction !

happy bl

(pixelgrip) #9

RickyBlender,corrosion is like another metal,so no.but you can mix it with different settings ,with/like all other shaders sure(pointness grunge come to mind).
at this state it is simply one air/metal equation,one layer.

sample file maybe later.the main reason for this thread is to ask for reference datas for comparsion.if the equation is close enough i post the blendfile,otherwise i dont want to post a shader that gives wrong results.

i am not sure, what you mean with Principle shader has better Fresnel correction,i havent used a clear coat on top or anything .anyway you can connect the shader output, to every input you want to your need.btw the shader it self ,is a Fresnel equation.

if i can implement this equation to the thinfilm shader,than you can play with dielectric/metal layer and thickness variations.that should give maybe some possiblitys.later than maybe i make another thinfilm shader with metal/metal layer.

(RickyBlender) #10

saw one set up where you could have one nodes with some preselection of metals
but some were missing !

would be great if you can implement it with different metal selection
then it is quick don’t have to search what values for n or k and done !

nice work

happy bl

(pixelgrip) #11

good idea with presets,but since this equation and the thin film shader are builded with cycles nodes,i cant “programm” a menu for that.maybe some simple input groupings will do the job.

(RickyBlender) #12

I found the old file
yes I think it was done with some group nodes
one for each metal type
and in group node you have metal name which call the right group
so very user friendly and easy to select

keep up the good work
happy bl

(Secrop) #13

Actually, you could!..
here’s my metal condutive shader, with three different interfaces (same node). It can even load nk files from most databases… :wink:

(pixelgrip) #14

Secrop,nice. first time i see such custom shader with did you do that?

(CarlG) #15

How the…???

(Ace Dragon) #16

Possibly either done with an OSL script or a Python script (maybe the latter if this is to work with SVM). Both languages allow for this kind of UI build.

(burnin) #17

great works all around :slight_smile:

yeah, that Metal node (reading measured data) is a missing link in the Cycles. amazing

some extra info & tools:

FreeSnell is a program to compute optical properties of multilayer thin-film coatings.

(pixelgrip) #18

thank you very much for the link,many usefull infos in there

the possibilty to read from datafiles are great,but for simplisity we need only the n and k values at the trichromatic (rgb) wavelengths.

if we want the whole wavelength spectrum from the database.then a complete different code are needed, at least for the thin film (or if you think of filter out the usefull datas, from the database.this script alone is maybe bigger than the shader code).for me thats to complicated.and btw at least the CIE XYZ ,for better wavelength calculation,is still a missing feature in cycles.same goes for the lack of vector calculations with the math nodes.

and if things getting to complicate,the more the need for OSL comes back.

(burnin) #19

yup, simplicity is the way for Cycles engine… since its main point & the essence is to render pleasing images for animation FAST

anticipating to see what you come up with :slight_smile:

(Secrop) #20

It’s a Python Node with gpu compatibility… could share the code, but this node is on sale on blendermarkt.

But if you want to dig similar stuff, check my github page.