game grid generating whle in camera view ? 3d game scene) android

I want to make a grid similar to these pictures:

alt text

alt text

How would i dynamically generate this grid at a certain z (vertical) level?
I want to use a texture, unless i can generate it using raycast as different colors and thicknesses (probably using more rays). This is for a 3d scene app for android if that matters.

First, the grid. Without amazing colors.

Just draw a grid square in a texture. Then TILE it onto a flat surface. If you use a flat ground, then you can rotate it as you please.

If you need to move the grid, you can either move the ground the same amount as the gridsize and then reset the position OR index into the texture/material itself and add directly to the UV map coords.

The colors could be made with another texture multiplied/added into the same shader.

I meant dynamically created as in a non-static game object, because i thought that might eat up resources and would be hard to scale and etc.

A dynamically created item only draws what is in view and creates the desired shape or etc using a function or repeating pattern of code. If i do this i am not sure how to get it to only draw within my camera view (camera can move and rotate) and how to get it to not move with the camera (if i do something based on camera position to get it to only draw in camera fov)

2 things:

  1. this forum works different than normal forums. you only post Answers if they solve the Question asked or expect/think they will. You can cut/paste your previous answer to your own question (which you can modify/edit)

  2. If you use 1 plane with 2 triangles and a mapped texture that has a tiled grid, I dont see how this would eat that many resources? in Unity a camera has a distance it will look. if you keep your groundplane around center of the camera then you will have an endless grid (search for tilebased scrolling on Google) or how to use viewports.

u can draw with script also…u can get the script in unity3d forum link is

Draw grid lines in game view? - Unity Answers

it will help u…