Ability to layer Textures and Decals by ZIndex / Priority

This problem might have been mentioned, but I want to address mesh textures too.

You see. There is a small problem I’d like to talk about.
I am trying to make colorable eyes (because Color3 for decals and textures is coming soon).

I really would like an option to set decal priority.
I want to have effect 1 instead of effect 2.
I can’t be sure if it will work or not, that’s why I need priority.

We could also be able to use a new instance for MeshPart layers, packages, anything that uses an advanced mesh but can’t really have a decal.
We don’t have to make new parts for that.

Here’s a public tweet of my idea.

122 Likes

Very useful in many cases, support.

5 Likes

Support!

5 Likes

I think you are already able to achieve this, I think it’s guaranteed that the decals will be applied in child order. That is, the first decal added to the part will be applied underneath the second decal added to the part.

3 Likes

This isn’t always the case; Insert order: black, red, green, blue

17 Likes

Interesting, I’ll try to investigate if there is any order defined. Was this inserting the decals using code or using the studio decal insert tool? If it was using the tool I wouldn’t be sure that the child order is as expected. Did you try printing the order of the decals using GetChildren()? This would verify that the child order isn’t what decides the rendering order.

I had a quick look at the code and it looks like for face decals the order is reverse child order so the last decal added should be drawn first. Will need to look more to see what is happening for decals on parts.

This is definitely complicated and it might not be possible to guarantee that you get the desired effect stacking decals so I support the API in theory but I’m not sure what the performance implications would be.

4 Likes

Performance shouldn’t be a big problem as long decals aren’t spammed.

2 Likes

Would love to see this! Support!

2 Likes

I needed this a long time ago, as I was trying to make a game where you could customise your character on the basis of having different patterns for skin (of which you could change colour, but could not at the time so I used surfaceguis, but they have no lighting whatsoever so people glowed in the dark), as well as clothes over the top of that, but that wasn’t possible unless I used more surfaceguis that glowed in the dark & also didn’t wrap to the mesh.

1 Like

I just ran into this issue. While parts inside a Humanoid have appropriate layering (though anything other than the head is unusable), parts outside of a humanoid have no predictable ordering whatsoever. During runtime, the order of the decals will change sporadically:

https://gfycat.com/EntireSnoopyGartersnake

The camera/character move in this video, but that is not required. It has happened when I was completely still.

This is somewhat observable in Edit mode too: order does not change at all, but when inserting new decals, it can become impossible to get one decal to layer over another. Insert decal and it’s under another. Remove the decal it’s under and paste that one back in, and the previous is still under it. Swap the textures of the decal and the one is still under the other. The decals’ ordering isn’t following any sort of predictable manner.

It’s important that decals layer by the order they’re inserted rather than randomly changing, as in their current state they’re completely unusable.

2 Likes

Really wished there was more pressing for this. :frowning:

but specifically, it needs to work on meshes

9 Likes

I have found that I am in the market for this feature. Even if it’s as simple as the oldest decal is displayed on the bottom, that I need some form of consistency.

As a developer, I want to introduce skins to vehicles in my game. Some of the vehicles already have decals applied, and I would like to apply decals under or over the existing decals, consistently, depending on the skin.

As an example: I have a car with the game’s logo displayed on the hood, and I would like to include a racing stripes skin. The decal I have made for the racing stripes is completely white so I can change its color with ImageColor3. I would like to layer the game logo on top of the racing stripes without creating decals for each color with the logo superimposed, a large time sink to generate all the different decals.

10 Likes

We really need this to happen, this would be amazing because i’m currently trying to create easily customizable eyes with multiple decals on the same side so I can change the colors of the pupils without affecting the rest but the decals ZIndex order is pretty random so I have to use only one decal.

I can’t use SurfaceGuis either since it doesn’t wrap around the part. (a sphere in my case)

An alternative is uploading the same face but with slight variations in colors each time, but this is not only time consuming but also limits the amount of colors and I don’t exactly like uploading alot of images for a tiny feature.

2 Likes

Did you try the Color3 property of decals? https://developer.roblox.com/api-reference/property/Decal/Color3

I know about it, the problem is it colors all pixels, I only want to color some areas like the inside of the pupils, not the eye white or the eye pupil light glow.

2 Likes

As a Roblox developer, it is currently too hard to adequately manipulate multiple textures on the same object face. When applying multiple textures to a face of a part, there is no way to determine which texture will be placed on top of the other. This is particularly challenging when using one texture as a background layer and then applying another texture with transparent attributes to add further detail to it.

An example of this issue would be creating a custom brick wall texture with a texture of grass lining the bottom of the part. There is no way to manipulate either the properties or the texture manually to guarantee that the textures will be seen in the order of grass on top of the wall as opposed to the wall covering up the grass. Furthermore, even if a result is successfully achieved where the grass is lying over the wall texture, it is possible that when studio loads again the images will switch places and the wall will cover up the grass.

If this issue is addressed, it would improve my development experience because I could more reliably manipulate texture behavior on different parts while also insuring standardization in texture behavior - rather than having a texture behave one way in Studio and then behave/display differently when Studio is reloaded.

Thank you for your consideration!

12 Likes

We really need support for this. The hacky workarounds to achieve this are really not ideal.
(same issue as OP - making eyes)

The eyes in our game require 2 textures, so that you can recolor them. This means we have to use 2 layered parts. One for the white, and one for the colored pupil. These are applied to two meshparts that are very close together (red & blue):
image

This unfortunately causes clipping, see 0:04 in the video. (This is not a bug - it happens for understandable reasons, but is another argument for why we need Decal.ZIndex)

I don’t know how to work around this so we’re going to live with it for now!

15 Likes

My game and many others use transparent meshes as tree leaves and it causes intense Z-fighting, totally support this feature.

11 Likes

Hello once again! I think this suggestion should be brought back, since there’s advanced MeshPart stuff around. If this thing will be done for textures and decals, that would be neat.

6 Likes

We really need recolorable and orderable texture overlays for skinned PBR MeshParts. I’d like to see layer ordering implemented for SurfaceAppearances alongside recoloring, even if it sorts by .Name or by parent order.

Recoloring is essential for skin colors, and the ability to order textures would be great for player customization which is a big revenue driver for many games.

1 Like