Final Gathering "Shadow" Pass ?


#1

Hi all.

Apologies if this has been dealt with before, searching got me nowhere. I 'm also posting this in both XSIbase and CGtalk, so I hope that’s ok too (some people only follow one board). Here’s my issue :

Getting a shadow pass when using actual lights is simple and straightforward. But I am setting up a scene that is completely lit by an HDR image, using FG. No actual lights at all. How can I get a shadow pass for my “shadow catcher” object ?

If there’s something simple or obvious that I 'm missing, I 'd appreciate just a pointer to the right direction…

Thanks everyone.

nick


#2

FG doesn’t produce any shadow like Cg light.
what you see as a “shadow” is the light not able to reach this part of the image. Because light is occluded.
If you use an HDR image you can also try to turn it to a greyscale image, that will probably give what you are looking for.


#3

Of course FG doesn’t produce a “Shadow” in the classic CG sense (and that’s exactly why I am having this problem :)), I used the term “shadow” literally, as in “area not lit because illumination is occluded”.

If you use an HDR image you can also try to turn it to a greyscale image, that will probably give what you are looking for.

I 'm sorry, I don’t quite get this, could you please elaborate ? How would using a greyscale version of my HDR give me a “shadow” pass ?

Thanks for your reply, I 'll keep trying :slight_smile:

nick


#4

Use regular lights and create a separate shadow pass, compose final gathering pass and shadow pass afterward.

Of course you will have to somewhat mimic the lighting situation of the final gathering pass/ HDR image with the lights so the direction and intensity of the shadows make sense. If the lighting of the FG pass is quite consistent/ evenly bright (meaning more or less the same amount of light from all directions) it might not be necessary to create a shadow pass at all.


#5

Thanks for your reply, but rebuilding the lighting with standard XSI lights just to get a shadow pass kinda defeats the use of HDRI-based lighting in the first place, doesn’t it ?
Plus, my original problem was how to get a “shadow” pass without actual lights. Adding lights changes the basic scenario of the question :slight_smile:

It’s ok, I got it covered now.


#6

Obviously, I did not mean that you should rebuild the entire lighting situation of your HDR image with regular lights. That would be a far too complex task. All you need to do is to identify the general direction of the light (the brightest spot(s) in your HDR image) so the shadows generated by the regular lights will be cast into a plausible direction. You just need to create 1, maybe 2 lights that do nothing but cast shadow.

My advice reveals insolvable assumptions on your side that need to be circumvented, yes. If you just need shadows without any actual light direction use ambient occlusion. There is an ambient occlusion shader somewhere on the net that generates directional ambient occlusion also.

One small concluding advice: doing the smart-ass dance will not make people want to help you solve your problems.


#7

Come on, ezekiel, hold on please. There was nothing smart-ass-y about my reply, at least not intentionally, so please don’t take it that way. Like you probably, I 've been on discussion boards for ages; enough to know good behavior makes for good discussions - even more so when one is asking for help.

  What in my reply sounded bad to you ?
  
  I asked for a way to isolate the "shadow" (unlit areas) of an FG illuminated scene, [i]when no actual lights are used[/i]. Your suggestion, although welcome and appreciated, involved ...adding actual lights. And I simply pointed out that this suggestion deviated from the original problem. It's like asking "how can I get there without taking the bus ?" and getting a reply "you have to take the bus". Not being able to come up with a solution right away does not necessarily "reveal [i]insolvable[/i] assumptions on my side".
  
  As for rebuilding the HDRI lighting with actual lights, you did say [i]"you will have to somewhat mimic the lighting situation of the final gathering pass/ HDR image with the lights"[/i] - so maybe I interpreted that the wrong way.
  
  I hate it when I have to tip-toe around posting in boards, watching every word, every comma or period, because some people are always quick to misjudge. I could just as easily be offended for being called a smart-ass with no reason - but of course I 'm not.

Still, thanks for taking the time to deal with my problem in the first place. Like I said, it's ok now, so let's move on :)

#8

Hi nixx,

Do you mind if I ask how you solved your problem?

cheers
matt


#9

there was a pluging time ago, that can convert a HDRI into actual lights creating a dome around it.

not sure if was for xsi, i know for sure that was for lightwave, and i think XSI all ready come with an option to do something similar.

check under Creating a Light Rig from an Image on the help F1

if you get that then you can use a shadow pass with no problem.


#10
  Ah, of course Matt, I should have done that from the start, I got distracted, sorry :). The solution is actually pretty simple and straightforward.
  
  Setup a new rendering pass. Hide all "shadow-casting" objects from camera (by "shadow-casting" I mean objects that occlude the FG illumination, thus in effect creating a "shadow"), and make your "shadow-catcher" object 100% white diffuse, nothing else. Then, in its render tree, make its shading grayscale with an "adjust saturation" node (because FG illumination is probably colored, and you don't want that), then invert it.
  
  Render this pass and you 'll end up with a white matte on a perfectly black background, that you can composite in various different ways over your live-action (or whatever other background) plate to create your FG "shadow".
  
  That's the basic idea - it works perfectly, even in more complex scenarios (with reflections, other objects in the way, etc), although the approach might need to be adapted depending on the case.

I hope I described it well. It’s one of those things that’s easier done than said :stuck_out_tongue:

  nick

#11

Thanks for the explaination nick - think it’s pretty clear (when you hide the shadow caster objects you’re just turning primary rays off right? Because you still need secondary rays to create the occlusion on the ground plane?)

As you can tell I’m not much of a lighter :wink:
cheers
matt


#12

Hey Matt -
Yes, exactly, the secondary rays are on our side :). Let me know if you run into any problems.

nick


#13

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.