- Home /
Texture atlas: use tiling and offset on the same material?
Hi!
I've read that if I combine textures into an atlas I can use the same material with different textures by ofsetting and tiling. I did that but if i change the tiling/offset in the material, it will change everywhere. What I want is change the tiling/offset only on certain objects so all my objects have the same material but with different textures. Did I misunderstand something? Do I have to create different materials if I want to use a different tiling setup?
Have a look at https://unity3d.com/learn/tutorials/topics/2d-game-creation/sprite-editor If this can't be done in your case you can add [PerRenderData]
before _$$anonymous$$ainTex_ST
inside the shader and being controlled by script with a propertyblock.
$$anonymous$$ay have to look into this. Does this [PerRenderData]
allow me to change them individually and still makes use of batching?
Answer by Aeleck · Aug 09, 2017 at 06:47 PM
You are correct. All objects using the same material will have the same material properties. change the color, and all objects with that material will change colors. What you should probably do is the workflow that most objects go through when being created, the uv mapping. If you were to map the different objects onto a uv map and put the textures with the corresponding object uv vertices, you should be able to use one material with multiple objects without using any tiling or scaling.
Like this: