#editable images

1 messages · Page 1 of 1 (latest)

dreamy inlet
#

does anyone here know a little something on editable meshes or more specifically editable images im stuck on something

potent arch
#

Decals?

gray sandal
uncut falconBOT
#

studio** You are now Level 2! **studio

dreamy inlet
#

thats something that i beeen stuck on

#

trying to project a editable image decal of a grass texture onto a editable mesh terrain

dreamy inlet
#

let me show you guys my current broken script and could you tell me if its missing something or is somthing in it incorrect?

gray sandal
#

local AssetService = game:GetService("AssetService")

local function eImageTexturingSystem(eMesh: EditableMesh, meshPart: BasePart, raycastHitPos: Vector3)
local eImageTextureId = "rbxassetid://12989562922" -- ID of the texture you want to project
local textureSize = Vector2.new(2048, 2048)

-- Create editable image for the final projection
local editableImage = AssetService:CreateEditableImage({Size = textureSize})

-- Load decal as an editable image from asset ID
local decalImage
local success, result = pcall(function()
    return AssetService:CreateEditableImageAsync(Content.fromUri(eImageTextureId), {Size = textureSize})
end)
if success then
    decalImage = result
else
    warn("Error loading the texture:", result)
    return
end

-- Relative position of the hit point
local relativePos = meshPart.CFrame:PointToWorldSpace(raycastHitPos)

-- Direction toward the camera (optional if unused)
local direction = (workspace.CurrentCamera.CFrame.Position - relativePos).Unit

-- Configure projection parameters (adjusted to one chunk)
local projectionParams: ProjectionParams = {
    Direction = Vector3.new(0, -1, 0), -- Projecting downward
    Position = meshPart.Position + Vector3.new(0, 10, 0), -- Projecting from above
    Size = Vector3.new(meshPart.Size.X, 20, meshPart.Size.Z), -- Coverage area: width and depth of the chunk
    Up = Vector3.new(0, 1, 0)
}
#

-- Set up the brush for projection
local brushConfig: BrushConfig = {
Decal = decalImage,
ColorBlendType = Enum.ImageCombineType.BlendSourceOver,
AlphaBlendType = Enum.ImageAlphaType.Default,
BlendIntensity = 1,
FadeAngle = 90.0
}

-- Apply the projected texture to the EditableMesh
local paintSuccess, paintError = pcall(function()
    editableImage:DrawImageProjected(eMesh, projectionParams, brushConfig)
end)

if not paintSuccess then
    warn("Error projecting the image:", paintError)
end

end

#

-- Set up the brush for projection
local brushConfig: BrushConfig = {
Decal = decalImage,
ColorBlendType = Enum.ImageCombineType.BlendSourceOver,
AlphaBlendType = Enum.ImageAlphaType.Default,
BlendIntensity = 1,
FadeAngle = 90.0
}

-- Apply the projected texture to the EditableMesh
local paintSuccess, paintError = pcall(function()
    editableImage:DrawImageProjected(eMesh, projectionParams, brushConfig)
end)

if not paintSuccess then
    warn("Error projecting the image:", paintError)
end

end

#

@dreamy inlet I think this script can help u

dreamy inlet
#

LIFE SAVER

gray sandal
#

WTH IT WORKED

#

I FIXED it in mobile XDDDD

#

The problem was The chunks are loading so quicly