Is there way to generate color for whole object basing on his position in world space? What I need to do, is to paint hex planes randomly from preset colors. The obstacle is I can't use material property blocks, becasue it will break batching. For this reason I came up with idea to generate color (in shader) from field position, but I can't make it correctly. So far I tried something like this: but it generates unwanted results: Could someone tell me what I did wrong? Or even better question - Is this good way to make it at all? Maybe this approach is wrong and there is better and easier solution?