The strange antics of transparency


Roblox doesn’t allow graphics programming which is a pity, but it looks like there’s some hackish ways to alter render order.
Anyone want to try and fully document the behaviour?
Here’s what I’ve got so far, after a few hours of testing.
These rules apply from top to bottom, the top rules overriding bottom rules.

  • Transparent Glass parts that aren’t meshes completely hide anything transparent behind them.
  • Transparent Glass meshes render behind all transparent objects. When two of these are layered, the one behind appears in front.
  • Anything transparent and non-glass that has a humanoid as a sibling layers with other transparent objects such that screen Z position does not matter at all. It will render in front of all transparent parts, except for those that also have a humanoid sibling, in which case the layering is unpredictable. This weird layering even applies to how lone meshes render, for example RainbowWings are transparent and the mesh has two pairs of wings, but the bigger pair always renders in front no matter what angle you view from.
  • Transparent meshes sometimes render in front of transparent parts, depending on camera angle, part sizes, and positions.

It should be noted that wherever I mention “Mesh”, it only applies to meshes of type “Head” and “FileMesh”.

There may be more behaviours I haven’t found.
I’m hoping to eventually make a really well-working see-through portal, but the current layering behaviours aren’t enough.


Everything glass related Roblox is already aware of. This is something for #bug-reports:client-bugs. As a new member, you’ll want to message the lead top contributors as per rule 15.1.


also to note, don’t rely on this behavior



A documented bug is a feature


And now that I’ve compiled what is probably all known layering behaviours, it’s documented.
It really should be put in the Wiki though, as a separate page about render layers, since there’s probably a fair number of people trying to learn tricks to layer things.


I’m sorry, but I’m pretty sure that twitter account is controlled by PR, not one of the devs. I’m going to trust what the devs say on this one, which is not to rely on this behavior.


I’m aware, I just think it’s funny.


Retweeting clever uses of bugs is not the same as supporting the bug. All we’re encouraging is creative solutions to problems. :stuck_out_tongue:

As previously stated, do not rely on this behavior. Complexo, thanks for at least assembling a list for people to play around with until it’s fixed though!


No there shouldn’t be because this isn’t a feature, it’s a bug that the engineers have told devs not to rely on and will be fixed eventually.


Then say it’s a joke. Since you said nothing else in that post, it’s going to be misconstrued as actual advice.


It’s a temporary feature™


Well since it’s implemented currently as a bug, couldn’t it be added later on as it’s own material? Just like, a solid transparent block that eliminates the rendering of anything transparent behind it. :stuck_out_tongue:


You still wouldn’t rely on existing bugs because they could still break if the glass material is patched after a dedicated material is potentially added.


That’s what I was referring to when I said “added later on as it’s own material.” :stuck_out_tongue:


If you don’t want to future-proof your games for a bug you know will be fixed and just say “I’ll change it later,” I have some bad news for you.


I learned a new trick for render layer manipulation: Inside-out meshes.
They’re occluded by things inside of them since the back face renders instead of the front face, which I assume is how Databrawl is able to create outlines around parts.


I think that’s how cell shading is done in general.


Cell shading is computed by shaders just like how “regular” lighting is computed, not by adding extra geometry.


The outline portion of it is, at least according to the wiki article - by inverting back-face culling and having a separate object slightly larger than the object you want an outline around.