Utilizing Indirect Capsule Shadowing for Moveable Objects

Hi guys! With 4.11’s new capsule shadowing technique, I figured it could potentially be useful beyond just characters and could extend to moveable pieces of furniture or potentially other types of assets. I did some experimentation with the number of bones, placement, etc. and it seems that the less bones the better. I basically placed my bones in more or less the spots I wanted in Maya, and then in UE I just modified their placement and the capsule size to fine tune the look of the shadowing.

Here’s a short demo video of what I was able to produce. The scene itself is from the lightmass thread.

I’m definitely open to any thoughts or ideas on this. I’d love to see an improved workflow for this (I kind of just guessed at bone placement and size) as I see a lot of potential at low cost.

Nice work, man!

The technique seems to cause artifacts with self shadowing. But it definitely does a nice job with the contact shadows on the ground. Maybe using the bones just in the object’s feet will be the way to go for that.

Nice work! I had the same idea and I think this is a very good way to go, as some furniture are very lightmap-intense. Did you find any good tuts?

That looks great! Can you tell us some more on how you set it up in Unreal?

Self shadowing artifacts are a limitation of the technique - it can never really be fixed because capsules don’t represent arbitrary meshes that accurately.

There’s no official doc yet, but this is pretty good:

Is it possible to change the penumbra size of these shadows, or is that entirely based on the indirect lighting cache information?

edit: never mind, looks like that’s at the end of Tim’s tutorial. Thanks!

neat! thank you for posting this- that’s really clever

Really nice technique, I thought it could be feasible but did not had the time to experiment it yet, now I found your post, nice!

I just tested r.CapsuleIndirectConeAngle and it doesn’t seem to make any difference what numbers I put in. Am I missing something?

Thanks !

It depends on what lighting setup you have. Indirect capsule shadows are trying to derive a shadow direction from the precomputed sky occlusion if present.

If you have a stationary skylight:

  • r.CapsuleSkyAngleScale lets you scale the softness. Overall softness comes from directionality of sky occlusion though, you don’t have direct control. Future builds will have a ‘r.CapsuleMinSkyAngle’ too that allows you to keep it from getting too sharp.

If you don’t have a stationary skylight:

  • r.CapsuleIndirectConeAngle directly controls the softness. The direction comes from the direction of most intense indirect lighting, as determined by the volume lighting samples (same ones used on characters).

I was testing it with a stationary skylight indoors, that’s probably what it was.

Is it possible that, in the future, support for multiple shadows will be added? The main problem I’m currently having is that indoors, the shadow direction jumps around wildly as the character moves around because different windows become the strongest light source at that point. It’d be nice if the character could cast a shadow for every window in the scene.

If I try to use large value for r.CapsuleIndirectConeAngle it seems to have problem when value goes over half pi. I would like to use directionless ambient occlusion like capsule shadows but it seems that it’s not possible without hacking the compute shader.

As KOOLA answered on UDN :

“change the capsules self shadows globally in world settings -> Rendering -> Dynamic Indirect Shadows Self Shadowing Intensity.”

That should do the trick !