How to convert a non-tileable texture to tileable texture

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
Noiecity
Posts: 159
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

How to convert a non-tileable texture to tileable texture

Post by Noiecity »

This method is simple, and works in most cases for 3d textures that are intended to be tileable.

I will use the following image(cc0 license, created by me):

Image


As you can see it is not yet tileable:
Image

I will use Gimp to fix it.
I will open the image with the program, go to Filters->Map->Tile Seamless -> OK button

Export the image (I saved it in jpg format) and that's it's!

Image

Image

Image


The algorithm works for two simple dimensions, it can be used for floors or walls, but to build for example a tileable cube problems will occur. But, actually can still be used on cubic geometries if the texturing program has an algorithm that solves such problems, such as 3dcoat.

I don't know any perfect and exact viable solution to this problem based on algorithms like substance painter, foundry mari or 3dcoat, or even blender itself. The only viable solution for the cubic problem that I know and learned on my own it's the mirror effect occupying the same coordinates, rotating inversely proportional some angles of the UV coordinates, scaling the face of the uv or geometry by -1(mirror effect) so that it is inversely proportional to the adjacent face of the geometry:

Image

Image

Image

Image

I can't repeat the effect using quads, so I also have to divide the geometry in triangles occupying the same UV position in all of them, although the difference is in their mirror rotation (scaling the geometry to -1).

(Quad example:)

Image


This way, since there are no known programs that do it automatically, it is more difficult to do everything manually while observing.
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
Noiecity
Posts: 159
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: How to convert a non-tileable texture to tileable texture

Post by Noiecity »

Another way to produce a tileable texture is to use an image editor or Blender and use a mirror effect in an inversely proportional way

Image

Image

Image

In this case I used Blender, created a plane(shift+a->Mesh->Plane), subdivide it in 4 parts in edit mode (tab(enter in edit mode with the object selected)->A(select all faces->W(having all faces selected->Subdivide), select 3 faces with right click to delete them(pressing X or delete with selected faces), in order to have an exact midpoint of reference(deselect with shift + right click). Select the remaining face and press U, then click on unwrap. Now you have to change from Default to UV editing(it appears above). In the menu on the left side open the image (you have to have the face selected on the right side in edit mode). In the right window, now you can click to change the viewport view to see the texture leaving it in Texture, it is at the right of where it says "Edit mode", there is a white sphere icon.

Go back to Default, go to modifiers (there is a wrench), click on add modifier and activate mirror, click to activate X and Y, you can click to activate clipping if you want to join the geometry.

You can add the array modifier to produce copies of the array. In my case I added two, one to repeat in X, and one to repeat in Y.

When exporting remember to activate "Selected Only" to export only the model, without the lamps or cameras or other models (it will export only the one you have selected and by default it will apply the modifiers).

I don't remember if in .obj format this way the texture was loaded when importing in irrlicht, but you can load it on your own.
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
Post Reply