Currently the only way to create one-way glass is to use decals or to take advantage of glass’s unique property of not rendering any semi-transparent assets. These are not ideal workarounds to a missing feature (in large part due to performance reasons with decals on semi-transparent parts) so it would be very great if there is a way to be able to place glass with single-sided properties.
Because many map creators tend to avoid glass due to its unique properties that are oftentimes drawbacks (e.g., not rendering semi-transparent parts, poorer performance from render distortion), it would be even better to extend this feature to all materials.
One use case this feature would be great for is if we wanted skyscrapers with no transparency and complete reflectance from the outside while being able to see out from the inside.
One-way glass doesn’t actually exist. This one-way effect happens only because the environment on one side of the glass is much brighter than on the other side. If you’re standing outside the window, you’re receiving indoor light and the reflection of outdoor light, but the outdoor light is so much brighter that the indoor light isn’t noticeable. At night time when the outdoor light is darker, you can clearly make out the indoor light through the window.
Ideally Roblox should add HDR skies so we can get more realistic outdoor brightness values. Until that happens, you can kind of get this effect by just making your indoor lights very dim relative to the outdoor sky. You might need to crank up your ExposureCompensation when indoors to simulate eye adjustment. I implemented automatic exposure in a game, but doing it in a generic way with raycasts sampling the environment is very expensive and imperfect. Ideally Roblox should add this directly in the engine so you can simulate eyes adjusting to dim or bright environments.
They do exist. You can see it in reflective ski goggles or spacesuits where the exterior side is coated with a thin layer of reflective material (in these two cases to reflect light off to protect them from solar heat).
To your HDR sky suggestion, yes that would be great to have realistic outdoor brightness.
You can see it in reflective ski goggles or spacesuits where the exterior side is coated with a thin layer of reflective material
Why do you think this coat only reflects light coming from one direction? I think this is a similar situation as windows. The coating is reflecting an equal percentage of light that’s coming from inside the helmet. You just can’t see the reflection of your eyes because it’s so dim compared to the outside light.
I’ve tried hard to find examples of true one way mirrors, but haven’t found any. If I missed something, I would really appreciate a link / pointer, if you have any. This suggests one way mirrors typically work by the mechanism I described. One-way mirror - Wikipedia
A much simpler example would be stars. They are nearly invisible during the day (besides Venus) because the scattered light coming from the sun is much brighter than theirs.
@Snowiene
You can already achieve this with 2 same meshes with their normals facing in opposite directions. Give one a reflectance value of 1, and 0 to the other and you’ve got a one-sided mirror.
@DrKevin and i worked on making a quick test and we figured out that there were some struggles with it.
Roblox can’t calculate a 0 thickness block, this resulted in roblox freaking out when we tried to add the plane.
Sometimes it ends up with REALLY bad collision and sometimes its weight goes way out of proportion. However, they will always have the problem of never being able to stretch.
The physics can be easily fixed by using a transparent part slightly thicker than the glass.
As for your issues with the tools, I haven’t experienced them. There was probably an issue with the mesh you imported.
Here’s mine if you want it: plane.fbx (22.4 KB)
I understand backface culling is one of several ways to achieve this effect (probably should have included it in the original message) but it all comes down to performance concerns with it being a meshpart for such a primitive block and if it’s not supposed to be completely one-way, for every window, we’d need at least two semi-transparent parts (for interior + exterior) which doubles the draw calls it would take.
What you’re looking for is anti-reflective coatings: They do have different transmissive properties in one direction than the other, because they rely on destructive interference to function, and that depends on the specific combination of refractive index changes, which is not the same in both directions.
You can get around this problem by using two planes instead of one, both facing the same direction and very close to each other. If you want the camera to be able to move through the windows, you turn the opaque reflective meshpart’s collisions off, but leave the transparent meshpart’s collisions on.
If you’re stretching this part and reusing it across the whole build for all windows on the same plane if possible, you shouldn’t see much of a performance impact. I can’t say if the performance impact if you need them all separate is significant; Roblox does some magic with instancing so if you’re smart it shouldn’t be too bad, plus the client will only need to download this mesh once.
While the performance impact of one meshpart is more than one block, my understanding was that due to caching of mesh parts, if you have 2 mesh parts that are the same meshID, the impact of the clone is equivalent to a block.
If you also turned the collision and render fidelity of these down to a box you’d further bring down performance cost.
Also I should note, I have games with cars, where every car is the same body but different paint scheme. There are 70+ different paint schemes. These are cars that are having physics enacted on them, moving these mesh parts around and the performance of the game is actually really good even on low end devices.
I think you’ll be fine with some back face windows.
What I was referring to was the scenario in which both sides are semi-transparent like if you wanted exterior to be .2 transparency while interior to be .8 transparency. Semi-transparent parts don’t instance so it would still take at least two draw calls.
If they use the same mesh ID, I’m not sure that matters. I could be wrong but regardless if you have a bunch of .8 and a bunch of .2, in the instance you’re stating, that’s still only two calls.
Yes semi-transparent parts don’t get instanced even if they’re the same ID. It’s not about “just” requiring one more draw call but rather the draw call required is doubled which carries over to any other areas that require such arrangement. It can seem trivial and yes in most cases it would be, but if a developer were to develop a city with a hundred of these instances, that’s a hundred extra calls.
Where did you get this information? Not saying it’s not true, I’m just generally curious where this was ever stated as fact. Fixing this would be a better feature request than the one you’re seemingly looking for.
It was explicitly stated by zeuxcg when instance support was expanded from mesh/csg to primitive parts. You can easily test this yourself in studio if you look at the render stats while changing their transparency from either 0 or 1 to semi-transparent.
You’re absolutely right in that it would be very nice if semi-transparent parts get instanced. However, it’s been a widely known and accepted fact by developers and staff that semi-transparent parts don’t and if it were possible, Roblox would either have already made it so or would have already considered doing so.
Or there hasn’t been enough support to back them trying to fix it. I know that semi-transparent is more taxing than 0 or 1, but I never heard anything about it not caching the mesh call. Regardless though, they thing you’re asking for would inevitably be way more taxing as you’re attempting to push two different transparencies into one brick.