Issue with Shader applied on tilemap Renderer

Hello, I made a shader (using shader graph) that should outline the edges of tiles. (left sprite)

As you can notice, when I apply the shader to the material property of my tile map renderer, it does completely something else.

I would gladly take any suggestions, help, or explanations about that.

Wish you a great day

It’s a bit hard to guess without seeing the shader, but I would guess that you’re doing some UV-offsetting thing like in this Brackeys tutorial:

Two problems with this:

  1. The tiles draw over one another
  2. Tilemap chunks can make weird edges for which thing draws over what

Instead what you should do is have a GameObject+SpriteRenderer with your special material and move it on top of (in front of) your tilemap.

If that sounds like not what you’re going for, explain what the intention is behind the effect and maybe I could suggest something else.

Hello Lo-renzo,

First, thank you for answering my post and trying to help me !

The main goal of this shader is to make a grid of tiles for an editor/build mode, as in editor mode.

I’m pretty new to shader graph, so i’m just trying to get things to work by experimenting.

I don’t know if using Step node on UV node is considered to be UV-offsetting.

“1. The tiles draw over one another” i don’t see how it is possible, because the outline is made at the inner-edges of the tile

I’m hoping that this extra information will help people to understand the issue i’m facing.