Community
Arnold for Cinema 4D Forum
Rendering with Arnold in CINEMA 4D using the C4DtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Render object flat and semi-opaque

8 REPLIES 8
Reply
Message 1 of 9
shawn
543 Views, 8 Replies

Render object flat and semi-opaque

I have a rigged model of a 3D man that I'm animating to look like it's drawing on a whiteboard. I want the model to render as a semi-transparent black silhouette. This can be easily done in multiple ways if I render the animation in two passes, one for the whiteboard setup and one for the man by himself.

I'm trying to figure out if it's possible to do this in one pass. The description of the Flat shader describes it as "A simple color shader node which just allows a color and opacity value to be combined, with no other effects. I can set the color to black, but there's no parameter to make it semi-opaque.

I've included an image showing the look I'm going for.

Thanks.

Shawn Marshall

861-black-silhouette-demo.jpg

8 REPLIES 8
Message 2 of 9
zenop
in reply to: shawn

You'd need to write your own custom shader for that. The transparency should only get evaluated at the first ray hit with the object. You can do this kind of stuff using the message passing API.

It'll be quicker, easier and more controllable to render this out in 2 layers and do the effect in post

Message 3 of 9
shawn
in reply to: shawn

Yeah, I won't be writing any custom shaders. Doing it in two passes is no big deal, just wondering whether I was missing something.

Thanks for the reply.

Shawn

Message 4 of 9
Shawn_Kearney1
in reply to: shawn

You do not need custom shader to do this, though it might be more efficient. Simply get the opacity from a lambert shader with weight set to zero, opacity to black. Then mix this with a flat shader and control opacity with the mix amount. See below (note though that opacity should be set to black).

Be sure to unselect "opaque" in your arnold settings, as you would for glass.

876-screen-shot-2018-01-25-at-115715-am.png

Message 5 of 9
Shawn_Kearney1
in reply to: shawn

I'm pretty sure you could also just use transmission with thin geometry and no specular if you're using the latest Arnold. If you do not need transmission to accumulate in alpha, then you could do it in earlier versions, also.

Message 6 of 9
maxtarpini
in reply to: shawn

Sometimes code is cheaper than talk 🙂

shader flat_transp
( color transp = 0.5, output closure color result = 0 )
{ result = transp*transparent(); }
Message 7 of 9
maxtarpini
in reply to: maxtarpini

Save it in a flat_transp.osl file and drop it into a folder where other shaders are loaded.

There is just a single param for transp as opposed to ie. flatcolor + opacity because of the way OSL deals with closures and colors.. closures can't be added over simple colors .. and 'flat' constant colors are actually 'emissive' closures .. and if not guarded against other ray evals they of course will illum the scene.. so here to keep it simple you have just a transp color to deal with.

Message 8 of 9
maxtarpini
in reply to: maxtarpini

Add another flat_transp.mtd if you want better GUI, shader being put in the shader folder etc. Here a basic one for Maya not sure what's needed for C4D.

[node flat_transp]   
    maya.name               STRING  "flat_transp"
    maya.id                 INT     0x00076543
    maya.classification     STRING  "shader/surface"
    maya.output_name        STRING  "outColor"
    maya.output_shortname   STRING  "out"
Message 9 of 9
zenop
in reply to: maxtarpini

Nice one.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report