Hi!,
I need to draw a grid on my level floor, one like in tactics games, where a unit wants to move/attack, etc… and a grid of squares is shown to let player know where it can move/attack, etc… I don’t know how to do this to minimize draw calls, because I don’t think using a cuad for every cell and adding it to the scene is best options (sure it isn’t). Could anybody help please?
Thanks in advance,
HexDump.
I’m assuming you mean “quads”. 
You could author your grid in another program and import it as a single mesh, unless you have some absolute need for the grid to be dynamically generated at runtime.
You could also generate the grid(s) right before the level starts and then combine them into a single mesh, so you’re not attempting to draw upwards of several hundreds of objects.
THere have been a couple of suggestion about this sort of thing already, using line renderers, multiple meshes, special shaders, decal projectors, etc
check out:
http://forum.unity3d.com/viewtopic.php?t=6984&highlight=grid+shader
and
http://forum.unity3d.com/viewtopic.php?t=24118&highlight=grid+shader
and
http://forum.unity3d.com/viewtopic.php?t=12404&highlight=grid+shader
(ah, just do a search using keywords like “grid” “terrain” “shader” etc)
I recommend you try a few different techniques and check the performance of each on the iPhone to see which works best in your scenario.
Hi!,
Thanks for the answers.
Just one thing, I have seen sprite manager builds a mesh on the fly and then transforms it into screen space. Doing the same for my grid and not transforming vertices into camera space could be a good solution?.
Other options I have checked is building the mesh at runtime through the mesh class. Not sure of the performance hit this could imply.
twitchfactor: Yes I need the grid to be dynamic, its shape depends on the player position, etc…
Thanks in advance,
HexDump.[/quote]