x


UV mapping problems with multiple textures in same file

We use Blender for modelling our objects and export them as .FBX files.

We have 16x 2D-tiles in a 1024x1024 texture as 4x4 tiles, but when we import the flat ground objects seperately and instance them, the border of the ground shows an imprecision near the edge of them, like if the pixel of the next tile has been used to make an edge or smooth the color.

The ground element is a simple square and the bitmaps are 100% precise in Photoshop. 256x256 pixels.

Somehow the pixel color of the next tile gets into the ground of the tile? Its like the UV maps are unprecise when mapping.

Has anyone else seen this problem and better, does anyone have a solution?

The reason for keeping the tiles in same texture should be the way that shaders work with textures as it has to switch them in and out when rendering all the small tiles. Combining them should give performance benefits + its easier to keep all the tiles in same colors because a filter can be added in a seperate layer in Photoshop.

Yes, we know we could auto-export them in small tiles, but this example is only part of our problem as we have many normal 3D objects that suffers same problem when trying to combine the textures and reusing parts among different objects.

more ▼

asked Sep 04 '11 at 11:26 AM

BerggreenDK gravatar image

BerggreenDK
2.4k 54 62 75

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You're basic approach is correct - a single material and UV texture cutting is likely better than small textures and many materials.

But finding a way to get precise texel alignment across DirectX, OpenGL desktop and ES, and for diverse tools like Blender and Unity to conspire to help rather than hinder is not something I would hope for. Someone else may know better, but the usual approach is to have a border of at least one pixel (more if you enable mipmaps) around UV islands - in this case your tiles. Alternatively, pull your UVs in half a pixel.

more ▼

answered Sep 04 '11 at 11:42 AM

Waz gravatar image

Waz
6.5k 23 33 71

pull UV's in half a pixel... intersting... might work, as we have a lot of seamless textures and these suffers visually from that extra pixel.

Sep 04 '11 at 03:19 PM BerggreenDK

@Warwick I understand that adding a border around each tile will offer better results, and thicker borders allow for higher mipmaps. I have implemented the 1/2 pixel solution that you mention and this works rather well. I notice that when zoomed in there is 1/2 a pixel missing.

Why does this work? I thought that texel/pixel alignment was consistent between OpenGL and the later DirectX versions. Do you know if this 1/2 pixel approach works with ES?

Cheers

Jun 13 '12 at 12:43 PM numberkruncher
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2275
x748
x101
x29

asked: Sep 04 '11 at 11:26 AM

Seen: 1320 times

Last Updated: Jun 13 '12 at 12:43 PM