Cinema 4D Shader Support

Announcements, requests and support regarding the Cinema 4D exporter
forgeflow
Posts: 63
Joined: Thu Oct 29, 2009 5:26 pm
Location: Canada
Contact:

Cinema 4D Shader Support

Post by forgeflow » Thu Nov 15, 2012 4:29 am

I'm messing around with the latest build of Cindigo, and was really excited to discover that there is now support for Cinema 4D's noise and procedural shaders. My excitement abated somewhat when I discovered that none of the shaders that require surface normal information work. This would include useful shaders like fresnel, falloff, and ambient occlusion. So that was kind of a bummer. Fresnel in particular is a very important effect - it would be great if Indigo had some internal way of interpreting a C4D Fresnel gradient. Fresnel effects just can't be baked into a texture map, so there is no easy work-around for this.

I also noticed that an Indigo menu appears in the shader list. Selecting "Indigo/Indigo ISL Shader" while in an Indigo Material produced the following error:
Screen Shot 2012-11-14 at 10.24.24 AM.png
error generated when using an Indigo ISL Shader in an Indigo material.
This error doesn't show up when using the Indigo ISL Shader in a Cinema 4D material.

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

Cinema 4D Shader Support

Post by zeitmeister » Thu Nov 15, 2012 8:28 am

I am longing for Fresnel support for a very long time, too.
About AO: you could try to bake it seperately in C4D.
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
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Re: Cinema 4D Shader Support

Post by CTZn » Thu Nov 15, 2012 11:30 am

AO could be emulated with a grey clay render of an uniform environment with a suitable tonemapping. Burning the image out would be like reducing the AO distance, though it might be more appropriate to work later on the EXR output..
obsolete asset

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

Re: Cinema 4D Shader Support

Post by Zom-B » Thu Nov 15, 2012 11:54 am

forgeflow wrote:I also noticed that an Indigo menu appears in the shader list. Selecting "Indigo/Indigo ISL Shader" while in an Indigo Material produced the following error:
Screen Shot 2012-11-14 at 10.24.24 AM.png
This error doesn't show up when using the Indigo ISL Shader in a Cinema 4D material.
That is because you load up the ISL Shader that is empty.... the empty code free shader generates that error while C4D tries to render a preview of the material.

Simply past the following code into the code window if you click the shader once to get some fresnel style of effect:

Code: Select all

def eval(vec3 pos) vec3 :
                  lerp(
                    vec3(0.9, 0.2, 0.2),
 					vec3(0.5, 0.5, 0.1),
                    maxCosTheta()
                   )
polygonmanufaktur.de

forgeflow
Posts: 63
Joined: Thu Oct 29, 2009 5:26 pm
Location: Canada
Contact:

Re: Cinema 4D Shader Support

Post by forgeflow » Thu Nov 15, 2012 2:21 pm

Simply past the following code into the code window if you click the shader once to get some fresnel style of effect:
I tried it with this: (should be from black at the edge to almost white):

Code: Select all

def eval(vec3 pos) vec3 :
lerp(
    vec3(0,0,0),
    vec3(0.9,0.9,0.9),
    maxCosTheta()
    )
Result:
kerbleh.png
The effect is there... but pretty subtle. Most of that code is mumbo jumbo to me... but I suspect that it's black on the side facing away the camera, and I'm just seeing it creeping around the edge. Is there a way to make the effect more pronounced (like doubling maxCosTheta() or something?) I tried some stuff but all I got was errors.

I also tried this:

Code: Select all

def eval(vec3 pos) vec3 :
lerp(
    vec3(-0.9,-0.9,-0.9),
    vec3(0.9,0.9,0.9),
    maxCosTheta()
    )
Which produced this weird result:
kerbleh2.png
The transition is oddly abrupt, and the effect isn't visible at all in the portion illuminated by bounce light from the floor.

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

Re: Cinema 4D Shader Support

Post by Zom-B » Thu Nov 15, 2012 8:27 pm

hey forgeflow,

yes, that is no real fresnel we do here, but some coloring based on normal direction :/
Access to a real Fresnel output would be indeed great for many effects.

I used fresnel also a lot in my C4D shaders (and still do) but for Indigo I actually learned to work with the physical based materials, so using Fresnel would harm that physical correctness in most cases...

But lets see what the new material stuff brings that will come during 3.6 betas, maybe we get lucky :)
polygonmanufaktur.de

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

Re: Cinema 4D Shader Support

Post by Mor4us » Fri Nov 16, 2012 2:56 am

if you're staying with physical material setup I actually can't see any need (with few exceptions) for a fresnel...
C4D R20 Studio
mad-imagery.com

forgeflow
Posts: 63
Joined: Thu Oct 29, 2009 5:26 pm
Location: Canada
Contact:

Re: Cinema 4D Shader Support

Post by forgeflow » Fri Nov 16, 2012 7:17 am

if you're staying with physical material setup I actually can't see any need (with few exceptions) for a fresnel...
But what you are saying there is that I can't have both. If I want physical accuracy in the lighting of my scene, I have to relinquish artistic control over it. That either I get full control over my shaders and their appearance in the final render, or I get material and light-field accuracy but I have to live with whatever I get because it's "accurate". I don't believe this has to be an either/or situation.

I'm not joining a religion - I just want a better rendering engine.

Example: I've done renders of outdoor objects, and while it might be technically "correct" that some of the shadows are filled with bounced light from other objects, the fidelity of the details on the object itself might suffer as a result. So there's two cures - become a lighting director and fiddle around with the lighting forever to get the right contrast in those problem areas, or tweak the material setup so it gets a little darker at oblique angles, or use ambient occlusion to add a bit more contrast to high detail areas. With Indigo, I'm short a couple of tools in my toolkit. I think that's understandable that I'd want to keep them while gaining all of the other advantages of using it.

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

Re: Cinema 4D Shader Support

Post by OnoSendai » Fri Nov 16, 2012 9:02 am

Hi Forgeflow,
We will be re-introducing the 'fresnel-scale' parameter to the phong material soon, which might help you a bit. you can use it reduce Fresnel reflectance.

forgeflow
Posts: 63
Joined: Thu Oct 29, 2009 5:26 pm
Location: Canada
Contact:

Re: Cinema 4D Shader Support

Post by forgeflow » Fri Nov 16, 2012 11:02 am

OnoSendai wrote:Hi Forgeflow,
We will be re-introducing the 'fresnel-scale' parameter to the phong material soon, which might help you a bit. you can use it reduce Fresnel reflectance.
Will it be a general shader (like the ISL noise or gradient shaders) that can be used in any texture channel, or is it an effect limited to the material reflectance?

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

Re: Cinema 4D Shader Support

Post by OnoSendai » Fri Nov 16, 2012 11:28 am

It's not a general shader, it's just a parameter for Phong.
You can drive it with a texture or ISL if you want though.

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

Re: Cinema 4D Shader Support

Post by Zom-B » Fri Nov 16, 2012 12:18 pm

forgeflow wrote:I'm not joining a religion - I just want a better rendering engine.
my lol of the day ^^

But actually its quite religious if you enter the "unbiased rendering" camp...
Artistic freedom is something you aim for, if you are not able to get your stuff done right the traditional way, by setting lights and choosing object position etc. the right way.

But since we are not in Victorian england anymore, I also would suggest that there should be possibilities for young and eager customers to get a result they aim for!!

I'm more of a follower of the religion in getting my s**t done right, in a way that it works without the help of Mr. Special Shader, but indeed that takes time, that not every project has!

Loooooooong Story short:
you can bake your (UV mapped) C4D Fresnel Shaders in C4D to a texture and use it as you did before!
polygonmanufaktur.de

forgeflow
Posts: 63
Joined: Thu Oct 29, 2009 5:26 pm
Location: Canada
Contact:

Re: Cinema 4D Shader Support

Post by forgeflow » Sun Nov 18, 2012 5:10 am

Zom-B wrote:you can bake your (UV mapped) C4D Fresnel Shaders in C4D to a texture and use it as you did before!
Actually, you can't because the effect is view dependent. But anyway, I'll leave this argument for another day.

I have discovered a bug in Cindigo. Its very easy to reproduce:
Open up a new Cinema 4D document.
Create a new Indigo material.
In the color channel, select an ISL Gradient in the Texture Map selector.
Click on the gradient to edit it, and change it from 2D - U to 2D -V.
Wait a couple moments... bam, your Cinema 4D is now locked up.

This happens for me in Cinema 4D R13, on both my iMac at home running Snow Leopard, and my Mac Pro at work running Lion.

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

Cinema 4D Shader Support

Post by zeitmeister » Sun Nov 18, 2012 6:17 am

You can activate "use camera vector" in the material baking tag.
Won't work for animations and different camera angles, for sure.
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

forgeflow
Posts: 63
Joined: Thu Oct 29, 2009 5:26 pm
Location: Canada
Contact:

Re: Cinema 4D Shader Support

Post by forgeflow » Thu Nov 22, 2012 7:04 am

So... what is different about what i am asking for, and the contents of this topic:
http://www.indigorenderer.com/forum/vie ... f=7&t=7505
Which was posted by Indigo developers back in 2009? Looks like frensel shading to me? Does this stuff work in Indigo now?

Post Reply
17 posts

Who is online

Users browsing this forum: No registered users and 21 guests