# Billboard Painter

<figure><img src="https://3136299364-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfMG3ZQEwZw59C6YohO8G%2Fuploads%2FJ6SAmrHMtLZ1nVL2aDTX%2FMedia04.png?alt=media&#x26;token=7eac8453-85c5-46a7-be18-d6962176cbaa" alt=""><figcaption></figcaption></figure>

{% embed url="<https://youtu.be/8bG-ESHKIeo>" %}

{% hint style="warning" %}
M**ake sure that you have `Always Refresh` on in the Editor when using the Tool.**
{% endhint %}

<figure><img src="https://3136299364-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfMG3ZQEwZw59C6YohO8G%2Fuploads%2FUQGAquARJcXv57Fwmd9h%2Fimage.png?alt=media&#x26;token=62709aa1-a76a-4a1e-b20c-edb9f8663338" alt=""><figcaption></figcaption></figure>

To get started using Billboard Painter Tool we need to create a holder for our particles.

{% hint style="info" %}
We refer to a **particle** as one billboard that is spawned at a point.
{% endhint %}

1. Create a `GameObject`  in the hierarchy.
2. Attach the `Billboard Painter Tool` script as a new component.

<figure><img src="https://3136299364-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfMG3ZQEwZw59C6YohO8G%2Fuploads%2FAvT5jA0nbC6ahaCShJIN%2Fimage.png?alt=media&#x26;token=7dfc7057-0a5e-476e-bc3c-a9b35c788b9d" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
All properties has tooltips if you hover over them in the inspector that tells you what they do.
{% endhint %}

#### Update Mode

> This handles when the billboards we create should update and recalculate everything. It is very important you understand when you can use each of the Update Modes to avoid any freezing when painting later on

{% hint style="success" %}
The painter tool never lags or freezes the game, only in the editor when modifying it.
{% endhint %}

{% stepper %}
{% step %}

### Update Mode `Auto`

Updates whenever you change any of the properties in the inspector. Use this carefully.
{% endstep %}

{% step %}

### Update Mode `Manual`

Updates only when painting. When changing properties in the inspector, you will have to press the Update button visible when this setting is enabled to update the painter. You can also update it by pressing \[LEFT-CONTROL] on your keyboard.&#x20;
{% endstep %}
{% endstepper %}

{% hint style="info" %}
More information about keybindings are available in the same inspector window as the Tool itself.
{% endhint %}

### Creating a new mesh using the Billboard Painter

Follows is an example workflow of creating e.g. ivy using the tool:

{% stepper %}
{% step %}

### Add the Billboard Painter Tool to a GameObject

{% endstep %}

{% step %}

### Change to `Auto` Update Mode for Faster Feedback

{% endstep %}

{% step %}

### Use Keybindings to Setup Brush

Changing Brush Size: `Hold [CTRL] + Drag [LMB]`

Changing Brush Strength: `Hold [CTRL] + Drag [RMB]`
{% endstep %}

{% step %}

### Start Painting on Any Surface

Paint: `Hold [SHIFT] + [LMB]`&#x20;

Erase: `Hold [SHIFT] + [RMB]`&#x20;
{% endstep %}

{% step %}

### Apply Your Chosen Material

In the `Billboard Painter Tool`, choose a new material as the `Material` Property.
{% endstep %}

{% step %}

### Now we have our newly painted mesh

The tool has created a new mesh with 3 levels of LOD's.
{% endstep %}
{% endstepper %}

### Adjusting the generated billboards \[ADVANCED]

You can change the billboards created if you are well-versed in mesh creation and C#. Here follows a simple guide of the inner workings of the tool:

Under `Level Design Tools/Tools/Billboard Painter/Scripts` open the `Billboard` script.

Here you can change the billboard however you like. We suggest that you go from top-to-bottom to try to understand what needs to be changed, but here is a quick rundown.

* Every LOD is separated in a `switch` statement. Both `LOD1` and `LOD2` are the same out of the box but can be separated if more detail is needed.
* If you change the generated vertices, make sure you also change the `GetVertexCount` method to match the vertex count.

If you need further detail and/or more complex shapes, we recommend using the `Object Brush Tool` instead.
