Fixing lighting on mesh?

Hey there!I have created a script which generates meshes but looks like the lighting on them isn’t very smooth :S

How can i get it smooth and nice like on this cube :

Instead of this shitty triangle illumination :

?
Note that my mesh is generated so i don’t think i can use lightmapping or anything :[

Please help me with a suggestion :slight_smile:

I am really sorry…it was because of the shader i was using…Sorry again!