Currently, Roblox doesn’t support the editing of texture maps of SurfaceAppearances in a live, running game. We are only limited to those which are set in Studio and published to the game.
Use Case:
This would be useful for any type of in-game UGC involving meshes or any case where you’d want to swap many textures on a mesh.
In our game, we allow players to upload custom liveries to their police cars. We get hundreds of these uploaded to the game every day. (Yes, our staff manually approves them on top of Roblox approval.) Currently, we’re limited to using Decals to apply said textures onto a car body mesh. There are obvious limitations with Decals- mainly the fact that we have to use a separate decal/image for each side of the mesh. Whereas a SurfaceAppearance supports UV wrapping a single image onto the mesh. UV maps would work much better when applying a livery to the curved and edges of a car. Decals often get stretched or cut off on the non-flat surfaces.
This could be useful for any range of applications where you’d want to change the texture of a mesh in-game. For example, a prop in the game catches on fire, we want to replace the default texture with a burned texture. Currently, you must have a duplicate of every mesh for each unique texture you want to use. Not only is this not ideal for the developer workflow and game setup, but this is very limiting in cases where you want the ability to swap between many different textures or even if you don’t know what textures it will use until the server is already running live.
Why cant we use the MeshPart.TextureID property? Two reasons: 1. It doesn’t support PBR maps and 2. We loose the ability to recolor the MeshPart (our textures have some transparent area, the mesh is recolorable by players in game).
Yeah, I definitely agree. As someone who has made a lot liveries in ER:LC, it would definitely be easier to not have to keep track of so many decals. Along with that, it would be much easier for livery designers to make better looking liveries that aren’t limited by the limitations of decals.
On the larger scale, I can see this be put to use in many instances which could help developers save a lot of time.
Big support from me, this is really a significant design flaw with current SurfaceAppearances. The listed reason is “performance” but in my testing from loading dozens unloaded textures into different SurfaceAppearances all at once through a command bar script shows no measurable performance loss, though the textures are blank white for a few seconds while it’s computing.
Even if there was a performance loss, it’s still no reason why we shouldn’t be able to set them at all. Currently it is flat out impossible to set the texture tint of a MeshPart at runtime unless it comes with a SurfaceAppearance.
Glad that someone is finally making a feature request for this! I ran into the same problem a bit ago when testing out the capabilities of editable meshes/images.
Bump, this one feature is more important than Roblox realizes and the only workarounds around it require hacks involving outdated classes like SpecialMesh that we shouldn’t have to rely on anymore.
Absolutely, I want players to create their own SurfaceAppearances with their own textures.
Due to this, any other workarounds (pre-making all the surfaceappearances in studio and swapping their parent) cant fix the issue im facing now.
Changing SurfaceAppearances in real time, with no performance impacts or visual flaws is not even needed in my case, I just want the ability to create it with given contentIDs no matter how long it takes.
I just ran into this issue when trying to make custom character controller which utilizes SurfaceAppearance to render shirts and pants without Humanoid. Since I cannot change properties at runtime, I tried calling CreateSurfaceAppearanceAsync, but it requires EditableImage which I need to create through CreateEditableImageAsync that performs a permissions checks to see if I own the asset, but thing is that I cannot own every shirt and pants on the platform.
The only workaround I can think of is to scrape every shirt and pants from catalog and save them at edit time as SurfaceAppearance within ServerStorage and use hash map to look up at runtime. That would be at least a billion to save, thus very unrealistic.
Another issue with EditableImages (this would need to be a seperate feature request), is you can only update a single EditableImage per frame. If you attempt to update multiple at a time it will instead queue the other images and they will be updated the next frame and so on. This restriction was originally made when EditableImages were in beta access and far more memory intensive, and while EditableImages/Meshes are still somewhat memory intensive this should be an optimization issue that falls onto developers rather than Roblox restricting capabilities out of fear of optimization issues.
I ran into the same issue! I finished creating my custom character controller library, a total replication of Humanoid behavior but without a humanoid, only to realize that I am unable to allow users to customize their shirts/pants.
The only thing holding me back from keeping avatars looking 1:1 with the avatar the user has picked on their profile is the inability to use AssetService:CreateSurfaceAppearanceAsync() with an AssetId as an input. ROBLOX has stated in the API Reference for this that Asset Id input is in the works, but there is no provided timeline for when we can expect this.
Without this feature, I am unable to allow the user to pick their own clothing and must instead provide a list of clothing they are able to wear. If this feature is added, I will be able to apply a SurfaceAppearance with the users ROBLOX avatar Shirt and Pants asset ids and be able to allow them to wear whatever shirt/pants they desire.
There is no solid workaround to SurfaceAppearances as applying the texture directly to the MeshPart does not allow for transparent portions of textures (which shirts and pants have).
I found a partial solution after a lot of searching. This plugin came up with a neat method of recreating shirts/pants via Texture instances by setting perfect offset and studsperu/v.
This method is not 100% accurate but sort-of works. I am bumping this again because ROBLOX needs to add runtime assetid surfaceappearance creation via AssetService:CreateSurfaceAppearanceAsync()!