How to make a Mesh texture actually have transparent parts

(I was going to post this into the public tutorials, but just wanted to do a quick quality check before doing so. Please let me know if I’ve missed anything major/ If its even useful for you!)

Things you’ll need;

  • A digital paint tool, such as Photoshop or Paint.Net that allows you to set transparency
  • A mesh that is UV mapped
  • A texture made for that specific UV map
  • How to use some basic elements of Roblox Studio

Ever made a mesh texture that is meant to be partially transparent, but when you use it, its just a black area?

On both of these lamp meshes, we have applied the texture directly into the Texture slot.
This works fine for the left mesh, as the light is meant to be yellow.
But whats going on with our right mesh? The texture is red, so shouldn’t the mesh be too?
Well, yes and no. The texture isn’t actually red. It’s transparent, but the way we have added it won’t let the Part’s colour come through.
There is another way though!


Transparent images hold some really cool uses, in this case they can let us create different coloured lamps really quickly, but you most likely see if in things like Shirts and Pants.

In order to have the colour come through, we need to change from using a MeshPart to a plain ol Part. like so;
Setup
Ok, we have our part, its the same size as our lamp, but it doesn’t look anything like it!
Alright, pipe down. We’re getting there. Next you’ll want to add in a Special Mesh into the part and copy over the MeshPart’s meshID
InsertMeshCopyThis!

And now instead of adding our textureID into the special mesh we want to add a Decal. It doesn’t matter where on the part it’s placed just so long as its in the part. We copy our texture ID into that;
AndThis

And boom, there you go! You can now use the BrickColor Property to change the Colour of our light, without needing to go and change the texture for every unique kind!
OurResult
This can be used in other things too, like a custom Shirt Display (Parts on left, MeshPart on right);

So why can I not just put a decal into a meshpart?
Honestly, I don’t fully know. Adding the Decal into a MeshPart will treat a certain amount of the mesh as its respective “Face”, but won’t carry over. For whatever reason, a decal on a SpecialMesh in a part will use the full UV map, but is treated like a decal. IE, any transparent parts STAY transparent!

You can now also set the part to be transparent, but you’ll still see the whole textured mesh!

I hope this has been helpful for you, get creative!

74 Likes

I’m going to try this out later, I had no idea this worked! I’ll follow the directions exactly and tell you how it’s worked out

Thanks! :smile:

2 Likes

please make sure to post the result and if there was anything not clear! :slight_smile:

1 Like

image

It worked! Excuse the weird colour choice, I was in a rush :stuck_out_tongue:

3 Likes

Does anyone know if this technique is something that will continue to be supported in Roblox? I would hate to build a bunch of models that use this technique only to have Roblox disable the feature in the future.

2 Likes

I briefly spoke with @zeuxcg about this at RDC Amsterdam, the conversation was more about whether or not this would be applicable to Meshparts > meshes in parts. Can’t really remember what was said about continued support.

2 Likes

I don’t see why Meshes in Parts would be effected by any changes. The big thing is the hope that MeshParts get a similar thing. If they do however make a change to this, that’d upset a lot of what I’ve been using and making.

2 Likes

By “this technique”, you mean using decals on special meshes, right? We’re unlikely to ever stop supporting this. Do note that this is not efficient rendering wise - we’re essentially rendering these objects twice, second time around with more overhead to be able to combine texture with a previously rendered part’s color. I go into this a bit in my RDC presentation from this year.

9 Likes

It’s the only way to get the part color though.

And for allowing a user to change the color of the part to anything they want, it’s essential. So, maybe a solution to this sometime? :wink:

4 Likes

Currently this is the only way to get transparent textures to work. Of course, I would love it if transparent textures would be supported on MeshParts in the future. Any word on the possibility of that happening?

11 Likes

Thank you so much, I needed a texture to tween from invisible to fully visible to give the illusion of the food cooking.

1 Like

In case you need to retain collision fidelity, this technique will not work. In my case I have a cylinder with a hole in the middle and this technique turns it into a solid part that I can no longer walk through.

By moving from a MeshPart to a Part with a Special Mesh, you unfortunately lose this ability.
However if you have two parts, a visual object and a collision object, you can retain it.
You will need to join them together, and have the visual object be non-collidable, and have the collision object be invisible.
Maintains collisions + looks like what you intend.

1 Like

This tutorial is for the most part redundant ever since SurfaceAppearance added support for texture transparency. I’m not sure what happens to outdated tutorials but the OP should edit this post to direct people to resources where you can learn about SurfaceAppearance.

3 Likes

If you have materials I could reference with, I’d be more than happy to include them within this tutorial; however, the tutorial itself is over 3 years old at this point. At the time of posting, this was the only method of allowing textures on meshes that allowed you to see the part’s true colour.

If there are additional methods that I don’t know of now, I’d be happy to take a look and incorporate them!

It’s basically taking any meshpart that’s been UV mapped in the 3D authoring software, attaching the new-ish SurfaceAppearance object to it, setting it’s ColorMap field to the desired texture, then setting the AlphaMode property to Transparency.

What I’m saying is that the SurfaceAppearance object has essentially completely eliminated the need for this workaround at all, and so may mislead any new developers who look up something like “how to apply transparent textures to meshparts in Roblox”.

3 Likes

Aha! I’m with you now.
I seem to only be able to access this feature as a beta setting and - while it does work for the intended purpose - I can’t specify the areas of the mesh I’d like to use neon in. It seems to negate all effects but ForceField.


This is a neon MeshPart with SurfaceAppearance applied, the AlphaMode is set to Overlay.

When this moves out of Beta, I’ll add this method into the tutorial as well. It’d be really useful if I was able to apply an emmission layer… possible feature request there.

1 Like

Wait, what does it look like if AlphaMode is set to Transparent? If you do that then the texture should “override” the model’s color except for wherever it’s transparent, allowing you to set the lamp bulb’s color to whatever you want.

Also, even though it’s a “beta” feature, it’s currently usable in games.

In my image, the MeshPart is Yellow + Neon.
When the AlphaMode is set to Overlay, I’m able to change the colour of the object and it will show through any transparent parts.
However, if I set it to Transparent, the yellow “transparent” segment is truly transparent, meaning you can see straight through it.

If the colour is the only thing people are after, I can see this replacing my current tutorial. As far as I can tell, this would also solve the issue of collisions too.

@zeuxcg does using the SurfaceAppearence in this way get around the rendering cost?

(I imagine it would have a similair cost?)
and is there any possibility of us getting access to an emission layer?

In that case I personally just make the bulb a separate part and use that to change the light color. I don’t think it’s worth fiddling with textures and stuff like that if that’s all you’re trying to accomplish.