L3DT users' community
Large 3D terrain generator

textures are not seamless

Got a problem or need advice?

textures are not seamless

Postby woehlb » Wed Dec 30, 2015 12:38 am

I export the mesh with "File->Export->Export optimized mesh", as *.obj file and with the parameter "with spilt into overlapped tiles".
The exported texture size is 4097x4097. If I import the mesh into blender, I see seams. The same happend, if I export the terrain textures with "File->Export->Export overlapped tiles".

The mesh is not the reason. In the object mode, so you can see only the mesh objects in blender, in this case the meshs are seamless.
If I switch of the mipmaps in the user preferences, then the seams disappears. But this works only in blender. If I export it as fbx file. You can see the seams in the fbx-viewer and inworld in Highfidelity too.

Can you prevent it in L3DT? Or is it a bug? In this case, be there a workaround? The shrinking of the uvmaps is too vague, and you would do it specially for every tile.
Attachments
fjord_seamless.png
seamless mesh through switch off mipmaps
fjord_seams.png
mesh with seams in blender
woehlb
New member
 
Posts: 4
Joined: Sun Dec 20, 2015 7:30 pm

Re: textures are not seamless

Postby Aaron » Wed Dec 30, 2015 8:10 am

Hi Woehlb,

The texture is seamless, but the mipmaps of the texture are not seamless. Blender, Highfidelity, etc. don't know that the mipmaps they generate for each texture also need to be seamless with their neighbouring tiles' mipmaps. You need to work out how to make those programs generate seamless mipmaps (if that's possible), or if you can make them load explicit mipmaps for the texture tiles. If they can load mipmaps, instead of auto-generating them, then I'll find a way for you to export L3DT's seamless mipmaps. A script should do the trick.

Best regards,
Aaron.

Updated to add:Thinking a little more about it, it's actually quite tricky for Blender/etc to generate seamless mipmaps from seamless texture tiles. It's easier to generate seamless mipmaps from the original non-seamless tiles (which Blender/etc never see), but even that is a very specific capability that is not necessarily implemented in readily available software. I'm fairly sure I can modify the seamless exporter plugin to also generate seamless mipmaps, but for this to be useful you would still need to be able to load pre-generated mipmaps, which may or may not be possible in Blender/etc.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Re: textures are not seamless

Postby woehlb » Wed Dec 30, 2015 11:23 am

To the topic mipmaps in blender, first I will search informations to that. I will write, if I have an answer to mipmaps generating or loading of mipmaps.

I have it only a short time, but Maya LT would possible too for further processing. Do you know someone, how it deals with mipmaps?
woehlb
New member
 
Posts: 4
Joined: Sun Dec 20, 2015 7:30 pm

Re: textures are not seamless

Postby woehlb » Wed Dec 30, 2015 3:09 pm

I have found the reason. The post of the user Monster at Blenderartist is the explanation.
http://blenderartists.org/forum/showthr ... s-Solution

----------------------------
Monster:
"Usually only the texture pixels inside the UV-face (including the edges) are used to draw the rendered face."

"But the texture is not used directly. Before it is used as texture it is processed by the OpenGL mid-map filter. The default is to blur/anti-alias the texture. A side effect of this is that the color of a texture pixel is mixed with the color of it's surrounding pixels."

"On the edges the surrounding pixels are not all part of the UV-face. Therefore the rendered face can get color information from outside the UV-face (e.g. from a black border)."
----------------------------

The problem is also, that the textures and the uvmap have the same size (picture 1). The uvmap size must be smaller as the texture. (20pixel -> 10 pixel margin all around)

Also first I tried to export overlapped texture tiles with the size 4117, 4097 is the originally size, so as to generate an margin of 10 pixels. But the textures overlapped nevertheless with one pixel.
In the second step, I created manually textures with an margin of 10 pixels in photoshop. (picture 2) I used the neighbor textures or mirrored versions of the destination texture for the margin.

Then I imported the meshes into blender, loaded the manually created textures and adjusted the uvmaps 20pixel smaller as the textures. (picture 3) After this the seams was disappears.

It would be nice if this could be automated in L3DT. Otherwise it would be a lot of work, to do that for all tiles of the texture map, the normal map and the specular map.
Thank you for your help Aaron.

PS: Probably a larger margin is better. Depending on the distance of view the seams was a little bit to see. micah702 recommends 10-20 pixel.
Attachments
old_uvmap.jpg
Picture 1
raster_rand.jpg
Picture 2
new_uvmap.jpg
Picture 3
woehlb
New member
 
Posts: 4
Joined: Sun Dec 20, 2015 7:30 pm

Re: textures are not seamless

Postby joehot200 » Sun Jan 10, 2016 6:36 pm

I might be slightly late to the party here, but I just wanted to chip in my opinion.

In my experience, L3DT's generated textures are not always completely 100% seamless. Take this picture, for example:
Image

It's very possible that I could have done wrong, but the point I'm making is: It is very hard to get completely seamless textures.

A good solution I have found is to cover the terrain in foliage.

Image

That way, the seams are completely covered up. And, they are almost impossible to spot from a distance anyway. Also, it means you don't have to worry about exact textures, as the texture is largely obscured by the foliage (Something aaron mentioned in this "texture detailed page").

(And that way, you could probably use mipmaps as well. I use mipmaps, and the seams are not noticeable)
joehot200
Member
 
Posts: 15
Joined: Mon Nov 23, 2015 10:48 pm

Re: textures are not seamless

Postby Aaron » Mon Jan 11, 2016 1:44 pm

Hi Woehlb

I don't think it's necessarily a great idea to re-mapping the UVs, as it doesn't fix the problem, only maker it a little less worse. Whilst it is true it will trim off the black seams in the mipmaps, it will also then select a colour inside the tile edge that is not actually the correct edge colour, so there will still be a subtle seam. This is what it looks like if you are off by one pixel in the UVs:

txseam3.jpg


Note the fairly subtle seam running through the middle of the image is just like the seams in joehot200's images above.

For completeness, is what it looks like when you use the full UV mapping (no trimming), with correctly-generated mipmaps:

txseam4.jpg


The seam is gone.

If you're OK with the subtle seams from re-mapping the UVs, then that's great, but I don't think it's something that the L3DT exporter should encourage. The ideal solution is to generate proper seamless mipmaps, rather than relying on the OpenGL mipmap generator implementation, but I'll admit that is hard.

Best regards,
Aaron.

Edited to add better screenshots
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Re: textures are not seamless

Postby Aaron » Mon Jan 11, 2016 2:26 pm

Hi joehot200,

Could you describe your setup? How did you export the textures from L3DT? (or are you using alpha maps there?) Are you using mipmaps, and if so, how did you generate them? What is your texture coordinate wrapping mode?

To my mind, the problem is unlikely to be that the textures from L3DT have seams; it would have to go out of its way to make seams in the raw texture data. However, 3D renderers need to be carefully configured to display tiled textures seamlessly, and you also usually have to re-pack the textures to make the 3D renderer's job easier (this is what the seamless mesh exporter does, and also the export overlapped tiles option).

Cheerio,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia


Return to Help and support

Who is online

Users browsing this forum: No registered users and 7 guests

cron