The problem you'll probably encounter at some point is that you'll get strange seams appearing when the textures try to repeat - unless you've already taken steps to avoid this of course.
The issue was discussed at some length by myself and AtomR (?) on the Learning to write shaders sticky. I'm not sure how the discussion ended but I think we found both the cause and solution. The problem involved mipmapping and the fact that the built-in hardware choice of mipmap went haywire as you crossed a texture boundary.
I'll see if I can locate a relevant post in that discussion and post back.
Edit Found the discussion but it's hard to point you at a specific post. It was a LONG discussion around March/April 2009
.
Anyway I've done some digging in my files and found the attached demo which I believe is AtomR's successful conclusion of the discussion. I haven't delved too far into the code (supposed to be doing something else today
) but I believe the main points are:
1. use the tex2Dgrad() texture lookup in the shader so you have total control over mipmapping;
2. use an atlas where the component tiles are enlarged slightly to include part of the wrapped texture along each edge, i.e. an original tile might be 64x64 pixels but is padded out with wrapped bits to say 80x80 pixels. This avoids (or at least reduces) seams caused by filtering artefacts from adjacent tiles.
Hope this helps.