PDA

View Full Version : Light shining through geometry


volderette
07-22-2010, 04:28 PM
Hello,

i came up with a strange problem in maya. I have two pretty basic objects in a scene and put them on top of each other. Now if i put a light inside the bottom object there is light emitting through the cube and hitting the upper one.

I dont understand why there would be any reason for that.

Screenshot (Two extruded cubes with a point light in the bottom one):
http://forums.cgsociety.org/attachment.php?attachmentid=155021&stc=1
The render:
http://forums.cgsociety.org/attachment.php?attachmentid=155022&stc=1

robitabu
07-22-2010, 04:38 PM
You have to properly set the shadow attributes in the Point Light; you have to "tell" the renderer that the Point Light has to cast shadows on other objects if something is on the way.

1) pointLightShape1 -> Shadows -> Depth Map Shadow Attributes -> Use Depth map Shadows
or
2) pointLightShape1 -> Shadows -> Raytrace Shadow Attributes -> Use Raytrace Shadows

In case 2) you also have to activate Raytracing Quality:
Render Settings -> Maya Software -> Raytracing Quality -> Raytracing

volderette
07-22-2010, 04:41 PM
Thanks, that was really fast. Is there a reason for this?

robitabu
07-22-2010, 04:45 PM
Kleine Hilfe aus Italien ... glad to be usefull.
Viel Spass mit Maya :-)

robitabu
07-22-2010, 04:46 PM
Thanks, that was really fast. Is there a reason for this?

Being fast on replying or the shadow stuff?

volderette
07-22-2010, 04:58 PM
Haha, concerning the shadow stuff. Say i really want a light which is not casting any shadows even though its physically not correct. How would i set it up to prevent it from shining through stuff.

chafouin
07-22-2010, 05:22 PM
Every light will lit the polygons that are pointing toward it, and in the range of the light. That is how 3d light works. If you don't cast shadow, then the light won't know that the object is behind another object :)

robitabu
07-22-2010, 08:21 PM
Haha, concerning the shadow stuff. Say i really want a light which is not casting any shadows even though its physically not correct. How would i set it up to prevent it from shining through stuff.

Ok Andi, I'll try clearing up the point with a short example.
Let's say you have pointLight1, pCube1, pPlane1 (positioned on a row, one after another, so that pointLight1 comes first, then pCube1 in the middle and a big pPlane1 at the end, representing something like a big wall behind), now set the camera at a side, in order to look pCube1 and pPlane1 behind it.
1) Setting pointLight1 as not casting any shadow (default settings), at render time, the renderer sees every point of pPlane1 being lit by pointLight1 (not casting shadows means nothing will stop the light from lighting every 3d surface pointing towards it).
2) Setting pointLight1 as casting shadow, at render time, the renderer sees some points of pPlane1 being lit by pointLight1 and some others not, that's because a part of it is obscured by pCube1 sitting in the middle.

Simply put, the renderer doesn't basically know anything about any shadow! It just looks for light reaching a surface or not. If you don't want a light from reaching a surface you have to force the render somehow, that's generally called "Shadow Casting": you put an object in between, you set the light as Casting Shadow, and ... voilą, light is not lighting something behind it anymore.

You can cheat, of course, you'll have to make use of light-linking, but that's no basic stuff. If you really need that, you can go for it and make your lights do pretty cool stuff.
Take a closer look at Maya Light Linking documentation, it's worth spending some time on learning about it. Light Linking is a precious tool when you render very complex scenes and you want full control on lighting.

Bis bald :-)

volderette
07-23-2010, 01:25 PM
Thanks a lot for this detailed explanations! And even some german text in there ;-)

CGTalk Moderation
07-23-2010, 01:25 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.