2d-outlines-urp icon indicating copy to clipboard operation
2d-outlines-urp copied to clipboard

Usgin this shader with Line Renderer

Open z4kk opened this issue 4 years ago • 1 comments

Thanks for this cool tutorial and shader! Is it possible to use this shader for Line Renderer for the outline?

z4kk avatar Jan 24 '21 14:01 z4kk

Unfortunately not - this shader relies on the sprite having some "padding" around it. When the SpriteRenderer is rendered, the entire quad is passed through the shader, and we rely on that fact to ensure we render outlines past the "bounds" of the non-transparent part of the sprite. When a LineRenderer is rendered, there's none of that "padding" because no pixels outside the LineRenderer are rasterised, which means we can't add outlines using this shader. You would need to use a different approach - it might take a bit of work to modify this shader to handle this use case!

daniel-ilett avatar Jan 26 '21 14:01 daniel-ilett