Grid material

I would like to create a grid material very similar to the default one, but coloured. I would prefer not to rely on UV mapping or a bitmap texture. Do you know how I could make such a material ?



You have to use the world position or the local position to calculate what colour it should have.

This is just for black and white, but you can simply use the values to lerp between colours of your choosing.

Thanks. Iā€™m very close to the desired materal. However the grid is not visible on the whole object, do you know why ?


Thanks for the help. I have a material that looks how I want now :slight_smile:

1 Like

Because if the way the modulo works. It only caps on the positive values. You can go as low as you want and still not worry about the modulo. So 15%10 = 5. -15%10 = -15. That is why you get that error. To combat it, just add 10^6 to the world position vector.

Hi I have the problem that this grid is not shown correctly in my world.

Do you know a solution to this problem?

This should be its own question. Ill help you there.

I also have this problem and would like to know how to solve it. Thanks !