Home Technical Talk

Edge Padding

Hi,

I was trying to learn more about the efficient UV techniques for game models. And that is how I came to know about the importance of edge padding from some earlier posts here. Unfortunately I have already prepared a few game props like furniture, crates and barrels etc. without edge padding. Now I have to recreate them. Paying a great price for lack of knowledge :poly122: No problem, but before messing up my works once again I want to be clear about a few more points:

1. Is edge padding equally necessary for flat and even objects (like box, armoires, bookcases etc.) and uneven organic models (like characters, creatures or rocks)?

2. I work in 3Ds Max which has an option of adding edge padding in its "Render to Texture" option. However, for simple models, if I want to add 2 px padding in Photoshop using "minimum" filter, then which of the following methods should I follow:

  • After finishing the texture, add a 2 pixel padding using the base color of the texture.
  • Before starting the texture, take a transparent layer, paint the UV area with a flat color. Then apply the minimum filter to add a 2 px padding. Once done, use this layer as a mask on your main texture layer, so that the resulting uv area seems to be 2 px expanded than the original uv. Would this second method be more effective than the first one? Because in this case even if bleeding occurs during mip mapping, that won't be visible because the expanded area also contains the same texture.
Please correct me if I am wrong. Also let me know if there is any better suggestion, solution or tutorial which explains a more detailed texturing technique with edge padding in focus.

Replies

  • respawnrt
    Offline / Send Message
    respawnrt polycounter lvl 8
    You can use a photoshop plugin for automatic edge padding.It is called dillation and comes whith xnormal ps plugins.
  • felipefrango
    Offline / Send Message
    felipefrango polycounter lvl 9
    Yeah, the Dilation filter is the easiest option, I think. As long as you have enough space in between the UV islands.
  • solar
    Offline / Send Message
    solar polycounter lvl 18
    You can also use textools to convert your UVs to 3D mesh then scale the elements of your mesh locally to increase padding then convert back to UVs. If the asset is already textured just use RTT to bake the old UVs without padding to a new UV channel. Saves you having to remodel anything.
  • Eric Chadwick
    Yes, edge padding is necessary for all meshes, as long as they have unused space between the UV shells.

    And you can never have too many pixels of padding. Completely fill the unused parts, right out to the edge.

    No, minimum filter is not a good choice. It darkens the color.

    The last recommendation is just plain silly. Scale the UV meshes in model space to make padding? I'm sorry but that makes no sense.


    I really like the Solidify filter from Flaming Pear. It's in the Free Plugins zip:
    http://www.flamingpear.com/download.html

    edgepadding.jpg

    All three methods do the job, because in the end the mip filtering turns it all to mush anyhow. But to me Solidify just looks prettier in my flats.
  • solar
    Offline / Send Message
    solar polycounter lvl 18
    I think you've mis-understood me Eric, glaive mentions recreating the props because he didn't have adequate space in the UVs for padding. The method I mentioned is a trick to scale all the UV shells at once to allow room for padding. It's not a method to use for padding!
  • Eric Chadwick
    Ooooohh. Yes, that's actually a cool trick!
  • glaive
    Wow, so many responses! Thanks to you all. And all are helpful. I am going to try Dilation first. And @ solar, is "textools" a plugin? Is it free? I think I have got a lot of options open.

    Also I would like to know more about my second option, I am trying to be more elaborate in this regard, what I meant earlier is:

    1. In Photoshop open the UV layout image created in 3Ds Max.
    2. Take a new transparent layer in Photoshop
    3. In that transparent layer, fill the uv area with any flat color.
    4. Apply padding so that the entire UV area including padding is filled with the same solid color.
      Let's name this layer as "Padded UV" layer
    5. Take another new layer and create a texture
    6. Use the padded UV layer as a mask on the texture layer and turn of the padded UV layer.
    7. Now you have got a final UV mapped texture with extended padding.
    Please let me know if there is any problem with this method.


    Thanks a ton for your efforts.
  • Eric Chadwick
    Not sure I get exactly what you're doing, but "any flat color" is not a match for the colors along the edges of your uvs.
  • glaive
    Not sure I get exactly what you're doing, but "any flat color" is not a match for the colors along the edges of your uvs.


    That is exactly what I wanted to know. You have cleared my doubt. Thanks a lot.
  • felipefrango
    Offline / Send Message
    felipefrango polycounter lvl 9
    I think the flat color thing is for the mask only, he's not trying to add flat colors to the padding. The problem with this method is that the colors that are there outside the UV area will be picked anyway, with or without this inflated mask, so the problem with this method is it does't tackle the issue itself. With Dilation you'll do the following:

    * Flatten your texture to one single layer.
    * Delete everything outside the UV edges so they are transparent.
    * Apply the Dilation filter with a huge number so it fills every transparent space left.

    And there you go, no need to mask anything.
  • glaive
    I think the flat color thing is for the mask only, he's not trying to add flat colors to the padding. The problem with this method is that the colors that are there outside the UV area will be picked anyway, with or without this inflated mask, so the problem with this method is it does't tackle the issue itself. With Dilation you'll do the following:

    * Flatten your texture to one single layer.
    * Delete everything outside the UV edges so they are transparent.
    * Apply the Dilation filter with a huge number so it fills every transparent space left.

    And there you go, no need to mask anything.


    Yes that's right, I did not mean to add flat colors that way. And Dilation works like that! I didn't know this. Then this would be better. I also liked the output of "Solidify." Will try both and pick the best one.
  • abmurray
    I've had a PS action for years that basically does what the 'solidify' thing does. I'm so accustomed to finishing my textures that way that I'm completely horrified when I see someone who doesn't.
Sign In or Register to comment.