Patchy Distance Fields, whats wrong?

Hi,

Since distance field shadows are a thing, I have never been able to create models that cast proper shadows.

To illustrate I attached the visualization and resulting look from a roof mesh for a model I’m making.
Increase/Decrease in geometry didn’t do anything.
Increase in the resolution scale did bring some improvements but nothing to write home about.
Extruding the mesh so that it’s double sided did improve it somewhat but at steeper angles the shadows where still inaccurate.

Looking at the models that ship in the Epic demos, they all have these spotless Distance Fields so I know it’s possible.

Are there any tutorials out there on how to model with distance fields in mind?
What are the main things one must look out for?

Thank you for your help.

Sebastian

Ps.
Under product version I listed 4.8 preview but it’s been happening with all versions.

No one else having problems with this?

Hi Sebastian,

I’ve tried to reproduce this on my end, but I cannot get the same results, even with a simple long plane mesh.

If you want you can attach the asset and I’ll have a look on my end to see if I can offer some pointers.

As for limitations and developing assets with Distance Fields in mind you should have a look at the documentation for Distance Field AO and Distance Field Soft Shadows. A lot of the limitations listed between these two carry over to each other. There are some things that are specific to DFAO or DFSS, but mostly the limitations are similar and should be adhered to.

Let me know if you have any questions.

Tim

Hi Tim,

Thank you for your reply.
This happens on almost every mesh I make.
I’ve tried exporting using different fbx versions and different grid/size settings.
Nothing helps.

I’m using Win7, Maya 2014 and 2016

If its possible, I’d love to send you a mesh and see if it happens on your end as well. How can I do that? It wont let me attach meshes here as it says they are an invalid filetype,

Thank you for your help,
Sebastian

You can put it in a zip file and upload here as long as it’s under 5.2 mb or you can send a download link via a PM in the forums here: https://forums.unrealengine.com/private.php?do=newpm&u=4894

Oh cool, that worked :slight_smile:
Hope you can make some sense of this.
Made a simple room yesterday and even there I can’t get distance fields to calculate right.

Thank you so much for your time.

Best,
Sebastian

link text

Looking at your asset, it is a very large piece, which doesn’t scale well with distance fields. Distance Fields that are generated work best with smaller modular pieces to get the best results.

Sometimes using a higher distance field resolution (build settings in the static mesh editor) will help alleviate some of this by generating a high resolution distance field mesh for your asset.

When troubleshooting some of these issues it’s best to use the viewport view mode to see your distance fields by going to Show > Visualize > Mesh Distance Fields.

With your room that you mention you’re having issues with, is this a single mesh or very large mesh? If that’s the case it would be better to break the walls up into their own individual pieces and add some thickness to them, if not already. This will give the best results when creating meshes for distance field methods.

I hope this helps and feel free to ask any other related questions if you have any.

Tim

Thank you Tim, for taking a look.
I’ll try breaking everything up into smaller chunks.
For a huge and simple mesh like this I wanted to keep it one piece to save on drawcalls but I was probably overzealous :slight_smile:

Cheers

While you may have a few more draw calls for static meshes in your scene, it’s better in the sense that when breaking up your mesh into multiple pieces, the meshes that are not visible will not be rendered, where as if you have a single large mesh the parts that are hidden will still be rendered since it’s a single mesh.

If they’re all using the same material this should be a single draw call for that material, so you really shouldn’t see a dip in performance compared to what you already had.

If you find you’re still having trouble please let me know and I’ll help where I can. :slight_smile: