need help with Cinema4D fresnel

Announcements, requests and support regarding the Cinema 4D exporter
User avatar
N.G.
Posts: 36
Joined: Tue Dec 18, 2012 1:31 am
Location: Russia

need help with Cinema4D fresnel

Post by N.G. » Wed Apr 10, 2013 4:11 am

How do I mix the materials through a Fresnel map?
Attachments
True_Fresnel_1_6.jpg
correct operation Freznel.
Fresnel_1_6.jpg
Fresnel 1.6
Fresnel_1_6_blend.jpg
Fresnel 1.6_blend

User avatar
zeitmeister
2nd Place 100
Posts: 2010
Joined: Tue Apr 22, 2008 4:11 am
Location: Limburg/Lahn, Germany
Contact:

need help with Cinema4D fresnel

Post by zeitmeister » Wed Apr 10, 2013 7:32 am

The C4D fresnel shader isn't supported.
Perhaps you can search this forum about fresnel; there is an effect with ISL you can use.
Cheers, David



DAVIDGUDELIUS // 3D.PORTFOLIO
·
Indigo 4.4.15 | Indigo for C4D 4.4.13.1 | C4D R23 | Mac OS X 10.13.6 | Windows 10 Professional x64

User avatar
wlf_alex
Posts: 99
Joined: Tue Aug 28, 2012 9:26 pm
Location: Russia-Moscow, Spain-Alicante
Contact:

Re: need help with Cinema4D fresnel

Post by wlf_alex » Wed Apr 10, 2013 8:10 am

Who can show an example of how to use this effect in 4D?
ArchiCAD 14, Cinema 4D r13, IndigoRender, VrayforC4D

Mor4us
3rd Place Winner
Posts: 129
Joined: Mon Mar 07, 2011 5:46 am
3D Software: Cinema 4D
Contact:

Re: need help with Cinema4D fresnel

Post by Mor4us » Wed Apr 10, 2013 10:11 am

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
C4D R20 Studio
mad-imagery.com

User avatar
wlf_alex
Posts: 99
Joined: Tue Aug 28, 2012 9:26 pm
Location: Russia-Moscow, Spain-Alicante
Contact:

Re: need help with Cinema4D fresnel

Post by wlf_alex » Wed Apr 10, 2013 10:48 am

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..
ArchiCAD 14, Cinema 4D r13, IndigoRender, VrayforC4D

User avatar
N.G.
Posts: 36
Joined: Tue Dec 18, 2012 1:31 am
Location: Russia

Re: need help with Cinema4D fresnel

Post by N.G. » Wed Apr 10, 2013 8:34 pm

How to fix error?
Attachments
Снимок_02.jpg
def eval(vec3 pos) vec3 :
lerp(
vec3(0, 0, 0),
vec3(1.0, 1.0, 1.0),
maxCosTheta()
)
Снимок_01.jpg

User avatar
N.G.
Posts: 36
Joined: Tue Dec 18, 2012 1:31 am
Location: Russia

Re: need help with Cinema4D fresnel

Post by N.G. » Wed Apr 10, 2013 10:55 pm

why so difficult? :(

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: need help with Cinema4D fresnel

Post by galinette » Wed Apr 10, 2013 11:17 pm

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
Eclat-Digital Research
http://www.eclat-digital.com

User avatar
N.G.
Posts: 36
Joined: Tue Dec 18, 2012 1:31 am
Location: Russia

Re: need help with Cinema4D fresnel

Post by N.G. » Wed Apr 10, 2013 11:34 pm

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.

User avatar
N.G.
Posts: 36
Joined: Tue Dec 18, 2012 1:31 am
Location: Russia

Re: need help with Cinema4D fresnel

Post by N.G. » Thu Apr 11, 2013 12:03 am

remains impossible to blend the two textures through Fresnel falloff, or error, or the effect is not the same. :(

User avatar
Zom-B
1st Place 100
Posts: 4700
Joined: Tue Jul 04, 2006 4:18 pm
Location: ´'`\_(ò_Ó)_/´'`
Contact:

Re: need help with Cinema4D fresnel

Post by Zom-B » Thu Apr 11, 2013 12:59 am

N.G. wrote:remains impossible to blend the two textures through Fresnel falloff, or error, or the effect is not the same. :(
exactly!
polygonmanufaktur.de

User avatar
N.G.
Posts: 36
Joined: Tue Dec 18, 2012 1:31 am
Location: Russia

Re: need help with Cinema4D fresnel

Post by N.G. » Thu Apr 11, 2013 1:11 am

me sad. :?

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: need help with Cinema4D fresnel

Post by OnoSendai » Thu Apr 11, 2013 1:23 am

It's possible, just requires some ISL.

User avatar
N.G.
Posts: 36
Joined: Tue Dec 18, 2012 1:31 am
Location: Russia

Re: need help with Cinema4D fresnel

Post by N.G. » Thu Apr 11, 2013 1:27 am

OnoSendai wrote:It's possible, just requires some ISL.
Can you give an example? very need

User avatar
wlf_alex
Posts: 99
Joined: Tue Aug 28, 2012 9:26 pm
Location: Russia-Moscow, Spain-Alicante
Contact:

Re: need help with Cinema4D fresnel

Post by wlf_alex » Thu Apr 11, 2013 1:30 am

N.G. wrote:
OnoSendai wrote:It's possible, just requires some ISL.
Can you give an example? very need
+10
pls-pls-pls !!!
ArchiCAD 14, Cinema 4D r13, IndigoRender, VrayforC4D

Post Reply
34 posts

Who is online

Users browsing this forum: No registered users and 38 guests