#Strange transparency issue

1 messages · Page 1 of 1 (latest)

gloomy arrow
#

anybody know why this happens? (first image)
both use standard shader with transparent rendering mode, but sometimes the clear grey box appears infront of the blue one, despite the two intersecting, this happens depending on where player is relative to the two it seems

#

whichever is the closer object appears ontop (from my basic testing)

#

if you wish to recreate then note that these are the values for the materials

#

im also on unity 2022.3.32f1, although im not 100% if that would change much, its a urp project

alpine ocean
#

What do you want to achieve?

gloomy arrow
#

the second image, for some reason when the clear box is closer to the player than the blue box it seems "ontop" of the blue box instead of inside

alpine ocean
#

Try lowering the clear/gray box's material [Render Queue] or [Sorting Priority]

#

It may solve the above problem, but also create another one!

gloomy arrow
#

that fixed it! i set it to 2999, why does this work, and what other issue does it create?

#

ah i see

alpine ocean
#

Well, that's nice to hear.
Basically, it is the number that tell the GPU which object should be render first.

harsh burrow
#

Transparent objects don't write depth, so whoever is on top is decided based on the rendering order, which is decided by the object proximity to the camera.

gloomy arrow
#

now the blue one is ontop of the grey one 💔

#

ahh, that makes sense yall

#

also makes sense why this occurs

alpine ocean
#

The simple approach is mixing the render queue of the related materials

#

(But not best)

gloomy arrow
#

will this just be an issue ill have to ignore? i dont want to make some nitty gritty solution just for some boxes to look normal 😭

harsh burrow
#

Well, what's the purpose of these boxes? What are you trying to achieve?

#

This could be solved with ditheted transparency, but I'm not sure unity has it implemented anywhere currently.

gloomy arrow
#

this also helps with a cool idea though, you can probably make an object you can see through walls with this, ill check

unborn gorge
#

I second dithering opaques and just ignore the alpha blending

#

usually blending is fine for particles or stuff with small surface areas, but I avoid it everywhere else if I can

gloomy arrow
#

thanks yall! ill probably just end up ignoring this, but i found out you can do this! Pretty trippy effect for me, might end up doing stuff with it, its kinda hard to tell in the ss but there is a wall which you can just see through, the white boxes is stuff on the other side