looks like you are using it as an OSL material, it’s used with the OSL texture in reflection and regular VRay material.
@jasonhuang so the .oso file will load into maya but I had to change the Color Output from result to Col_Out (max did this for me by default)
rest is the same, diffuse black and fresnel off as the shader does that work now.
Thanks for the OSL Texture. But I’m not really sure how to use it. On the refractiveindex.info site I can find the n and k values for a whole range of materials, but in the texture I can only put in colors, not the values for n and k. Is there a way to convert these numbers to rgb colors?
Hey OK! Looks like you just put in the values for R,G and B wavelengths respectively, so if you find the data on red for a material you enter that as the R part of the N and K colours, same for G and B. If your scale is 0-255 then just multiply your N,K values by 255.
So you look up N,K values for the R,G,B wavelengths and multiply them by 255. Optionally you could rewrite it to accept textures and put a VRayColor map in so you can use the direct values.
Rensy-Baby, thanks for the answer. But somehow it doesn’t work as expected. Let’s take a copper material for example:
When I type in the average wavelength for the blue component (472nm), the n value is already 1.2335. Obviously I can not multiply that value with 255, because I can’t put values greater that 255 into the color slots of the OSL. Same is for the k value.
Isn’t inputting rgb wavelength n and k values exactly what this shader tries to avoid?
I understand how to get the reflectivity value from the charts, but how exactly is the edgetint color determined (in layman terms)? Shouldn’t it always be white?
So, Reflectivity and Edgetint aren’t N and K values, they are calculated from it. Which allows for easy picking and storing of the values. The falloff to white is handled by the shader. Haven’t found a calculator for the colour values online, but the conversion is done with equation 14 and 15 from the paper.
I have no idea what this is all about, then
I thought that this osl texture should make the creation of realistic metals easier. So far I have always recreated the reflectance curves for each color component with the output curves from a falloff map. The results are great, but the process is tedious… I was expecting to just put the n and k values into the osl texture and there you go. Wishfull thinking
Well, you are welcome to contact the authors of the paper and explain this to them I was a bit puzzled myself what is the purpose of their work…
In any case, it is not too difficult to modify the shader to take n and k values directly instead of random colors - will see if I can do that if I get a bit of time.