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.
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.
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:
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.