PDA

View Full Version : Question about Jeremy Birn Lighting Technique


Redsand1080
09-25-2010, 07:01 PM
In Jeremy Birn's book he offers some suggestions for lighting large fields filled with grass. One of the techniques is to use an array of spotlights with very narrow cone angles moved a large distance away from the scene to simulate key light from the sun. The idea is to use depth map shadows, optimally set to 'deep' or 'detailed' mode, on each one of these spots.

However, after some tests using this method shadow maps aren't behaving the way I would like when moved a large distance away from the scene. When spotlights are up close to an object and focused directly on it with a cone angle of around 40 degrees, spotlights produce nice detailed depth map shadows on my fur/grass. However, when I cut the cone angle in half to 20 degrees and move the spotlight farther away to compensate the depth map gets much softer. The spotlight is still framed specifically on that object to make optimal use of the depth map, it is just further away. The problem gets worse when I cut the cone angle in half again to 10 degrees and move the spotlight even further away to compensate.

The problem is I need the spots to be far away from the scene to simulate the sun so that my shadows remain close to parallel, but when I move the spotlight far away my shadows get extremely soft even if I still focus the light on a very small area. What do I do to get around this Catch 22 type of behavior?

Here is an example demonstrating the problem. In this example I am using one spotlight and one sphere with maya fur set to default grass settings. I am rendering with mental ray, my spot light is using mental ray shadow map overrides set to detail shadow map with following parameters:

Resolution: 1024
Samples: 64
Softness: .003
Bias: 0.000

Detail Shadow Map:
Samples: 0
Accuracy: 0.000

These settings remain consistent for all 3 renders. The only thing that changes is the cone angle and the distance between the spot light and the object. In each image the spot light is moved further and further away to compensate for the reduced cone angle.

http://www.empyreal-animation.com/coneAngleEffectOnFurShadows.jpg

Any tips or suggestions from anyone with knowledge on this sort of work flow would be greatly appreciated.

Thanks,

Justin

kanooshka
09-26-2010, 02:30 PM
Not sure if these would be the best solutions but you could try turning the softness down more or increasing the depth map size.

Redsand1080
09-26-2010, 02:41 PM
Thanks for the suggestions kanooshka, really appreciate that! Unfortunately the softness values are down nearly as far as I am able to set them in the UI. The lowest I can set the value for softness is .001 and I'm at .003, the difference between those 2 values is nearly imperceptible. Also, the depth map size was not making as much of a difference as I would expect, I cranked it up to 2048 and still experienced extremely soft shadows off the individual blades. In Jeremy's book he makes it seem like increasing the depth map size over 1024 isn't needed even for feature film res, so I figured I must be doing something wrong with my set up if I needed to go over 1024 to achieve the desired result. I'm just unable to pin down where exactly my error is occurring.

earlyworm
09-27-2010, 05:08 PM
Just a thought (and I guess this might depend on your renderer). You could try adjust the clipping planes on the lights to just take in the object your lighting - it might help with the precision of the depth map if it's values aren't spread out over such a long distance.

Redsand1080
09-27-2010, 07:59 PM
Just a thought (and I guess this might depend on your renderer). You could try adjust the clipping planes on the lights to just take in the object your lighting - it might help with the precision of the depth map if it's values aren't spread out over such a long distance.

That's an excellent idea! Unfortunately I'm not sure how to do that in Maya/mental ray. The only thing I know to do is turn 'cast shadows' off on any large ground planes in the scene so that their bounding box doesn't effect depth map.

Do you have any suggestions on how to accomplish that in a regular Maya/mental ray workflow?

Thanks,

Justin

InfernalDarkness
10-03-2010, 06:58 PM
Not to naysay your method, or Jeremy's, at all... But is there any reason you're not just using a sun/sky and Final Gather? It'll make for much more convincing grass, with far, far less hassle. Granted, rendertimes are a factor. But if you need a directional light, that's the way to go. Or am I missing the reasoning behind using spotlights and shadow maps?

Redsand1080
10-04-2010, 01:44 AM
Not to naysay your method, or Jeremy's, at all... But is there any reason you're not just using a sun/sky and Final Gather? It'll make for much more convincing grass, with far, far less hassle. Granted, rendertimes are a factor. But if you need a directional light, that's the way to go. Or am I missing the reasoning behind using spotlights and shadow maps?

Well I wanted to compare the results of the two methods. I can take the mia_material/FG approach and get really nice results, but I wanted to see how good I could make it look using old school techniques. If I could find a way to get really nice results using the old school approach and cut my render times down I'd be all for it. I'm not opposed to the FG approach at all and I really like it, but I wanted to use this technique just because I like to be able to approach a problem from different angles just in case I need to in the future for some unforeseen reason. So I'm not under the gun for a deadline, just practicing different techniques. :)

earlyworm
10-06-2010, 05:59 PM
Unfortunately I'm not sure how to do that in Maya/mental ray.

Sorry - only Renderman. Just had a look at the Mental Ray docs, there is an option in there to set the shadowmap camera - no idea how to do that Maya - but it's possible that the camerashape (when you do a look-through-selected) attached to the light gets linked up to those mental ray settings - so adjusting the clipping planes on that camera might work.

So it looks like it might be possible - depending on Autodesk implementation of mental ray.

jeremybirn
10-07-2010, 03:11 AM
Hi Justin -

You can use a lower softness value in MR (try 0 for example.) In Maya you can just type the softness value down in the shadow map overrides section of a regular spotlight, I couldn't see the interface limitation you were describing. Here's an image I just rendered in Maya with MR, with a spot light with a cone angle of 10:

http://www.3drender.com/light/Redsand1080.png

If you have enough memory (or a simple enough grass example) you certainly could make life easier by using raytraced shadows. The whole reason that most people avoid raytracing against hair, fur, grass, or vegetation is because it could use up all your memory and slow down or crash the rendering. In the past 5 years I've seen more people go ahead and raytrace even for fairly complex vegetation, though, provided there's enough memory available.

Even if Maya doesn't give you as much control as you might like over cameras for each dmap, you can get decent images out of Maya with dmap shadows. Sometimes you need a more focused dmap shadow around a small foreground area, and broader ones off in the distances, adapting to whatever you need to see in the scene.

-jeremy

Redsand1080
10-14-2010, 02:02 PM
Thanks so much for the great advice! I will definitely give those suggestions a try!!


@jeremybirn: Well in the UI for mental ray dmap softness the lowest I can set the value is .001 untill it goes right to 0. I was hoping I could try .0005 or something instead of having perfectly sharp shadows. But I do have the option to just set it at 0. Thanks again for your help!

-Justin

kanooshka
10-17-2010, 01:33 PM
Here's a workaround I figured out.

If you right click on the softness parameter and then do create expression. You can create values to greater precision with an expression like:

lightname.smapSoftness = 0.0001;

It seems the decimal precision is solely a UI thing in Maya.

Redsand1080
10-17-2010, 03:10 PM
Here's a workaround I figured out.

If you right click on the softness parameter and then do create expression. You can create values to greater precision with an expression like:

lightname.smapSoftness = 0.0001;

It seems the decimal precision is solely a UI thing in Maya.

Great idea! That's an excellent workaround. Thanks much!

-Justin

CGTalk Moderation
10-17-2010, 03:10 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.