Making brick wall texture programmatically


I new with OpenGL and I need to do brick wall texture programmatically. Can anybody give me a hint how that can be done.



Why don’t you just take a picture of a brick and use that?

Synthesizing a texture has nothing to do with OpenGL. Use Photoshop or some other graphics app to do it.

A GLSL brick shader :

It is a school project and the texture must be done programmatically, that why I can’t use picture of a brick. It doesn’t have to be brick though. Just something to decorate the walls.