Download

Distance Fields Shadow questions

hi people,

still testing the light settings before i go to work.
i am using vxgi and pretty happy with it. my problem is with shadows.

since i am using very distant camera, the shadows display some artefacts. (jagged edges and irregular shadow casting)
attached is a screencap.

none of the DFS parameters help and to add to my confusion in cascade shadow settings the “num dynamic shadow cascade” also seems to change the edges slightly. i was under the impression that its either cascade shadows or distance field.

i was hoping as with LPV, there are some .ini settings i can try out.
keep seeing examples of these shadows that dissipate nicely but cant get even close.

anyone has some tips?

Distance field shadows start rendering out past your cascade shadow distance. So if you want all DF shadows set all cascades to 0.

I am not sure but it looks like the artifact above is near the area where it is beginning to transition from regular cascades to distance field shadows, and for some reason the distance field shadows are not liking those window cutouts.

Could be something in content, I see the artifact on all of the 1st row of windows, but with this perspective those would all be at slightly different depths so it may not be the transition thing I first thought. See what happens if you flip the mesh there or rotate it or something, does the artifact stay on those windows? If so Id start looking at your model, perhaps the distance field generation isnt working well due to unwelded verts there or something?

thank you so much ryan.

i will investigate along those lines.

really appreciate the answer on a weekend aswell.
have a great one.

Those windows don’t have to be extruded in, unless you need to close up?

hi errvald,

i´d really like the flexibility of placing the camera where ever.
the objects are placeholders to test the shadow casting and gi but still i´d like the geometry to be inset.
may i ask what your workaround would be? normal maps?

here are a couple of further screenshots.

the test mesh did not have an uv map so i had an error dialog when importing about degenerate tangents i think, but imported uv mapped mesh and not much changed.

quite confused to be honest. regular primitives also seem to cast shadows of different qualities.
its hard to ascertain why that is the case.

  • does the mesh density play a role in calculating shadows?
  • does the general scale of the scene make a difference (ie. should one be careful to work in real world proportions?)
  • are there any console commands for shadow finetuning i can try out?

once again - not interested in performance, just the highest possible quality.
i am attaching below a couple of different light angles and the DFS settings.

in this zip file there are further light angle examples: http://we.tl/Mai4wYlQ5W

any link or idea will be very helpful.

I am guessing this is because of the resolution of the individual distance fields that are used per asset. Lots of small holes like that may not line up perfectly with the resolution of the 3d DF texture so you get this kind of moire pattern where some rows show up and some are missed or some get over sampled etc. So a huge asset has inherently less resolution for small windows than a small asset with the same sized windows.

try opening the static mesh in the static mesh viewer and increasing the distance field resolution scale from 1 to something like 4. If 4 isnt enough maybe even 8 but it might take quite a while the process. For the kite demo we had to use some scales of up to 8 and maybe even 16 on a few large cliff assets, but our artifacts there were more like blotchy black patches of over occlusion.

hi ryan,

your suggestion indeed helped.
it reduced the artefacts to minimum.

if larger objects produce resolution issues i hoped a workaround could be partitioning a building. the imported smaller pieces in the screenshots however show these artefacts around the window frame under certain incidence angles even if when i upped the resolution to 12.

i can avoid these light angles but a more important issue remains the connection point of the cast shadow and the object. the shadows always seem to be “trimmed” at the source.
the screen frame itself also seems to influence the ambient occlusion.

i already feel guilty for taking your time with these basic issues and thank you for having interest.

i have attached again two pics to illustrate.

No worries, getting these settings right with DF shadows can take some tweaking.

If you expand all of the properties under the distance field lighting, there should be a bias parameter you can tweak as well. Sometimes you may find that a certain bias works great for certain content but not other content so you have to kind of pick the bias that works the best overall. For example, we had to tweak the bias a bit for the kite demo in a way to reduce self shadowing a bit to remove artifacts on the rocks, but a side effect of that was we lost a bit of depth in the tree distance field shadows in the far distance.

also just a minor suggestion but it appears there may be additional DFAO or SSAO on top of the DF shadows. It can be helpful to isolate to just the one shadow component at a time when debugging this. You can disable the DFAO and SSAO temporarily using the show flags.

hi ryan,

its very comforting to know that you guys had similar issues.
maybe bit tired here but i cannot seem to find that bias. shadow bias under light dropdown has no influence.
i remember playing with that setting on LVP and it alleviating the same issue but under DFS shadows there is no such option. i will dig for it further.

my AO was turned on and disabling it for troubleshooting makes things lot easier.

thanks