If texture sampling is set to repeat, for instance, sampling (x, y) and (x + 1, y) will return the exact same value, whatever x and y. If texture sampling is set to clamp, you'll always get the border values, etc.
When re-constructing the normals, you need to sample a pixel's direct adjacent pixels. And the pixels' coordinates are separated by 1/texture(Width/Height)
I don't know if I'm being clear, but I don't really know how to explain it better in english and without drawing stuff
When you consider the pixel at varTexture0, when you add 1/512, if your texture is 512, then you will sample the neighbour pixel. Try to draw a sample 16x16 pixel texture on a piece of paper, with the upper left pixel being (0, 0) and the bottom right (1, 1), then see what happens when you increase a texture coordinate by 1/16 as opposed to increasing by 1.
when sampling your bump texture, you might want to add/substract "1.0 / textureWidth" and "1.0 / textureHeight", instead of just "1.0"
(texture coordinates go from 0 to 1, so when you add 1 to your current coordinate, you'll sample a pixel "outside" your texture)
This happens if I draw a cube or a cylinder. Please help me
Ok, I replied a bit to quickly, didn't see that you already disabled backface culling ^^' If you post the piece of code which renders your models, I think it'll be easier for people to spot what might go wrong.
I don't know FeeGlut, but one easy solution is to replace the lines
# include <OpenGL/gl.h>
# include <OpenGL/glu.h>
# include <GL/gl.h>
# include <GL/glu.h>
When you're using the OpenGL framework on a Mac, all the GL headers are available in <OpenGL/**.h>
Also, the #if defined(__APPLE__) is optional : if you're only developping on a Mac, just #include <OpenGL/whatever.h> directly ^^