Trying to make sprites work in 3D world (URP).

I recently decided to change my game from 2D to 3D, but keeping most things as 2D sprites. I already changed the 2D renderer to the 3D one. I’m using Unity 2021.3.7f1, and URP 12.1.7.

There is absolutely nothing I can think of or tried that has worked. Sprites sort based on Y position, and there is no way of changing that in the 3D renderer like in the 2D one where you could set a custom sort axis. It becomes even more chaotic when I introduce transparent water, as things very much on land will appear under the water if they overlap with it on the camera.

I tried converting them to planes with textured materials, but either the mesh is huge and incorrectly oriented, or the sprite appears stretched. Nothing I find online helps, as I’ve seen people using regular sprite renderers that work beautifully, as well as plane mesh renderers.

I tried playing around with shaders, and the default “Unlit/Transparent Cutout” seems to work best, works with transparent water, and z sorting, the only problem is it turns all transparent pixels fully black, and all I can do is slide the alpha cutoff, which vaguely removes fully transparent areas, but never really gives semi-transparent pixels.

Nothing I tried making with Shadergraph works either.

Hi, did you find anything? I’m currently searching for a better solution than what I’ve been using.

You’re likely using a shader that doesn’t write to the depth buffer (ZWrite On). Generally speaking using alpha transparency and writing to the depth buffer can cause a lot of issues if you’re not careful but for simple screen-aligned sprites, thankfully, things are a lot simpler and you can generally just expect it to work since they will be rendered back-to-front from the camera.

Thanks.

I found this works quite well.

https://www.youtube.com/watch?v=50qv78W5vko