Shadow filter

Is there a way to create a plane or a volume to make shadow rays to ignore collisions while in the volume or before crossing the plane?

It would help to fake more light coming from the sky in these situations without having to add practical lights under the canopy to light the characters.

Thanks!

[Attachment Removed]

Steps to Reproduce
Create a level with tall trees with dense canopy, build a dense forest. Inside the forest the light in the sky doesn’t really reach.

[Attachment Removed]

Hey there! Before we get too deep into try to hack around the engine I’d love to explore a few other possibilities:

  1. Assuming we’re using HWRT Lumen, what does the tree’s raytracing proxy look like? You can check that in the static mesh editor under the “Show” menu. If it’s super dense, that might be the cause of the issue.
  2. Have you explored the Skylight Leaking option on your postprocess settings for the area? That’s usually a fix for interiors that end up too dark, but might be helpful here.
  3. What’s the shading model on the foliage? I’d expect it to be either Two-Sided Foliage or Subsurface. Or if we’re in Substrate land, how’ve you got the slab set up?
  4. Instead of trying to pass light through things that are casting shadows, you should be able to disable Cast Shadows on the material section for the leaves themselves, but that might be too extreme.

Are you able to share images of your current setup? I can make this question as confidential if you’d prefer.

[Attachment Removed]

Hello Matt!

Thanks for the reply.

  1. I’ll check and get back with that information as soon as I can
  2. This is something interesting, we can definitely experiment with it. Although the problem is that the goal that we have with lighting in Unreal is to do a previsualization of the environment in real-time to be able to iterate quick and get results that we can the extrapolate to the Renderman render that we use for the offline rendering part of the pipeline. For the offline render we have built the system that I described to “cheat” the dense forest. That’s why I was wondering if we could simulate the same effect in Unreal or we can build something to simulate it, so we can configure it in Unreal, then translate the same configuration to Renderman and obtain comparable (though sure not equal) results there.
  3. I added substrate openpbr shading for the leaves and trunks, it was a simple one for this initial test
  4. It might not give us what we want, because we want to disable shadow in a volume, not in the whole asset.

Thanks!

[Attachment Removed]

If you want to go with the volume approach, you might consider building something into your material along with some kind of editor utility blueprint you can place in the world to batch the operation. I could see something where you’d have a scalar parameter on the material that’s like “ShadowFadeOut”, and the volume would iterate over all the primitives contained within, create transient MIDs for them and set the shadow fade out value to whatever the user input. There’s a material expression called “ShadowPassSwitch” which would make the whole thing work. You plug in your normal opacity mask to the “default” pin, and on the “shadow” pin, you multiply your opacity mask by your shadow fadeout amount.

I wouldn’t necessarily recommend that approach for a full Gen9 60hz application, but for previz this’ll likely not have too bad of a performance impact.

Thoughts?

[Attachment Removed]

Since we have control over all the assets that we are adding to the level we can customize the base materials for them to add that configuration.

Is it possible to supply a material parameter that will activate that ShadowFadeOut in the material depending on the volume? Would I have to wrap all the assets in a blueprint with custom parameters and logic in the construction script to supply the value? Or maybe a level sequencer track that set a material parameter in a specific actor?

[Attachment Removed]

There’s two options I can see:

  1. If you’re okay with a hard-coded number of volumes you can create a Material Parameter Collection with parameters like “VolumeOrigin_1”, “VolumeExtens_1”, “VolumeRotation_1”, etc. and each volume would set its associated values in the MPC during its construction script. Bundle the logic up into a material function and add it wherever you need it. The limitation of this technique is that you have to pre-create all the parameters in your Material Parameter Collection, so you’re hard coding the maximum number of active volumes.
    1. There’s another version of this where you’re using render targets and Niagara to pass the values around, which can dramatically increase the number of volumes you can use but this is… a lot of work for what you’re trying to do.
  2. If you want an arbitrary number, size, and shape of volumes then you’d want to set something up in those blueprints that makes the changes as part of the actor’s construction script. The pseudocode for that would be something like:
for each overlapping actor:
    for each static mesh component/instanced static mesh component in actor:
        for each material in static mesh:
            create material instance dynamic
            set "ShadowFadeAmount" scalar parameter on the MID
            apply it back to that same material slot
            

You’d probably also want to add some logic in the event two volumes overlap, but that’ll be a decision you’ll need to make for yourself.

[Attachment Removed]

I think having a fixed small number of volumes is more than enough for this use case.

I might need to come back to ask more about this when I try to code this on our side.

Thanks!

[Attachment Removed]

Sounds good, keep us posted!

[Attachment Removed]