PDA

View Full Version : Surface Shader with shadows?


bry
04-25-2005, 03:55 PM
Hi,

I need a material to behave like a Surface Shader (no shading or illumination) but I need it to still receive shadows, how can I do it?

thanks,
Bruno

lovisx
04-25-2005, 04:18 PM
me too, some way other then compositing.

Pete2003
04-25-2005, 04:22 PM
Two passes: One surface shader pass, another shadows pass (you probably want to assign a white lambert material and set the ambient to white as well, also make the background white).

Multiply the shadows on top of the surface shader in post.
Thats just one way of doing it, im sure there are others...

Pete.

EDIT: Argh, okay other than compositing :) ...
Im not sure but what happens if you assign a lambert material to your object, set the colour AND ambient to the colour that you want the object to be. Hopefully this gives the same effect as the surface shader? (Not got time to check though so could be wrong :)

Another way I can think of would be to have 2 objects, one slightly scaled up with a 'Use Background' shader applied but set to still receive shadows, whilst the smaller object is your surface shader. If your object has an irregular shape ull need to scale the duplicate object up by using the sculpt polys tool, set it to pull and set the value to something very low, then click flood.

Easier to do it in post tho :)

deadplant155
04-25-2005, 05:08 PM
try a 'use background shader' and make the camera's environment white.

:edit: didn't wanna make a whole new post, so in response to pete2003, ya, i didn't really think about that, you can make the background whatever color you need and the use background shader will match it, so this won't work if you want the background and the floor plane to be a different color...sorry.

Pete2003
04-25-2005, 07:05 PM
try a 'use background shader' and make the camera's environment white.

Yepp, that would give a shadow pass, but I understood that the shadows needed to be on top of a 'flat colour' pass for the object.

lovisx
04-25-2005, 09:26 PM
but if you change the enviorment color of your camera to white the reflections and refractions look awful.


edit: looks fine sorry, I'm wrong.

Puppet|
04-26-2005, 08:38 AM
If you use mental ray.
You may try use this p_shadow shader and multiply it to p_constant shader and you'll get what you want.

http://www.puppet.cgtalk.ru/download/shaders_p_e.shtml

MasonDoran
04-26-2005, 11:22 AM
use Puppet's shadow shader with Pixero's mix20layer or Francesca's mix8layer shaders....set it up just like you would in photoshop

just tested it and it works

bry
04-26-2005, 03:54 PM
use Puppet's shadow shader with Pixero's mix20layer or Francesca's mix8layer shaders....set it up just like you would in photoshop

Hi,

could you provide the links please?

thanks,
Bruno

Craiger
04-26-2005, 04:05 PM
the whole purpose of a surface shader is so it is not affected by lights. You have to do this in two passes, unless you can find some crazy script somewhere. It shouldn't be a big deal to do an A over B comp.

ftaswin
04-27-2005, 08:18 AM
Create a Lambert, standard
Create a Ramp (do not need 2dPlacement) White on .3 and black on 0
Create a shadingMap shader

Put the lambert out color to 'color' and Ramp to 'shadingMapColor' on shading Map shader. This is used to map the light and dark section on the object hit by the light.

Get a BlendColors node

Put Shading Map out color.R (or G or B doesn't matter since its only black and white information) to 'blender', set color 2 to black (shadow color) and map color 1 to any texture you want to appear in Surface shader color.

Get Surface Shader.

last, Map blendColors out Color to Surface Shader.Color

That's it.

Works well with more than 1 lights too. Remember, get a lambert, not blinn or else which has hilight (specular) information which we do not need.

Hope it helps...

Attached is the shader network

FT

bry
04-27-2005, 02:41 PM
Hi,

thanks for your help.
It still surprises me though, that we have to go such a long way to do this!
I'm used to Cinema4D where ANY kind of material can be turned into a Surface SHader that receives shadows with just adding a Compositing Tag and checking "Compositing Background".

anyway, thanks!


Bruno

ftaswin
04-28-2005, 12:53 AM
I used Cinema4D as well. Loved it.

but then again, like comparing apple and orange.

With Maya you can always push the nodes to whatever you need/want as long as you have solid understanding of those nodes.

I even struggling adjusting fresnel ramp in C4D to my custom :P. Sound simple heh?

bry
04-28-2005, 03:41 PM
I used Cinema4D as well. Loved it.

but then again, like comparing apple and orange.

With Maya you can always push the nodes to whatever you need/want as long as you have solid understanding of those nodes.

I even struggling adjusting fresnel ramp in C4D to my custom :P. Sound simple heh?

Sure, I can see both sides to both apps...
It would be great to have a shader tree or even being able to map different shaders to different "colors" of a gradient (ramp) in C4D, but it would also be really easy and extremely useful to have a checkbox in a Maya Surface Shader to allow for shadow support!

When it comes to compositing, Maya feels quite poor, specially when you can render out Cinema4D files as a multi-pass After Effects or Final Cut Pro project!

Bruno

CGTalk Moderation
04-28-2005, 03:41 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.