Hello. I have a scene that draws grid lines using a projector. The terrain is divided into a 50x50 grid.
Each cell will have an index to determine the contents of the grid(using a bidimentional array).
I need to “fill” the grid cells with different color according to the index in the array.
What is the best way of drawing the colored grid?
Right now I am testing it by using 2500 planes placed in the scene but it feels more like an inefficient hack. :roll:
Thanks in advance 
You could try manipulating the texture you are projecting.
I just started using Unity a few weeks ago, so I haven’t messed around with changing texture pixels via script, but this is the first thing that comes to mind.
You can actually use your array indexes with math to get the pixels to change, then use a for loop to change the ‘area’
Just some pseudo code…
var startPixelX:int = row*cellWidth;
var startPixelY:int = col*cellHeight;
for(var x:int = 0; x < cellWidth; x++){
for(var y:int = 0; y < cellHeight; y++){
// startPixelX+x, startPixelY+y = new color
}
}
Not sure if there is a ‘better’ way to manipulate pixels or textures, but this is the route I would take. It also depends on how frequently you are changing these cells…