How heavy is glass on the renderer?

Wanting to have a minimal lag game, but glass is a very nice material. Seems like it would be laggy on the renderer though, is it?

1 Like

Probably not that much. Roblox wouldn’t add a material that completely obliterates your computer if there’s hundreds or even thousands of parts using it.

1 Like

Glass should not be causing much lag and I would not be worried about using it as a material in game. Glass is more taxing on the rendering system however compared to other materials. (For more information read Autrou’s more detailed comment.)

In the release article by ROBLOX: Introducing New Material: Glass there was no mention of lag even when searching through the comments, so it doesn’t seem like anyone else is experiencing lag from glass either.

Edited: Due to Aotrou’s comment below.

6 Likes

While being an intern, I lived with one of the rendering engineers who said that glass is fairly taxing on the rendering in comparison to other materials. This effect is even worse when put onto a MeshPart/Union because it has to refract more than one angle of a surface.

So how taxing specifically? There’s a lot of variables. If you understand the limitations, and apply your current use case, you could dignify using it :slight_smile:

5 Likes

Software engineers make distinctions between internet latency, input device latency, rendering framerate, CPU vs. GPU bottlenecks, etc., and don’t normally call everything “lag”, so I would not expect to see that in a new feature description. Less-than-optimal responsiveness of a game can have multiple, unrelated root causes. When not otherwise qualified, “lag” in an online game more commonly refers to noticeably-high round-trip network latency, rather than sub-optimal framerate (low FPS).

To the point of the OP, the runtime performance of glass is going to be dominated by whether or not you make the parts have transparency. It’s transparency between 0 and 1 that’s most expensive, not so much what happens in the shaders, because transparent parts have to be sorted back to front on the CPU before rendering. Glass material does do more work in the pixel shader than most materials, because it has refraction and Fresnel reflection calculations, but this isn’t the bottleneck on most systems, particularly not if automatic graphics quality is used. Glass material intelligently downgrades itself, omitting or simplifying calculations at lower quality settings.

1 Like

Was also referring to the comments which had no mention of lag as a downside.

Thank you very much for this added information, provides a much more in depth explanation to the question and I am sure the creator of this post will very much appreciate it.