Page 1 of 1

Falloff Map base on IOR value.

Posted: Thu Mar 22, 2018 11:49 am
by fantome
Hi guys,

I haven't suceed to get a proper falloff fresnel map base on IOR in octane.
That would be nice to add an additional mode inside the fallof map node base on IOR value like this :
https://docs.chaosgroup.com/display/VRA ... RayFresnel

Basically you enter Medium A IOR and Medium B IOR and it give you an accurate falloff gradient.
That would be even more cool if we could activate a mode with Complex IOR with n and k value.

Cheers
E

Re: Falloff Map base on IOR value.

Posted: Thu Mar 22, 2018 12:07 pm
by nuno1980
Download free new Octane Render v4 (but experimental) for new metallic material (complex ior). :)

Re: Falloff Map base on IOR value.

Posted: Thu Mar 22, 2018 1:38 pm
by Despot
This is in 3.08 RC1 & 2 if 'm not mistaken... no need for 4

Re: Falloff Map base on IOR value.

Posted: Thu Mar 22, 2018 1:43 pm
by paride4331
fantome wrote:Hi guys,

I haven't suceed to get a proper falloff fresnel map base on IOR in octane.
That would be nice to add an additional mode inside the fallof map node base on IOR value like this :
https://docs.chaosgroup.com/display/VRA ... RayFresnel

Basically you enter Medium A IOR and Medium B IOR and it give you an accurate falloff gradient.
That would be even more cool if we could activate a mode with Complex IOR with n and k value.

Cheers
E
Hi fantome,
I do not know what is your needs, new Octane metallic shader 3.08 SDK has complex IOR option.
viewtopic.php?f=27&t=65730
Alternatively you can create different IOR materials using mix material with falloff amount.
Regards
Paride

Re: Falloff Map base on IOR value.

Posted: Thu Mar 22, 2018 2:00 pm
by fantome
Thanks for your answer guys !

Yes n and k value are already here in 3.08 in the metal material ! :)
What i need would just a be an utility nodes to generates a fresnel texture.

Actually only fallof map with the skew distort controller look to offer this.
But the skew distort is very unintuitive for me.

So that would be great to add in this node 2 other mode to generate the fresnel.
- the first one base on IOR value like i explain previously.
- the second base on the normalized disney PBR shader specular controller.
https://disney-animation.s3.amazonaws.c ... tes_v2.pdf

The idea would be to use this gradient as a mix value for the mix material node.
You can watch the substance PBR shader in liveDB to see an exemple of the idea.

For exemple if i want to do an anisotropic velvet. i would like to use a diffuse material to get the roughness in the diffuse, and a glossy material for ward anisotropic.
Today i need to make a mix at 50% to keep energy conservation.

But if i do so the color i have set in the diffuse will be fade away at angle 0. because i reduce it by 50%.
What i would prefer is to get
- diffuse mat at 100%
- glossy mat at 100%
- compute the fresnel map base on IOR value or disney value.
- multiply it by each bsdf to get energy conservation
in that scenario my diffuse color at angle 0 will be exactly like i have choosen in the shader color, i don't have to balance the reduction of intensity cause by the mix at 0.5.

Cheers
E

Re: Falloff Map base on IOR value.

Posted: Fri Mar 23, 2018 9:06 am
by milanm
Ah, I knew I saw that somwhere. Here's the OSL code that comes with C4DOctane. Not sure where it comes from but it looks exactly like what you're describing.

I hope that helps. At least as a starting point.

Code: Select all

float fresnel(float n, float k, float c) {
    float k2=k*k;
    float rs_num = n*n + k2 - 2*n*c + c*c;
    float rs_den = n*n + k2 + 2*n*c + c*c;
    float rs = rs_num/ rs_den ;
     
    float rp_num = (n*n + k2)*c*c - 2*n*c + 1;
    float rp_den = (n*n + k2)*c*c + 2*n*c + 1;
    float rp = rp_num/ rp_den ;
     
    return clamp(0.5*( rs+rp ), 0.0, 1.0);
}
     
shader complex_ior(
    vector n=vector(0.27105, 0.67693, 1.3164) [[ string description = "Refractive index for red, green, blue wavelengths (f.e. for 0.65, 0.55, 0.45 micrometers)" ]],
    vector k=vector(3.6092, 2.6247, 2.2921) [[ string description = "Extinction coefficient for red, green, blue wavelengths (f.e. for 0.65, 0.55, 0.45 micrometers)" ]],
    output color Col_Out = color(0.5)
)
{
    float thetaCos = abs(dot(-I,N));
    float red=fresnel(n[0], k[0], thetaCos);
    float green=fresnel(n[1], k[1], thetaCos);
    float blue=fresnel(n[2], k[2], thetaCos);
    Col_Out=color(red, green, blue);
}
Regards
Milan

Re: Falloff Map base on IOR value.

Posted: Fri Mar 23, 2018 9:46 am
by fantome
Thanks a lot for the very informative answer Milanm !

I have not though about this , but that might be a great solution to use osl texture to do that.
i am using octane inside houdini. and i am not 100% sure that OSL texture is supported yet.
But that's definitly a good lead.

I will make some trial in octane standalone when i will have some time to play with osl.

I think we could also use OSL to implement the disney model IOR, which might be even easier, as i think it is probably a remap shlick fresnel.
Cheers
E