Decal UVOffset / UVScale causes significant performance impact

For years the way that games create decals on surfaces, such as bullet holes, is by creating extra invisible baseparts, parenting decals to those new parts, and welding those parts as new physics objects if the target object is unanchored. With the introduction of the decal UVOffset / UVScale properties, I decided to remove the extra invisible baseparts as a new performance optimization by calculating the UVOffset / UVScale to position and size bullet holes as decals directly applied to the target object. Instead this has resulted in extremely degraded performance. Where you can have literally 1000x decals on 1000x seemingly unnecessary invisible baseparts for 1000x bullet holes all within view at once without losing ANY fps, remaining at 60 fps, you can’t even have 40 decals using UVOffset / UVScale within one basepart within view without dropping to 20 fps and choppy gameplay.

This performance impact only happens inside the Roblox Player in my observation. In Roblox Studio with editor quality level set to 21 I can observe the UVOffset / UVScale decals both in the editor viewport and in a play-test without any performance impact.

Attached is a video demonstrating the performance issue in a minimal place file played on the Roblox Player, and a copy of the minimal place file.

System: Windows 10 Pro 22H2, AMD Ryzen 7 5700G @ 3.80 GHz, 32GB DDR4 RAM, NVIDIA GeForce GTX 1050 Ti 4GB VRAM


decal uv test.rbxl (77.8 KB)

3 Likes

Thanks for the report, but this is expected unfortunately.

Basically with the old method the engine only overdraws the pixels where the wall and a bullet part overlaps, even with 1000s there are only 2-3 layers for a pixels on a screen. But with the new way they make the large part’s surface render over and over again making 40 layers of overlaying and computing each pixel 40 times. They scale and offset, but the engine still runs everywhere for the transparent texels

We recommend continuing to use the old method.

Can we at least be able to use only the normal maps of a decal or texture? I want to be able to overlay a detail on top of the existing texture without adding another diffuse map.