Modernising Texture Properties

Currently on Roblox, it’s too hard for new developers to figure out how to use textures, and for power users to utilise them fully, as it has obscure or missing properties which do not line up with other instances such as ImageLabels.

New developers are often confused when confronted with Textures for the first time. The current properties are confusing to people who have never heard of UVs before. I’ve heard many complaints from these developers about how it’s easy to mix up and almost a different language compared to the names of other properties they’ve encountered. It doesn’t fit in well with the rest of the mental model of the Roblox APIs and naming conventions for them.

Therefore, I propose deprecating and hiding the current StudsPerTileU/V and OffsetStudsU/V properties and replacing them with three new properties:


Vector2 TileSize
Replaces StudsPerTileU/V with a more intuitive way of specifying the tiling size of textures, in terms of X and Y (i.e. width and height, consistent with the rest of the Roblox API). Not much needs to be said about this one.

Vector2 TileOffset
Replaces OffsetStudsU/V just like we did above. No explanation needed here either.

Rect ClipBounds
Similar to how ImageLabels have ImageRectOffset/Size, this would specify a clipping rectangle to use for the texture. This would be especially useful for spritesheets, which could consequently alleviate network load when used smartly, and make animations much easier to handle. If desired, this could be split into two separate Vector2s to match ImageLabels, and could also be backported to decals.

Note on ClipBounds

Technically, you can imitate how ClipBounds would behave by using a combination of size and offset, but you get some colours leaking through at the edges;

image


The Texture class has always felt a bit legacy compared to the rest of Roblox. They are very useful already as they’re much more lightweight compared to SurfaceGuis and ideal for adding detail to builds or completing a game’s aesthetic. With these small modernisations, Textures could be brought into the modern era, and working with them could be as delightfully simple and powerful as the rest of Roblox, and much more accessible to the new developers who wish to use them :slight_smile:

16 Likes

Update on this post - texture offsets were just added! You can imitate the proposed ClipBounds property by combining OffsetStudsU/V and StudsPerTileU/V, but it appears you still get other frames leaking in at the sides:

image

I’ll update the post to include OffsetStudsU/V alongside StudsPerTileU/V and mention this new ClipBounds imitation stuffs.

3 Likes

I’m going to bump this again, but I’ll also add that this would be a nice API surface to have for SurfaceAppearance; that way, meshes could make use of texture atlases for PBR materials too. :slight_smile:

1 Like

This would be a great feature. It’s already possible to do texture atlases, but you lose the ability for the surface appearance to repeat/tile which is a huge drawback.

Being able to directly set clip bounds would also just make the whole process easier, so you don’t have to line up all your UV’s.

I’d also appreciate having an offset property on both surface appearance and custom materials. Lining materials up is near impossible as things stand now, unless you limit yourself to working in set increments.