Square shaped UV texture image

As shown in attached image, if the packed UVs of an object take up only a portion of the square shaped texture, then the remaining texture space lies unused but take up memory.

In such scenarios can we trim the texture to the extent of the packed UVs?

If yes, how can we do it?
If no, why? and wouldn’t it be great if this was possible, allowing us to save on texture memory?

Any thoughts.

Thx

Attachments


It doesn’t take up much memory at all, but that also depends on file format, bit depth and size in pixels. UVs are set to be 1x1, or square, in some cases where this is not possible, some software won’t recognize the UV, (I had this problem not too long ago with RenderMan I believe) if the image did not fit 1x1 for some reason.

So is this a waste of space? Yes and I cringe every time it happens. Can it be clamped? Well not really, it’s coded like that and for a reason. There is actually a potentially infinite grid of 1x1 squares where the image is tiled, which can be helpful in some cases. SAving on texture memory can be done by knowing the application or the visibility of the object and adjusting resolution to those requirements. If it is something small or seen in passing, or in the distance then a low resolution map may suffice, close ups and high detail areas or large UV maps could benefit from 4k or higher resolutions.

I’ve done “rectangular UVs” for long objects to optimize texture usage in games that allow it for some time now. Of course, UVs can technically never be anything but square so rectangular textures will be squished on runtime, but you still gain in terms of optimizing for texture space and that’s why I’ve always done it I guess.

Blender allows this method, but the UV Editor needs to point to the rectangular texture before UV unwrapping.

Just a simple gif of how I do it.

Looks great @Iceythe. Thx for feedback @ajm.

In TexTools I scripted pretty much what iceythe did. Apart from that its pretty common to keep the dimensions as power of 2.

http://renderhjs.net/textools/blender/images/demo_uv_resize.gif

Memory I guess is somewhat important, more so if this case would apply to a lot of assets. But the other thing is also to always try to maximize the texel density (pixel size on the surface in 3D). The tighter you can pack your UV layout the more pixels and sharpness you can squeeze out of your textures.