How can I use atlas sprite as texture for a material? (See this image first)

My texture sheet (WIP1) has been spliced into 20x20 squares. I need to use WIP1_01 as a texture in material grass. WIP1_01 is highlighted on the plane in my scene. It is the grass square. I want to tile that onto a background. I can manually slice it and import that I know, but it would be convenient if this way worked too. When I try to add a texture in the material editor it only shows the WIP1 image, not the spliced images.

I will also add that I am using unity 2D. Is this the correct approach to creating a 2d background? I was going to just instantiate a heap of textures onto the screen on load but I figured that would use too much memory.


Well this is somewhat defeating the purpose of the atlas. There are two ways to solve the issue.

  1. (The one you already know) Make a material with just that one texture and set the uv tile settings to repeat. This is probably the cheapest and easiest for most applications.

  2. Create a mesh that is however many quad meshes that you need to make your tiling. You can do this method using unity quad primitive but that would be more expensive then creating your own meshes.

I think in order to make the atlas work properly you have to make your own mesh and UV unwrap it so that the mesh uses only certain coordinates of the atlas for texturing (I’m not sure if that came up right).
Try this, use blender or 3dsMax or any other 3d modeling software and make a simple plane (4 verts, one quad), then unwrap it and then scale the uv layout so that the plane uvs cover only the grass texture. After that all you need to do is duplicate that plane as many times as you require.