Hi everyone,
I am trying to shading my windows for the buildingsm below is the sample from one of the building and my material node.

I created the color ramp and applied on faces on the building, wondering how can i map its cordinate to shade the same way with each and every faces (second row from the picture attached). Is this possible or I have to seperate each row and create new objects, this would be a mess since i have so many buildings in my scene.
Thank you for you answers!
This is my node, cant figure out how to map it. 
I’d use the “wrap” node:
The “Generated” output of the Texture Coordinate node outputs a value between 0 and 1. After Multiplying with this becomes a value between 0 and 4. The Wrap node creates a saw tooth pattern out of this where, e.g. get mapped back to 0.1, 3.5 to 0.5 etc. If you use “Multiply Add” instead of “Multiply” you can also shift the pattern in the z-direction, if needed.
If each window is a single face.
- Select them in edit mode.
- Reset their UVs (U > Reset)
This will make their individual UVs take up the entire UV space, so you can map the color ramp to the Y coord of the Texture Coordinate nodes UV socket.
If each window is not a single face, you can unwrap them with a cube projection and then manually scale the UV islands to fill the UV space.
Thank you! It works great for my project 
Hi! Thank you for your answer! Somehow i cant seems to be able to UV Mapping the color ramp node. I can only see the mapping for image textures tho. Does this mean i need to create the gradient into an image file and assign as a material?
It sounds like you don’t fully understand what a UV map is. The image aspect of UV mapping is actually irrelevant. UV mapping is just giving each vertex a pair of values between 0 and 1 (2D coordinates).
So if each face fills the UV area (which is what the reset button does) then it’s full coverage of what ever image you use. Alternatively, it’s the full range of a color ramp node along each axis.
Here’s an example.
uv_ramp_example.blend (876.4 KB)
THANK YOU for your efforts !!! I still have a lot to learn, this does help me so much.