Creating a seamless image for tiling (using shader)

If you need to tile an image across a large area or object, it needs to be seamless, so that you don’t see the joins. However, it’s not always easy to find suitable seamless (and free to use) images.

As part of another project, I found a way (via the internet of course) to make an ordinary image seamless. It does need to start off being relatively uniform, of course.

I blogged about it here, which includes code, and the video below shows before and after results using 7 different images.

https://www.youtube.com/watch?v=YllrYNcPpYE

@Ignatz wow, that’s amazing :o
this could be so usefull… nice job sir

@Ignatz : Nice job. Thanks that looks very useful ! I am always struggling with backgrounds.

I’ll try it on my projects but I have some concerns about the performance. It seems the fragment shader is interpolating on the whole texture. Maybe the interpolation can be done only on a portion of the edges and still have a good visual result ?

I’ll have a run (sometimes this week…).

@oddcorrado, what you could do is save the background on an image and use that in your project? That way the shader doesn’t have to perform every frame

@oddcorrado - it doesn’t matter because the shader is used to create a seamless image at the beginning (ie only once), and then this image is tiled endlessly.

So it runs at 60 frames per second!

whoops I didn’t get that, I should read more carefully :).
Thanks!