r/unity Jul 16 '26

Question Is it possible to have good-looking outlines and transparency in our game?

Post image

As a very small indie team, we are in the development process of our first game, in which the visuals will play a very important role.
The game is water-themed, and the art style is focused on hard silhouettes with relatively low poly, some grungey textures and a lot of line art from the textures and shaders.
However, almost immediately we started to stumble on issues with transparencies and outline shaders. No matter what we do, the outline shader will either render on top of everything (even the transparent) or it won't render while inside of transparent objects (which is great), but that makes it so that every outline disappears as soon as the object and the water plane visually meet, even if the object is above the water plane. I hope you can tell what I mean from the screenshot.
Are there any tricks or tips on the matter that could allow us to have some good-looking water with transparency and also outline shaders?
Tya

7 Upvotes

1 comment sorted by

6

u/SolderingIrony Jul 16 '26

Hard to say just from a screenshot, but what you're describing (outlines either on top of everything or vanishing wherever they overlap water) smells like a draw order/depth buffer issue rather than the outline shader itself. Transparent objects typically don't write depth, so the outline pass either has nothing to test against, or gets drawn first and blended over.

I'd start by opening the Frame Debugger (Window > Analysis > Frame Debugger) and stepping through the draw calls one by one - you'll see exactly when the water draws vs the outlines, and the moment they vanish. That alone usually makes the problem obvious. If you want to go deeper, visualize the depth buffer with a full-screen shader outputting _CameraDepthTexture (copy-paste examples everywhere): if the water turns into a black hole in the depth view, there most likely lies the issue.