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
#Strange transparency issue
1 messages · Page 1 of 1 (latest)
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
What do you want to achieve?
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
Try lowering the clear/gray box's material [Render Queue] or [Sorting Priority]
It may solve the above problem, but also create another one!
that fixed it! i set it to 2999, why does this work, and what other issue does it create?
ah i see
Well, that's nice to hear.
Basically, it is the number that tell the GPU which object should be render first.
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.
now the blue one is ontop of the grey one 💔
ahh, that makes sense yall
also makes sense why this occurs
The simple approach is mixing the render queue of the related materials
(But not best)
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 😭
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.
the gray box is an indicator on where the hitbox for "placing" the other boxes, technically it can and would be removed after testing, but i noticed the issue with 2 transparent objects inside eachother and was wondering if there was a fix
this also helps with a cool idea though, you can probably make an object you can see through walls with this, ill check
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
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