# Smart Decals

## How To

### Smart Decal widget

There is a Smart Decals example map in the Maps directory of Decal Designer.

To get started run the Smart Decals editor utility widget<br>

<div align="left"><figure><img src="https://2959358512-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkbFtFcgzGsjc9kCvZT%2Fuploads%2FKoMuvpYOq60vKjTEYhnA%2FSetup_01.jpg?alt=media&#x26;token=f1972302-ff88-45c3-bec3-022c209ae65f" alt=""><figcaption></figcaption></figure></div>

Navigate to it in the content browser then right click > Run Editor Utility Widget

<div align="left"><figure><img src="https://2959358512-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkbFtFcgzGsjc9kCvZT%2Fuploads%2FOl8XSObjb3JhNC84W5zc%2FSetup_02.jpg?alt=media&#x26;token=36c9d406-7308-4af8-ae32-ebb77dfb6f2d" alt=""><figcaption></figcaption></figure></div>

This widget contains all of the controls you need. You can dock it in the Editor for easy access

<div align="left"><figure><img src="https://2959358512-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkbFtFcgzGsjc9kCvZT%2Fuploads%2FwvsqHegWWVWwCZd0SErM%2FSetup_03.jpg?alt=media&#x26;token=b2eefc83-7a47-4324-9dce-0edc43074988" alt=""><figcaption></figcaption></figure></div>

Alternatively, once the widget has been run once you can access the widget via the Editor Utility Widgets window

## Parameters

When using the Smart Decal widget the following parameters are available for decal control.&#x20;

### Creation &#x20;

<div align="left"><figure><img src="https://2959358512-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkbFtFcgzGsjc9kCvZT%2Fuploads%2FmVOseB3Hk8IlaiYT5gO4%2FParam_01.jpg?alt=media&#x26;token=b7983891-1656-4ed7-b3a6-8584f82c9a6b" alt=""><figcaption></figcaption></figure></div>

1. **Create New** Create a new Smart Decal in the center of your viewport. Pressing this whilst already creating will center the decal in your viewport once again.
2. **Create from selected** Create a Smart Decal from a decal actor already placed in the level. The decal material instance must be one authored with Decal Designer. Pressing this whilst already creating will center the decal in your viewport once again.

{% hint style="info" %}
**Create from selected** will edit the selected decal actor graph - any other material instances using this graph will be affected. \
You can prevent user accidental updates by setting "SmartDecalPreventUpdate" to 1 in the material instance. This will block the Smart Decal widget from updating unless overridden&#x20;
{% endhint %}

<div align="left"><figure><img src="https://2959358512-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkbFtFcgzGsjc9kCvZT%2Fuploads%2F7Pjb5z6CNK4ydJVhAf2l%2FParam_01a.jpg?alt=media&#x26;token=3e148130-b5c7-42bf-bdec-13af13c71706" alt=""><figcaption><p>Parameter found in the decal Material Instance in the Texture Maps category</p></figcaption></figure></div>

<div align="left"><figure><img src="https://2959358512-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkbFtFcgzGsjc9kCvZT%2Fuploads%2FN5BNvnJ1yYyPZTly12k3%2FParam_01b.jpg?alt=media&#x26;token=c1a8a903-52fe-48f1-89ec-9e9ea88eda81" alt="" width="563"><figcaption></figcaption></figure></div>

3. **Help** Click to open the Smart Decal documentation
4. **Edit Decal Graph** Edit the material graph parameters for the active Smart Decal. Changes how the current decal looks. See the [graph parameters page for more information](https://ronanmahon-art.gitbook.io/decal-designer/technical-reference/parameter-reference)

{% hint style="danger" %}
Creation of Smart Decals isn't complete until you [press the **Apply** button](#finish-your-creation). Deleting the actor, pressing **Cancel** or closing the Unreal Editor will exit the creation process.&#x20;
{% endhint %}

### Decal Settings

<div align="left"><figure><img src="https://2959358512-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkbFtFcgzGsjc9kCvZT%2Fuploads%2FakUw5lKYhmPSy4ss1uhP%2FParam_03.jpg?alt=media&#x26;token=12ee7a18-8221-49d8-b912-0143ef60d473" alt=""><figcaption></figcaption></figure></div>

5. **Decal Type** Choose which channels your decal should affect e.g. a decal which only affects the Normal channel.&#x20;
6. **Resolution** Set the resolution of the decal. This also affects the scene capture resolution
7. **Quality** Use the Quality settings to adjust performance whilst editing. Defaults to Medium for a balance between performance and visual quality. Lower settings reduces the quality of some texture effects such as blurs for faster variants. Be sure to set to High before pressing Apply for the best result.&#x20;
8. **Capture Always** Enables Capture for every frame. This setting is off by default meaning the smart decal will only update if it is moved or if a parameter is changed. Enabling it can be useful if you want to adjust the scene around the decal and have it visually updating every frame. This setting can reduce Editor performance when enabled depending on Resolution and Quality settings.

### Scene Mask settings

<div align="left"><figure><img src="https://2959358512-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkbFtFcgzGsjc9kCvZT%2Fuploads%2F1n2LU1NoSRTeXlZCgVqo%2FParam_04.jpg?alt=media&#x26;token=50b33fc3-97a5-414d-8ec4-745a2a6219f0" alt=""><figcaption></figcaption></figure></div>

9. **Preview Mask** Previews the scene mask being generated instead of the decal material
10. &#x20;**Mask Amount** Adjust how much the scene mask affects the decal. Note that the scene mask is being blended with [A Layer](https://ronanmahon-art.gitbook.io/decal-designer/technical-reference/parameter-reference#a-layer-parameters) and is affected by A Layer control parameters such as blurring etc.
11. **Global Balance** Similar to a brightness control, shifts the midpoint of the scene mask
12. **Global Contrast** Adjust the contrast of the scene mask

{% hint style="info" %}
The following controls have their masks inverted when using negative values.\
[Advanced Scene Mask settings](#advanced-scene-mask-settings) can also be found for each below for fine tuning. These settings can be found by pressing the expand arrow at the bottom of the widget
{% endhint %}

13. **Normal** Mask based on the scene world normal. Similar results to a curvature map.&#x20;
14. **Direction** Mask based on the direction of the scene surface orientation. Defaults to world Up/Down.
15. **Mesh** Mask based on mesh face edges. Similar to a wireframe effect.&#x20;
16. **Depth** Mask based on the depth of the decal projection along the projecting axis.&#x20;
17. **Position** Mask based on the world Z position relative to the decal extents.
18. **Shadow** Mask based on scene shadows.&#x20;
19. **BaseColor** Mask based on the scene base color value. Useful for masking bright or dark values.&#x20;
20. **Metallic** Mask based on scene metallic values. Useful for only allowing rust to build up on metallic surfaces etc.&#x20;
21. **Roughness** Mask based on scene roughness.&#x20;

### Advanced Scene Mask settings

<div align="left"><figure><img src="https://2959358512-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkbFtFcgzGsjc9kCvZT%2Fuploads%2FT6DZwLUG35WDVyMoucAI%2FParam_05.jpg?alt=media&#x26;token=a99bcedd-af6b-4d5d-8c2f-2a9955e2d02a" alt=""><figcaption></figcaption></figure></div>

22. &#x20; **Normal Thickness** Adjust the thickness of the Normal mask curvature result
23. &#x20; **Normal Threshold** Fine tune the angle threshold for Normal masking
24. &#x20; **Direction Up Down** Positive values to mask World Up facing surfaces Negative values to mask World Down facing surfaces
25. &#x20; **Direction Left Right** Positive values to mask right facing surfaces relative to the decal actor Negative values to mask left facing surfaces relative to the decal actor
26. &#x20; **Direction Front Back** Positive values to mask front facing surfaces relative to the decal actor Negative values to mask back facing surfaces relative to the decal actor
27. &#x20; **Direction Contrast** Control the contrast of the Direction mask
28. &#x20; **Mesh Thickness** Adjust the thickness of the Mesh edge mask
29. &#x20; **Mesh Threshold** Fine tune the threshold for mesh edge masking
30. &#x20; **Mesh Inside** Control whether internal mesh edges are masked
31. **Mesh Outside** Control whether edges outlining the mesh are masked
32. **Depth Contrast** Control the contrast of the Depth mask
33. **Position Contrast** Control the contrast of the Position mask
34. **Shadow Contrast** Control the contrast of the Shadow mask
35. **Base Color Contrast** Control the contrast of the BaseColor mask
36. **Roughness Contrast** Control the contrast of the roughness mask
37. **Trace Complex** Choose whether the line trace for initial decal placement when Create is pressed is tested on simple or complex collision

### Finish your creation

Before a Smart Decal is created you must finish up by pressing the Apply button at the bottom of the Smart Decal widget.&#x20;

<div align="left"><figure><img src="https://2959358512-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkbFtFcgzGsjc9kCvZT%2Fuploads%2FGupWBNwpEVopPjXc7XOI%2FParam_06.jpg?alt=media&#x26;token=a7fedfd8-aa4a-4095-8bdd-e39ff8acf1bf" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
Depending on which creation mode was active, the apply button will perform differently
{% endhint %}

**Create New** The Apply button will prompt you for a name and a directory to save your new smart decal.&#x20;

<figure><img src="https://2959358512-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkbFtFcgzGsjc9kCvZT%2Fuploads%2F8lPV16Kaby5PH9GIq3Iy%2FParam_07.jpg?alt=media&#x26;token=ada6bf44-12a1-4d1c-8f2e-01de429c9784" alt=""><figcaption></figcaption></figure>

Once you've entered a unique name and pressed save, a graph and material instance will be created in the content browser. A decal actor will be placed in the world which uses your new smart decal material instance. The graph for your new decal will open so that you can fine tune any of the decal visuals via [graph parameters](https://ronanmahon-art.gitbook.io/decal-designer/technical-reference/parameter-reference)

**Create from Selected** The Apply button will update the associated graph of the decal you originally selected. The graph for your decal will open so that you can fine tune any of the decal visuals via [graph parameters](https://ronanmahon-art.gitbook.io/decal-designer/technical-reference/parameter-reference)\
\
**Cancel** The cancel button will return the editor to the state before you started creating. If you were creating a new decal it will be removed. If you were creating from selected, the selected decal will be returned to it's original position and graph state.

## FAQ

**My Smart Decal looks different when I reload the Unreal Editor**

The decal just needs a refresh. Open the relevant decal graph instance (you can [do this quickly](https://ronanmahon-art.gitbook.io/decal-designer/decal-utilities#open-decal-graph) via the right click menu) and touch any setting on the graph. Your decal will now be fixed permanently. \
\
There is a bug (reported) where any changes made to graphs via blueprint (which happens while creating via the widget) don't display unless the substance graph instance editor window was opened and a parameter adjusted. As a workaround for now, upon pressing Apply in the Smart Decals widget adjust any setting in the graph window which opens.\
\
**Can I create Smart Decals at runtime?**

Smart Decals were designed for Editor authoring use. The graph when set to 2K resolution can take around 40ms to output textures. The scene capture also has a performance impact. While this latency is realtime and feels responsive for editor use, it's generally prohibitive for console runtime use.&#x20;

**Can I animate Smart Decals in Sequencer?**

Technically yes, but they were not designed with this use in mind. The various parameters of the graph can be added as sequencer tracks but unless you are pre-rendering the sequence out as a movie, the latency of outputting the textures is prohibitive to do at runtime on a console as described above.&#x20;

**Can I stop decals from being updated or turned into Smart Decals?**

Yes, you can prevent user updates by setting "SmartDecalPreventUpdate" to 1 in the material instance. This will block the Smart Decal widget from updating unless overridden. This is useful when making a kit of modular decals via smart decals and then preventing any further updates. <br>

**I want more features! Are there any more planned for Smart Decals?**

Yes, [here is the current feature list](https://trello.com/c/UumYVnFy/74-decal-tools-smart-decals-v11) in progress. You can also [suggest a feature via this form  ](https://docs.google.com/forms/d/e/1FAIpQLSfb5wZICbpVFs_rRoQUNHw2EjwLrfdWkMlnhbBYXqUp8rL-MQ/viewform)

## How does it work?

See image below for what happens behind the scenes while using the Smart Decal widget. Once editing is complete the decal is once again a regular decal actor.&#x20;

<figure><img src="https://2959358512-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkbFtFcgzGsjc9kCvZT%2Fuploads%2FLBz5gr8EF9XwP9Vy22Lp%2FSmartDecal.jpg?alt=media&#x26;token=cdb89c05-52ff-450f-8d30-4a518da4b560" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ronanmahon-art.gitbook.io/decal-designer/smart-decals.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
