Decal Surface Displacement Plugin

Hello again,

After looking for inspiration from videos of other game engines’ development workflows I came across a feature that allowed the developer to project decals onto complex surfaces. I found the idea quite interesting and I thought to myself: “hmm, I wonder if that’s possible to do in Roblox”. And so I set out yet again to develop another plugin.

Introducing: Decal Surface Displacement

"So what about it?" - For ages now it hasn’t been very easy to place decals properly onto complex surfaces without using external programs to pre texture those decals onto the model. But with this you can do all of that right inside Roblox Studio. Here are some examples:




How it works

The plugin uses mesh deformation and raycasting to displace planes onto surfaces.

How to use

Well the first thing you need is the plugin of course. After installation 3 new buttons will appear into your plugin toolbar.

image

These 3 buttons insert what I call “Decal Planes” into your workspace. These planes are meshes with armatures to allow for proper mesh deformation. The different resolution (res) means the amount of bones the plane has: 5x5 = 25, 9x9 = 81, 17x17 = 289. The higher the resolution the more performance heavy each plane will be. Lower end pcs might have difficulties calculating the displacement in real time.

Each of these planes has 3 custom attributes you can manage. Here is the list of all of them:

image

Bake = Stops the plane from deforming and keeps its current shape at all times.
Offset = How much the plane is lifted from the surface normal.
RayRange = How far the RayCasting reaches.

And since the planes are MeshParts they of course support the SurfaceAppearance feature. So if you want to give your decals PBR properties you can very well do so.

Because the plugin requires quite heavy usage of mesh deformation I would advice against any heavy usage of them. The decals can leave a serious dent in performance if not used at a reasonable rate.

And that is pretty much all there is to know about it. If you’re interested then please give it a shot! I would also love to hear what you think. If you have any issues to report or any ideas to give then do let me know.

Side note:

15.5.2021
The Cage Mesh Deformer beta feature seems to stop the plugin from working properly. I recommend turning it off for the time being if you’re experiencing issues with it turned on.

You can find my other plugins here:

Thank you! : )
-Sol

293 Likes

This is… amazing! I’ve always just wondered if this could ever be implemented so we can actually have things that have form and you made it happen. I will definitely use this regularly! :+1:

7 Likes

This is insanely cool. Do you know if it supports textures, or only decals?

3 Likes

Thank you! And yeah texture instances are supported as well.

3 Likes

Thank you I’m glad to hear that!

1 Like

Have you measured the performance impact of this at all at some scale of use? Just curious.

8 Likes

I appreciate this a lot! You just saved me a lot of time.
Great job with this plugin - I already love it by looking at the previews you published. :+1:

4 Likes

This is a super clever application of skinned meshes!
However, I’m not terribly confident in the performance of this; mesh deformation comes with initial overhead IIRC, and you’re creating parts with 25-280 bones inside to sell the wrapping effect. Seems a bit unwise for game-sized use?

8 Likes

I’ve only worked on this for the past day or so so I haven’t had a lot of time with it myself. I’d expect it to leave some dents in performance depending on the usage of course.

2 Likes

I don’t expect it to be the most performant thing in the world. I wouldn’t advice filling a whole map with these as it’s definitely going to impact the performance quite heavily I’d imagine.

1 Like

This is great! But, is there a possibility for other GUI objects, like TextLabels for example in the future?

2 Likes

With the way Roblox handles SurfaceGuis it’s pretty much impossible from what I know.

1 Like

I notice that you don’t have a tool for adjusting these, which means you’re live-updating them in the workspace when bake is false. It doesn’t look like you’re using CollectionService to track which parts should be subject to processing, so since this doesn’t break when you reopen the place, you must be parsing the entirety of workspace. You might want to consider using CollectionService instead.

4 Likes

If I understood your comment properly you meant that I’m constantly looping through the workspace? What I’m doing is looping through the user’s selections whenever the selection changes and checking wether or not what they have selected is valid for deformation.

1 Like

I think Roblox should implement this as a tool for Roblox developers!

1 Like

deep breath

YESSSSSSSSSSSSSSSSSSSSSSSSSSSSS
(sorry about that)
I’ve been looking for something like this for extremely long because I have no idea how to texture so with this I can finally do it easier!

1 Like

Considering skinned meshes still have a pretty substantial impact at scale even for meshes that aren’t updating/doing anything, it’s probably not great

Unfortunately this is why I have decided against playing with it for things like trees and grass

8 Likes

One step closer to making projectors like the movie theaters, this is going to be amazing to use, amazing job!

2 Likes

NOW THIS IS AWESOME!

I always wanted something like this! Thank you so much for creating this!

2 Likes

Yeah you can only get what you can get. I’ll probably try making a system to switch between a plain plane and a plane with an armature when they’re out of view to hopefully improve the performance of these.

3 Likes