Page 1 of 3

need help with Cinema4D fresnel

Posted: Wed Apr 10, 2013 4:11 am
by N.G.
How do I mix the materials through a Fresnel map?

need help with Cinema4D fresnel

Posted: Wed Apr 10, 2013 7:32 am
by zeitmeister
The C4D fresnel shader isn't supported.
Perhaps you can search this forum about fresnel; there is an effect with ISL you can use.

Re: need help with Cinema4D fresnel

Posted: Wed Apr 10, 2013 8:10 am
by wlf_alex
Who can show an example of how to use this effect in 4D?

Re: need help with Cinema4D fresnel

Posted: Wed Apr 10, 2013 10:11 am
by Mor4us

Code: Select all

def eval(vec3 pos) vec3 :
lerp(
vec3(0, 0, 0),
vec3(1.0, 1.0, 1.0),
maxCosTheta()
                   )
filled in an ISL Shader should do the trick
the both vec3() are the fresnel colors as rgb (1.0=255)
you can now blend your ISL Shader via "ISL Blend Shader" with the desired map or shader of your choice ;)

best regards

Re: need help with Cinema4D fresnel

Posted: Wed Apr 10, 2013 10:48 am
by wlf_alex
Many thanks, Mor4us! This topic really has been confirmed and you will do it again. It's really simple :-) But now another question. Is it possible to just mix the textures?

regards..

Re: need help with Cinema4D fresnel

Posted: Wed Apr 10, 2013 8:34 pm
by N.G.
How to fix error?

Re: need help with Cinema4D fresnel

Posted: Wed Apr 10, 2013 10:55 pm
by N.G.
why so difficult? :(

Re: need help with Cinema4D fresnel

Posted: Wed Apr 10, 2013 11:17 pm
by galinette
Hi NG,

I think minCosTheta and maxCosTheta cannot be used in a blend shader for physical reasons (it's then easy to break energy conservation). Also, you are using a color shader (returning a RGB vec3) in a blend shader slot (which must return a single number). Both are triggering errors.

So you should not use a blend material for this. Just use a diffuse or phong material, and use the shader in the diffuse channel.
For red/blue just use:

Code: Select all

def eval(vec3 pos) vec3 :
lerp(
vec3(1.0, 0, 0),
vec3(0, 0, 1.0),
maxCosTheta() )
Also, you could use minCosTheta instead of maxCosTheta, the effect will be slightly different.

I personally use 1.0 - pow(1.0 - (2.0/(1.0/maxCosTheta() + 1.0/minCosTheta())), 5.0) as the lerp function

Etienne

Re: need help with Cinema4D fresnel

Posted: Wed Apr 10, 2013 11:34 pm
by N.G.
galinette wrote:Hi NG,

I think minCosTheta and maxCosTheta cannot be used in a blend shader for physical reasons (it's then easy to break energy conservation). Also, you are using a color shader (returning a RGB vec3) in a blend shader slot (which must return a single number). Both are triggering errors.

So you should not use a blend material for this. Just use a diffuse or phong material, and use the shader in the diffuse channel.
For red/blue just use:

Code: Select all

def eval(vec3 pos) vec3 :
lerp(
vec3(1.0, 0, 0),
vec3(0, 0, 1.0),
maxCosTheta() )
Also, you could use minCosTheta instead of maxCosTheta, the effect will be slightly different.

I personally use 1.0 - pow(1.0 - (2.0/(1.0/maxCosTheta() + 1.0/minCosTheta())), 5.0) as the lerp function

Etienne
how can I mix the two textures then? I'm confused.

Re: need help with Cinema4D fresnel

Posted: Thu Apr 11, 2013 12:03 am
by N.G.
remains impossible to blend the two textures through Fresnel falloff, or error, or the effect is not the same. :(

Re: need help with Cinema4D fresnel

Posted: Thu Apr 11, 2013 12:59 am
by Zom-B
N.G. wrote:remains impossible to blend the two textures through Fresnel falloff, or error, or the effect is not the same. :(
exactly!

Re: need help with Cinema4D fresnel

Posted: Thu Apr 11, 2013 1:11 am
by N.G.
me sad. :?

Re: need help with Cinema4D fresnel

Posted: Thu Apr 11, 2013 1:23 am
by OnoSendai
It's possible, just requires some ISL.

Re: need help with Cinema4D fresnel

Posted: Thu Apr 11, 2013 1:27 am
by N.G.
OnoSendai wrote:It's possible, just requires some ISL.
Can you give an example? very need

Re: need help with Cinema4D fresnel

Posted: Thu Apr 11, 2013 1:30 am
by wlf_alex
N.G. wrote:
OnoSendai wrote:It's possible, just requires some ISL.
Can you give an example? very need
+10
pls-pls-pls !!!