[Studio Beta] Major updates to in-experience Mesh & Image APIs

-- What is this screenshot trying to convey?

How do I make texture calculation faster, this is only a 256 x 256 editable image and I’m getting serious lag (150ms). Is there anyway I can optimize this to the point where it runs real time?

	---- Texture calculation --
	for a = 1, texture.Size.X * texture.Size.Y do
		local tempAmplitude = 2;
		local tempFreq = 0.025;
		
		local height = 0.01;
		local f = 1;	
		
		height = heights[f]
		
		for l = 1, 15, 1 do
			-- For more detail lower amp and heighten freq
			tempAmplitude = tempAmplitude*0.82;
			tempFreq = tempFreq*1.18

			-- Calculate WaveCoordinate
			local xz = (-1024+(a%textureSize)*8) * d[l].X + (-1024+(a/textureSize)*8) * d[l].Y;

			-- Wave equation
			--height = height + math.sin(tempFreq * xz + t) * tempAmplitude
			height = height + 2 * tempAmplitude * math.pow((math.sin(xz * tempFreq - t)+1)/2,2);
		end
		
		local outAlpha = 0;
		if height >= 13.5 then
			-- If wave is breaking, set foam opacity based on the height
			outAlpha = math.min((height - 13.5)*25, 25)
		end
		local pixelIndex = (a - 1) * 4
		if (liveOcean==nil) then
			buffer.writeu8(pixelsBuffer, pixelIndex, 13);
			buffer.writeu8(pixelsBuffer, pixelIndex + 1, 51)
			buffer.writeu8(pixelsBuffer, pixelIndex + 2, 88)
			buffer.writeu8(pixelsBuffer, pixelIndex + 3, 130)
			buffer.writeu8(foamBuffer, pixelIndex, 255);
			buffer.writeu8(foamBuffer, pixelIndex + 1, 255)
			buffer.writeu8(foamBuffer, pixelIndex + 2, 255)
		end
		buffer.writeu8(foamBuffer, pixelIndex + 3 , outAlpha)
	end
	texture:WritePixelsBuffer(Vector2.zero, texture.Size, pixelsBuffer)
	foamTexture:WritePixelsBuffer(Vector2.zero, texture.Size, foamBuffer)
	texture:DrawImage(Vector2.zero,foamTexture,Enum.ImageCombineType.AlphaBlend)

I am unable to create transparent EditableMesh colors, when doing EditableMesh:AddColor(Color3, 1), the mesh still renders fully opaque.

Editable Meshes no longer working on models under humanoids ;(

robloxapp-20241114-2042259

Thanks for the report, it looks like a bug.

As a temporary workaround, if you set the transparency of the meshPart that is being used to render the EditableMesh to something small like 0.05, then it should render the transparent vertices properly.

1 Like

I notice that that the bounding boxes of my editablemeshes are not properly aligned with the visuals


Is there anyway to fix this or is this just an engine bug similar to this? editable meshes disappearing

1 Like

Why does this restriction exist? It ruins my plans to support player-supplied HUD skins using just 1 ID to extract font colors from an atlas.

{3AAE351A-7E59-42D7-A3CA-670721825DA4}

2 Likes

I’m not too sure what happened but EditableMeshes are just not working for me at all anymore, even in the Hubcap place.

I know Roblox had some outage yesterday so maybe it’s still lingering, or something on your guy’s end, could be both. This is all that I changed to accommodate the new changes, specifically inside of the Hubcap place:

and this is how it was previously:

Welp, no longer.

Day 2 of asking to re-enable “FastCluster” for Humanoids

Thanks for catching this. The Hubcap demo in the post has now been updated to match the recent release. Please ensure you are using v24 of the rbxl file.

1 Like

Apologies for the change, and that it took a while to track down - it looks like the flag that controlled it was accidentally disabled :expressionless:. It will be re-enabled on Monday

1 Like

Thank you! I didn’t understand what was properly needed for the new AssetService system, but after referencing the updated place file my code works again :happy1:

Suddenly completely broken for me. This code to generate your own meshParts no longer works and returns an error.

– Create a new MeshPart instance linked to this EditableMesh Content
– Note: EditableMesh:CreateMeshPartAsync will be replaced with
– AssetService:CreateMeshPartAsync(Content, …) before public release
local newMeshPart = myEditableMesh:CreateMeshPartAsync(computeExtents(myEditableMesh))

It was replaced with AssetService:CreateMeshPartAsync(), but attempts to use that wind up becoming restricted to the mesh of the existing mesh part instead of allowing you to programmatically create your own meshes.

Will the ability to create EditableImages via rbxthumb:// be brought back any time soon?

1 Like

FastCluster bug fixed, thank you so much!!!

It’s just that the intense lag from setting position on the editableMeshes came back :disappointed::thinking:

This new API change is really confusing me and I’m having trouble getting my editable mesh to render onto a mesh part. Previously, when the editable meshes were instances, I would just delete the EditableMesh instance, create a new one, and re-parent it to the MeshPart every time I updated it. I’m having trouble even figuring out how to get this to work now, as the MeshPart just becomes completely invisible with no errors in the output.

This is what I have right now:

self.MeshPart = game.ReplicatedStorage.MeshPart:Clone()
self.MeshPart.Name = "Primary"
self.MeshPart.Size = size
self.MeshPart.Position = self.Origin
self.MeshPart.Anchored = true
self.MeshPart.CanCollide = false
self.MeshPart.CanTouch = false
self.MeshPart.CanQuery = false
self.MeshPart.Transparency = 0.75
Instance.new("SurfaceAppearance", self.MeshPart)
self.MeshPart.Color = Color3.fromRGB(33, 84, 185)
self.MeshPart.Parent = self.RadiusPartsModel

function Update()
    Calculate() -- Creates and adds an EditableMesh filled with triangles called self.Mesh

    local referenceMeshPart = AssetService:CreateMeshPartAsync(Content.fromObject(self.Mesh))

	self.MeshPart:ApplyMesh(referenceMeshPart)
end

When I run the game, nothing gets rendered. This worked before the change in the API and I’ve been trying to get this to work for days with no avail. Can someone please help me out?

This seems like it should work. Is self.Mesh a perfect plane? We’re currently working on a bug where a perfect plane doesn’t convert / render successfully with the API changes.

Yes it is a perfect 2d plane on the X and Z axis

Guys is mesh transformation like this is from EditableMesh? and how do I make it?
Video

@TheGamer101 Hey, would like to report a bug that’s been affecting workflow and limiting us.

Sometimes, creating 2 or more EditableImages will sometimes cause one not to render. I doubt this is a memory limit issue as I have 32gb of memory. it even happens on small EditableImage sizes (such as 52x52)

Notice how the ImageLabel layer with the cursor re-appears after I remove the EditableImage from a different ImageLabel