# SETUP GUIDE

### Color Space

It is recommended to use `Linear` color space with this asset.

You can find this setting at `Project Settings/Player/Other Settings`.

![](https://1143501299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIPBJbsBHfwnXGNm0L3kh%2Fuploads%2FE07pTkbkzNypcy5Lgd3Q%2F0.png?alt=media)

### Universal Render Pipeline

The demo scene requires `Universal Render Pipeline` with `2D Renderer` to work. You can install it in the `Package Manager`.

After the `Universal Render Pipeline` is properly installed, you can use the `Universal Render Pipeline Asset` that comes with this asset. You can find it at `Cainos/Pixel Art Top Down – Village/Rendering`.

If you are using your own render pipeline asset, make sure to set `Transparency Sort Mode` to Custom Axis with Transparency Sort Axis set to `[0, 1, 1]`.

![](https://1143501299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIPBJbsBHfwnXGNm0L3kh%2Fuploads%2F19pGGZogJxfH3rwVPtZC%2F1.png?alt=media)

### Unity 6 Support

Import `Patch - Unity 6` package at the root folder of the asset to add Unity 6 support.

Sometimes you will get a error of  `[Top Down Pixel Water Renderer Feature] Blur shader not set.` after importing. In this case, just follow the [Top Down Pixel Water](#top-down-pixel-water) setup steps to add the material and shader to the renderer feature.

### Building for WebGL in Unity 6

For the water to be rendered correctly in WebGL builds, you need to disable `Auto Graphics API` and set `Graphics API` to `WebGPU` in `Project Settings > Player > Other Settings` .                        &#x20;

<figure><img src="https://1143501299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIPBJbsBHfwnXGNm0L3kh%2Fuploads%2F1K3v1JTcs9BBXfUekcOj%2Fwebgpu.png?alt=media&#x26;token=716c14ac-a956-4160-bee3-3e4195770bfc" alt="" width="563"><figcaption></figcaption></figure>

### Input System in Unity 6.1

For compatiblity, the default input method in this asset still uses the old input manager. And in Unity 6.1, the old input manager is no longer the default option.

If you encounter any error regarding the input system. Please change the `Active Input Handling`  in `Project Settings/Player` to `Both` .

<figure><img src="https://1143501299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIPBJbsBHfwnXGNm0L3kh%2Fuploads%2FUuE388pgJ7qRJHf5SS6L%2FUnity%206.1%20Input%20Handling.png?alt=media&#x26;token=69384e6c-fecf-4584-8953-74e2fc17a161" alt="" width="375"><figcaption></figcaption></figure>

### Pixel Aligned Placement

By setting the move value of Increment Snapping to `0.03125 (1/32)`, and press <kbd>CTRL</kbd> when moving objects, the objects can be placed perfectly aligned to the pixel grid.

![](https://1143501299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIPBJbsBHfwnXGNm0L3kh%2Fuploads%2FSk0lVauJChfmAs4UWizy%2F10.png?alt=media)

### Top Down Pixel Water

This asset is uploaded as a complete project to included project settings. The `Top Down Pixel Water`  renderer feature should be well setup by default.

If you need to set it up by yourself, follow the below instruction:

* Add a `Top Down Water Renderer Feature` to the render pipeline asset.
* Assign the water material at `Cainos/Pixel Art Top Down - Village/Material/MT Top Down Pixel Water` and gaussian blur shader at `Cainos/Pixel Art Top Down - Village/Shader/SH Render Pass - Gaussian Blur` to the `Reference` foldout.
* Set `Terrain Layer Mask` and `Water Layer Mask`. The `Terrain Layer Mask` is used to render refraction and a color gradient from shore to deep water. It should contain layers of the terrain tile map and other objects that directly touch the water, for example, the support of the dock. The `Water Layer Mask` should only contain the water prefab.
* Find the `PF Top Down Pixel Water` in `Cainos/Pixel Art Top Down – Village/Prefab/FX` and drag it to the scene.

<figure><img src="https://1143501299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIPBJbsBHfwnXGNm0L3kh%2Fuploads%2FX51eqEGP8Jg6MeB3DITp%2Ftop%20down%20pixel%20water%20renderer%20feature.png?alt=media&#x26;token=42ccb9b5-50a8-4ee4-bdf4-2cf1b5584e36" alt="" width="375"><figcaption></figcaption></figure>

![](https://1143501299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIPBJbsBHfwnXGNm0L3kh%2Fuploads%2FCwikwhc0qW5GX07GmuQy%2F3.png?alt=media)

### Optimize the Water for Mobile Platform

The rendering of the water is quite performance heavy. When optimizing for mobile platforms, please try the follows settings.

On `Assets\Cainos\Pixel Art Top Down - Village\Rendering\Universal Render Pipeline Asset - 2D Renderer`, find the `Top Down Pixel Water Renderer Feature` and tweak the blur settings of the water.

The idea is to make `Downsample` as large as possible and `Kernel Size` and `Blur Pass` as small as possible while maintaining an acceptable water rendering quality.

<div data-full-width="false"><figure><img src="https://1143501299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIPBJbsBHfwnXGNm0L3kh%2Fuploads%2F9aFducLYFYhLqaRQPpmO%2Fwater%20optimize%2001.png?alt=media&#x26;token=af4daab9-0755-4dcb-9ebd-18d2d08472db" alt="" width="375"><figcaption></figcaption></figure></div>

On the `Universal Render Pipeline Asset`, set `Render Scale` to 0.5. Mobile platforms usually have much higher DPI so we do not need to render at full resolution.

<figure><img src="https://1143501299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIPBJbsBHfwnXGNm0L3kh%2Fuploads%2FJ0zK0pcLhz9mwqwROuXU%2Fimage.png?alt=media&#x26;token=81ea520b-e9f1-45c9-9918-36c663a4f065" alt="" width="375"><figcaption></figcaption></figure>

On `Project Settings/Player`, Set `Graphics APIs` to `Vulkan`, enable `Multithreaded Rendering` and `Graphics Jobs`.

<figure><img src="https://1143501299-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIPBJbsBHfwnXGNm0L3kh%2Fuploads%2FtVwZMwvm9LkdZ6HAw39r%2Fwater%20optimize%2003.png?alt=media&#x26;token=90c90ad7-4a3d-47c0-be95-116835e3f2f0" alt="" width="375"><figcaption></figcaption></figure>

With these settings, the demo scene can run at 60fps at Xiaomi MIX 2S, a pretty old device.
