1
$\begingroup$

I have a strange request, I think it will require a bit of background first:

I'm working on a game that uses nearest texture filtering instead of interpolating (like the textures look pixelated instead of blurry when viewed up close). Because of this, I don't have to worry about UV islands bleeding into each other as long as they are aligned on the pixel grid. I'm making the models quads only and all of the quads are fairly uniform in scale, so here's what I'd like to do for the UVs:

Each quad is to be unwrapped as a perfect square whose area is 1/2^n of the UV grid so that each quad contains a small grid of pixels. There should be no space between the islands.

I'll probably make the texture at a resolution where each quad gets a number of pixels equal to the maximum anisotropy filter otherwise the islands/quads will bleed into each other.

I found an addon that lets me unwrap grids of quads into aligned grids but it doesn't work if all the quads are separate (it just stacks them on top of each other). Any ideas?

$\endgroup$
  • $\begingroup$ If you use U -> Reset and Ctrl-p to pack the quads with 0 margin you should get pretty close. No power of two resolution guaranteed tho, depends on the number of quads. You could rearrange them quite fast with vertex snapping. Is manual adjustment out of the question, what number of faces are we dealing with? You could do it with some python of course. $\endgroup$ – kheetor Apr 26 '18 at 19:43
  • $\begingroup$ The biggest model will be around 1500 quads and there will be a lot of other models made with this way, so I think I'll need to do it with python somehow. $\endgroup$ – halbe Apr 26 '18 at 20:03
  • $\begingroup$ A friend just told me about lightmapping which seems to do almost the same thing I need, but the quads must all be the same size. $\endgroup$ – halbe Apr 26 '18 at 20:10
  • $\begingroup$ We / I can make you the python script no problem $\endgroup$ – kheetor Apr 26 '18 at 20:22
  • $\begingroup$ Really? That'd be great! One option I'm torn between is for whether each face should be a square of equal size as the rest or the closest fitting rectangle of pixels. If I wanted the latter then the lightmap WOULD be fine were it not for the problem of it not lining up with the pixels (which I thought was the point). Am I missing something? $\endgroup$ – halbe Apr 28 '18 at 19:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.