Announcement

Collapse
No announcement yet.

Shadow cast on two objects from one light, but only hit one object.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Shadow cast on two objects from one light, but only hit one object.

    Hi there,

    I have a crowd in a stadium, and i'm using a shadow catcher on the stadium to collect the crowd shadows. The problem is. I have one light, and a plane set up to act as a flag to craft the light more. I need the crowd to cast a shadow on the stadium so I can't set the stadium to not recieve shadows. but NOT the flags to cast shadows on the stadium.

    So the shadow from the flags needs to go onto the crowd but NOT onto the stadium. From one light.

    Anyone know how to do this?

    Thanks for any assistance!

    -Ethan

  • #2
    This is very perplexing. The selected objects need to be able to cast a shadow on the crowd, but NOT on the stadium. The stadium cannot be set not to receive shadows. And I can't tell the light NOT to cast shadows on the stadium.

    So i'm kind of stuck...

    Click image for larger version

Name:	example.PNG
Views:	1
Size:	30.4 KB
ID:	855651

    Comment


    • #3
      I think this can be done using light/shadow linking and duplicated lights. I've attached an example, so you can see if it will do the job for your project.
      Basically, I have a plane, a cube on top of it and a sphere on top of the cube. I have two lights.
      - light1 lights everything except the plane
      - light2 lights only the plane and has no shadow links with the sphere

      So in this setup, the lighting remains the same (hopefully) and the sphere casts shadows only on the cube, while the cube casts shadows only on the plane (it doesn't matter here if the plane is a matte object or not).

      This is the simplest solution I could come up with, although I tried shadow overrides using distanceTex, but things get a bit complicated there. If I can find a way to make it work with DistanceTex or something similar, it will help avoid using duplicated lights.

      shadow_linking.zip
      Alex Yolov
      Product Manager
      V-Ray for Maya, Chaos Player
      www.chaos.com

      Comment


      • #4
        Thanks for the suggestion it is .... kind of working.. but not quite for my purpose. The problem is because I'm using Goleam crowd which creates a vrayrenderproxy to render it's crowds. And that does not show up in the relationship editor. So both lights hit the crowd even though the shadow problem is now solved. I have my single stadium light getting put into a render pass with light select. So I can just capture that one lights accumulation in a pass. And add it to the GI pass in comp. But it makes it so the beauty pass it not usable because it contains both lights. This is probably alright I suppose so it's at least most of a solution.

        Another way I tried to get around the problem was to just create a silly spotlight so that I wouldn't need flags, but the shadows from that spot light were way too dark for some reason in AE comp. (Using no color management and a gamma 2.2 on the assembled layers) And I couldn't figure out a way to get just that shadow into a pass for that individual spot light so that I could fix the fact that the spot shadows were too dark. So that was a bit of a dead end.

        Any ideas on why the spotlight shadows are too dark in the alpha channel? It seems like there should be a much easier way to get a shadow pass for an individual light. It isn't in the list on light select.

        Thanks for the help I appreciate it!

        Comment


        • #5
          I don't think that it's possible to get the shadows for a current light, at least I can't think of a way atm.
          As for the spot light's shadows - I'm assuming they fall onto a matte object if you can see them in the alpha (alpha contribution = -1). You can try and increase the "shadow brightness" in the matte properties (vray object properties) and see if that works.
          Last edited by yolov; 25-03-2015, 02:08 PM.
          Alex Yolov
          Product Manager
          V-Ray for Maya, Chaos Player
          www.chaos.com

          Comment


          • #6
            OK, I got it to work without using light/shadow linking. Instead I'm using a single light and vray additional outputs for the samplerInfo node like this:
            I've assigned an objectID=0 to the plane and objectID=1 for the cube.
            The sphere has a material override > shadow material where I've plugged a vraySwitchMtl.
            Now the switchMtl slot0 is a transparent material and slot1 is an opaque material. The switch itself is the samplerInfo.parentObjectID (which is accessible by adding vray attributes > additional outputs to the samplerInfo).
            The parentObjectID has to be used instead of the objectID output, because this relates to the shadows rays casted from the light, and the parent in my scene is the plane.

            This way, the sphere's shadows will be opaque when they hit the cube and transparent when they hit the plane. In other words the sphere will cast shadows only on the cube.

            I think this is a better approach than the one before. I hope this is helpful.

            Here's the scene: shadow_linking.0001.ma.zip
            Alex Yolov
            Product Manager
            V-Ray for Maya, Chaos Player
            www.chaos.com

            Comment


            • #7
              Cool solution! Thank you!

              Comment

              Working...
              X