Decals are not UV-mapped to SpecialMesh anymore preventing use of transparent textures

There was a technique to achieve transparent textures on meshes by using a Decal on a SpecialMesh, as explained in this thread: How to make a Mesh texture actually have transparent parts

Quote from @zeuxcg (Roblox Staff) in that thread:

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.

But this method of applying decals to SpecialMesh has recently stopped working, instead it applies Decals as it is applied to Parts, just on the Face specified on the property of the Decal. Leaving developers with no options to achieve transparent textures (and also breaking existing implementations).

Visual example:

This butterfly used to have proper wing placements and a face texture when Decals was UV-mapped, after the change in behavior of Decals it looks like this:

image

5 Likes

I remember I ran into this problem a while back with some of my mesh uploads. It was a weird thing where some meshes wouldn’t accept my decal as a texture on a special mesh where others would be just fine.

I don’t remember the specifics of what caused this, but I just uploaded a mesh today that I textured with a decal on a part with a special mesh inside of it, so this is not a bug that’s facing “all uploads” which can make it harder for staff to narrow down the cause.

Give some more details, and maybe staff can get to the bottom of what causes this sometimes.

Suggested Info:

  • What program was used to create the model
  • What program was used to create the UV Map
  • What program was last used to create the model*
  • Was vertex paint ever applied to it
  • What does the model look like without anything on it / transparency 0 (helps us better visualize the issue)
  • When was the model & texture uploaded to Roblox
  • What file type was the model (obj, fbx, etc)

*I know this question feels like a repeat of the first one, but as a note, I tend to buy models from modelers who create it in Blender, give it to me as a OBJ, then I take it into 3DS Max, give it a UV Map there, and then export as a FBX to Roblox

In our case it was a clear regression since it used to work and without changes to the game it stopped working.

  • What program was used to create the model Maya
  • What program was used to create the UV Map Maya
  • What program was last used to create the model* Maya
  • Was vertex paint ever applied to it No
  • What does the model look like without anything on it / transparency 0 (helps us better visualize the issue) It is a box/plane, this is the wing mesh: RenderMesh - Roblox with the following texture Images/wings_round_stars - Roblox
  • When was the model & texture uploaded to Roblox: December 2019
  • What file type was the model (obj, fbx, etc) Obj
1 Like

A game I’m currently working on relies on this behaviour for character models (Mesh “clothing” and hats that allow arbitrary part colours, however certain parts require a certain texture no matter the team colour. Because of this we overlay the part with a Decal colour palette which is mapped accordingly to the mesh, solving the issue of the entire thing being coloured when changing the part colour).

This behaviour still works as intended for me, both in live games and in studio. I also attempted to reproduce the issue you’re having here, but can’t. It works as intended.

2 Likes

Thank you for the response - the problem was that we used a MeshPart as parent to the SpecialMesh rather than a Part, so the engine change affected that setup.

Replacing the MeshPart with a Part solved the issue.

1 Like

Ended up writing a small temporary plugin to fix the pets, result:

698613e936f15954d407d2887ccfc2e3

The code I wrote:

local toolbar = plugin:CreateToolbar("TGS Tools")

local button = toolbar:CreateButton("Fix Lumberjack Pet", "Fixes a Lumberjack Pet", "rbxassetid://4458901886")

local insertService = game:GetService("InsertService")
local selection 	= game:GetService("Selection")

local propertyNamesToCopy = {
	"Name", "Anchored", "Locked", "CanCollide", "CollisionGroupId", "Massless", "Transparency", 
	"Color", "Material", "Reflectance", "CFrame", "Size", "Orientation", "Archivable", "CastShadow",
	"RotVelocity", "Velocity"
}

local function onButtonClicked()
	local selectedModel = selection:Get()[1]
	
	if not selectedModel:IsA("Model") then
		print("You must select a pet model")
	end
	
	local children = selectedModel:GetChildren()
	
	for _, modelChild in pairs(children) do
		if modelChild:IsA("MeshPart") then
			local newPart = Instance.new("Part")
			newPart.Parent = selectedModel
			
			-- Copy the properties of the MeshPart
			for _, propName in pairs(propertyNamesToCopy) do
				newPart[propName] = modelChild[propName]
			end
			
			-- Move the children from MeshPart to the new Part
			for _, meshPartChild in pairs(modelChild:GetChildren()) do
				meshPartChild.Parent = newPart
				
				-- Update any welds
				if meshPartChild:IsA("WeldConstraint") then
					if meshPartChild.Part0 == modelChild then
						meshPartChild.Part0 = newPart
					elseif meshPartChild.Part1 == modelChild then
						meshPartChild.Part1 = newPart
					end
				end
			end
			
			-- Remove  the MeshPart
			modelChild.Parent = nil
		end
	end
end
button.Click:Connect(onButtonClicked)