> For the complete documentation index, see [llms.txt](https://komodobits-organization.gitbook.io/distance-material-effects-documentation-portal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://komodobits-organization.gitbook.io/distance-material-effects-documentation-portal/walkthroughs/each_node_guide.md).

# How to Use With Materials

This page covers how to use the features of Distance Material Effects and integration.

## Finding the Material Functions:

1. In your material graph, search for `material function call`.
2. From the material function selection drop down menu, choose the node you want, all of them have "Distance" in the title so you can search for that or go to the content directory and drag them into the graph.

<figure><img src="https://content.gitbook.com/content/xzEh03ZYrhUWCXIKpL2Z/blobs/7XpwzEPVdlTJIU8ggVoa/image.png" alt=""><figcaption></figcaption></figure>

## Distance Texture Swapper Function:

This function swaps to a different texture based on distance to the camera.

1. Search for MF\_DistanceTextureSwapper in the material function call node.
2. Connect a Texture Object to the far and close texture inputs.
3. Now, connect a texture coordinate node to the far and close tiling inputs.
4. Connect the node to the base color or other texture maps. It should look like this when done.

<figure><img src="https://437212602-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxzEh03ZYrhUWCXIKpL2Z%2Fuploads%2FqsZi1XZObASNiHRzGTH9%2Fimage.png?alt=media&amp;token=52d4dd0e-6e07-403e-823d-20c67e37fef4" alt=""><figcaption></figcaption></figure>

5. To use with normal maps, use the `MF_DistanceTextureSwapper_NormalMap` function.

## Distance Tiling Switcher Function:

This switches tiling amount based on distance to the camera.

1. Add the `MF_DistanceTilingSwitcher` material function to your material graph.
2. Connect texture coordinates to both `far tiling` and `close tiling`.
3. Make a static bool node and connect it to Use `tiling override.`
4. connect the result of the MF\_DistanceTilingSwitcher to a texture sample UV and then plug it into your material graph. the end result should look like this.

<figure><img src="https://437212602-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxzEh03ZYrhUWCXIKpL2Z%2Fuploads%2FCFyN7bOIXlX7qWgf5gyA%2Fimage.png?alt=media&amp;token=a14d333e-0800-47e8-a0f9-32cbc5088c8e" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If the tiling override is set to false, you will adjust tiling via the material parameters.
{% endhint %}

## How to use distance scaling material functions:

These two functions scale the mesh that material is applied to up or down based on distance to the camera. It has object and vertex based options.

1. Find either MF\_DistanceScaling\_ObjectBased or MF\_DIstanceScaling\_VertexBased and add it to your event graph.
2. Plug it into World Positon Offset.
3. Set the material parameters for this node. When done it should look like this.

{% hint style="info" %}
Object-based is recommended for most use cases of this node, in some case vertex based might work better. You will need to try both to see what works best for you.
{% endhint %}

<figure><img src="https://437212602-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxzEh03ZYrhUWCXIKpL2Z%2Fuploads%2FOkBy7CgB9YUI3hEXV7WN%2Fimage.png?alt=media&amp;token=73041e02-cb55-46e0-93a9-5e72ecc2c51f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://437212602-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxzEh03ZYrhUWCXIKpL2Z%2Fuploads%2FbrN9lyVjfHbTAcBa9yHs%2Fimage.png?alt=media&amp;token=50f1e57f-84c3-4ddd-91b0-cd5011cded99" alt=""><figcaption></figcaption></figure>

## How to use the Mesh Outline effect:

This effect adds an emissive outline to objects in the distance, great for pickup items in RPGs, shooters, and other games.

1. Add the MF\_DistanceOutline node to your material graph.
2. Connect it to the emissive material input, then connect your base color texture to the node as an input
3. Set the Material Parameters to your liking.
4. That's it, your material should now have an outline. your graph should look like this when done.

<figure><img src="https://437212602-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxzEh03ZYrhUWCXIKpL2Z%2Fuploads%2FuQ8p1XbmWXv2WYAqEbci%2Fimage.png?alt=media&amp;token=a6193c98-714c-451b-88c8-9debaaf0dd29" alt=""><figcaption></figcaption></figure>

## How to use the dither culling:

1. Find the MF\_DistanceDitherCull function and add it to your material graph.
2. Set your material to "masked" or "translucent".
3. Connect the MF\_DistanceDitherCull node to the opacity mask or opacity material input.
4. Set the material parameters to your liking. Ideally, the Cull Start distance should be about 1000 units less than the Cull Distance on your blueprints.
5. That's it, your mesh should now have dithered culling like in AAA games. Your Graph should look like this when finished.

<figure><img src="https://437212602-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxzEh03ZYrhUWCXIKpL2Z%2Fuploads%2F9gLvxSIr94tut1TcbRHM%2Fimage.png?alt=media&amp;token=9626c8a7-6e42-4a7f-9260-576e3736ba35" alt=""><figcaption></figcaption></figure>

<figure><img src="https://437212602-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxzEh03ZYrhUWCXIKpL2Z%2Fuploads%2Ff725oAmL8qkdT37smFO7%2Fimage.png?alt=media&amp;token=c270f9c4-d442-4099-bee1-39e38b3f6a86" alt=""><figcaption></figcaption></figure>

## Need support or have questions?:

Join the Discord if you need further support, have questions, or need anything else. Support is available to everyone.

&#x20;<https://discord.gg/GXZ7c74sTm>
