- Home /
Atlasing/tiling/offset on shader and script help?
Im trying to get my UI objects into one atlas and then change the tiling and offset. The thing is I have:
One model of coin 1 texture with 4 different looks of coin (aka 4 textures in 1 atlas) and one material
If i have gold,silver,copper and diamond coin textures and want to make 4 prefabs correspondingly problem is when I change the tiling in the inspector it changes the tiling and offset on each of the 4 objects because as I can see that is specifically shader related setting.
I can't quite work out from searching the web for answer, because all the people and answers mostly consists of gibbering about how you should put all the textures into one atlas, take TextureThat or PackerThat bla bla bla, no one is telling what to do after that.
I've found out that there are some methods like shareMaterial.SetTextureOffset() but I'm not sure how to make them editor friendly so I can see what am I targeting when changing tiling and offset.
Any help is appreciated, thank you in advance!
Answer by tanoshimi · Aug 08, 2014 at 02:44 PM
You either need one material and four different models (with correspondingly different UV coordinates), or you need one model and four different materials (with correspondingly different offset parameters).
If you're trying to do it with only one model and one material, as it sounds like you are, then changing the parameters will change it for all instances that share the material.
Yeah I know, that's what I've said in the question. I just don't get it that so much talk about atlasing is being done when this kind of problem can't be solved. $$anonymous$$ost of my objects have a texture with different uv's so I can have 1 material, just doesn't make sense that I should make 2 same models with different UV's for this.
Your answer
Follow this Question
Related Questions
Animation Tiling/Offset 0 Answers
Sprite tiling and offset? 3 Answers
The correct way of making Texture Atlas 0 Answers