0
$\begingroup$

I'm making some assets for a game that will have low res textures that mimics pixel art. Right now just by pure coincidence these two models (fridge and floor) look like they have the same pixel density, but as I go on creating more assets I would like to have a better way to keep track of pixel density as I don't want to have one object looking more high res than the others, or the other way around.

Also, the texture for the floor is tileable, so I had to scale up the UV's a LOT to make it look good. Should I have a non tileable model be my reference for what my pixel density should be across the game?

UV checkers: enter image description here

Normal textures: enter image description here

Closed up: enter image description here

$\endgroup$

1 Answer 1

0
$\begingroup$

Generally, you're probably best off doing this to eye. If you're UV mapping all of your objects at once, you can join the objects, use "average islands scale" operation in the UV editor, perhaps scale all about individual origins to eye, and then reseparate your objects.

An alternative to join+separate would be to have a joined duplicate and transfer UV from it with a data transfer modifier, probably on "nearest vertex and best matching face normal" transfer mode. For a large number of complex models, this would probably be easier, as you can copy modifiers easily from ctrl L "link/transfer data" and can apply modifiers easily with "convert to mesh" operation. All, to any number of objects at once.

If you need a really precise texel density, and/or you need to keep it uniform with finalized models, you can use these GN which rescale your UV map to a fixed world-space scale, by comparing the "real" area of the faces with their UV area:

enter image description here

It expects you to start with undistorted UV, like you would get with an unwrap using sufficient seams, or with a smart project. I've unwrapped the torus because its default UV is very distorted.

The scale parameter controls how UV space is converted to real space; larger values give you higher texel density. If you use a single value for all objects using the same size of texture, then they'll end up with the same texel density. If an object is intended to use a higher resolution texture or something, halve the scale to double the resolution. A nice quality-of-life improvement, not implemented above, would be to halve the scale automatically until it fit within UV bounds (see below for notes on this.)

If you want to get this into a game engine, you'll need to apply the GN modifier, then "convert" the created attribute into a real UV map:

enter image description here

Convert from the attribute dropdown, and specify 2D vector, and it will turn into a real UV map, which will get exported properly.

Of course, doing all of this may move your UV out of bounds of your image. If you aren't planning on tiling your textures, maintaining a precise, shared texel density will necessarily mean wasting some texture space. If a scaled object is bigger than the UV bounds, you can scale it by half, "pack islands" operation in UV editor with "scale" disabled in the operator panel, check that it fits, and then plan on using a texture image with twice the resolution you had originally planned for that model. If that still doesn't fit, you can scale it by 0.25 and use a texture four times as big. (By this, I mean that a 4096x4096 image is twice as big as a 2048x2048 image, the size of the individual dimensions, rather than the area of the image.)

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .