Home Technical Talk

Strange UV error

Hi.
I am hoping any of you know what´s going on here.
I am using 3dsmax 2012 and have a weird error.

I have Unwrapped a 3d model, and up close in 3dsmax it looks correct.
But when I zoom out in the editor I get lines at the edges of the model, it´s like the texture/UV moves/scales when I zoom out.

Anyone have any ideas on how to fix this?

Replies

  • Ruz
    Options
    Offline / Send Message
    Ruz polycount lvl 666
    mip mapping ie you need to have have more padding or bleed around your uv map
  • EarthQuake
    Options
    Offline / Send Message
    Ruz wrote: »
    mip mapping ie you need to have have more padding or bleed around your uv map

    Not only that, but you need enough padding between your uv islands. If your islands are only 1 pixels apart it will work at 2048, but mip down to 512 or even 1024 and you'll start to have issues.

    Good rule of thumb is probably about 16 pixels between uv islands at 2048, 8 at 1024, 4 at 512 or so.

    Also, if you have a black material right next to a white material, you want even more padding between islands, and make sure your background isn't black. I turn up the "edge padding" on my bakes to like 64 pixels or something to get rid of as much background as I can.
  • MaliceSmash
    Options
    Offline / Send Message
    Thanks for your replies :)
    Just so you know, I am mapping the objects in my scene to an atlas with 9 different textures. Some of them needs to be mapped like a tiled texture, so if I have to use padding to compensate, it will be almost impossible to get the desired results.

    Is there any way to save the vertex position on the bitmap?
    Ex. vertex 1 position is between pixel 2 and 3 (x) and between 2 and 3 (y).
    If I could do this then padding would not be necessary.
  • Kurt Russell Fan Club
    Options
    Offline / Send Message
    Kurt Russell Fan Club polycounter lvl 9
    No, I think you still misunderstand. Mip mapping is where your graphics card will choose lower resolution versions of your texture when a polygon is small (far away or at glancing angles). The lower resolution effectively blurs your texture.

    There are other things you can do as well as padding - make sure any texture islands near each other are similar colours. Also, for tileable textures you should subdivide your image by splitting it down the middle in to four quadrants, then again to 16 etc., so that when your texture is downresed you get the minimum bleed.
  • Ruz
    Options
    Offline / Send Message
    Ruz polycount lvl 666
    yeah that 64 pixel paddding EQ mentioned also looks very cool Presentation wise:)

    if it's a tiled texture , is n't there an option to 'clamp' the texture so you don't get that 1 pixel bleed.
    long time since I have done this stuff with blitz 3d engine, can't find an option like this in max.
  • MaliceSmash
    Options
    Offline / Send Message
    Yes, it´s the clamp function, I seek.
  • Kurt Russell Fan Club
    Options
    Offline / Send Message
    Kurt Russell Fan Club polycounter lvl 9
    How is clamp going to help you if you're tiling textures?

    Do you know what mip-mapping is?
  • Ruz
    Options
    Offline / Send Message
    Ruz polycount lvl 666
    MaliceSmash - actually you can do this in max, got to bitmap output in the material editor and clamp is there.
    Kurt Russell Fan Club - from what i remember if you are tiling a texture map , the clamp just means you dont get a 1 pixel black line around the texture.
    i am not tech savvy enough to exaplin it any further:)
  • Kurt Russell Fan Club
    Options
    Offline / Send Message
    Kurt Russell Fan Club polycounter lvl 9
    Sorry Ruz, I'm not sure if we're talking about the same thing :/ If it's the clamp that I think you mean, it stops a texture from tiling outside of 0..1 space, which will only help if your texture is being sampled near or over the edges.

    I believe the issue is mips, especially if malicesmash is tiling 9x9. Here's what you'll get when your texture mips in a non-power of two texture atlas:

    36Vrd.jpg

    It looks like rubbish because of the way mipmap creation halves the texture size each lower LOD
  • LoTekK
    Options
    Offline / Send Message
    LoTekK polycounter lvl 17
    Yeah, it's the mipmaps, nothing to do with clamp vs wrap.

    This is what you get when you try and tile a clamped (as opposed to wrapped) texture:

    clamp.jpg
  • MaliceSmash
    Options
    Offline / Send Message
    Ok, now I got this thing working.
    And yes, I do know what mip-mapping is.
    But it is not the solution I want.

    Let´s say I have an atlas (512x512) with 2x2 textures. I want to map 1 polygon (square) on to one of the textures in the atlas, v1: 0x0, v2: 256x0, v3: 256x0, v4: 256x256 (a perfect square). What I want to do now is to clamp the lines to that texture in the atlas so all mip-mapping go inwards and not destroying the edges between the different textures in the atlas.

    It´s kind a hard to explain because English is not my main language.
  • LoTekK
    Options
    Offline / Send Message
    LoTekK polycounter lvl 17
    If you're sticking your tile borders at the halfway lines, then you're already minimising the effects of mipping as much as possible, without switching your texture filtering to point, instead of bilinear/trilinear/etc.

    The problem in this case is not so much the mipping (though it contributes), but the filtering.
  • cw
    Options
    Offline / Send Message
    cw polycounter lvl 17
    Using tiling textures packed into one sheet has some unavoidable issues:

    http://udn.epicgames.com/Three/TerrainAdvancedTextures.html

    There will always be a slight bleed, even with a few tricks to pad those tiles by a couple of pixels.

    If you do crack it though - let me know! I spent a bit of time looking at this a while back and ended up discarding the approach.
  • Angry Beaver
    Options
    Offline / Send Message
    Angry Beaver polycounter lvl 7
    There is nothing apart from re writing your own shaders and post processors to preserve that edge 100%. It's going to bleed, there's nothing you can do to stop that. What you need to do is make the bleed look good despite that. and you've been told how to do that already. If thoose solutions are 'incompatible' with what your trying to do perhaps your entire approach needs to be re-examined which we can help with.
  • MaliceSmash
    Options
    Offline / Send Message
    Thanks for all your answers, it helped a lot.
    The simplest way I found was to resize the 1024 atlas to 128 and then map it on the models. Then switch back to the 1024 atlas, and it looks good enough.
Sign In or Register to comment.