hi i am beginner i am trying to implement bump mapping with vbo and glsl. My question is: did i make bump mapping ? if i did why these edges didnt disappear ?
high and low meshes (i used low meshes of course)
my high mesh:
my low mesh:
As a “beginner” you certainly should not try bump mapping. First learn the basics.
Anyways, from the picture itself I can’t tell what you are actually doing. What I can tell is, that you definitely messed up your normal calculation.Since the lighting of an object is based on the normal there are some things you should consider:
- The sharp edges result usually from inconsistent normals. Means: Two triangles sharing the same vertex have different normals for that vertex. Even if they are the same, you can still get edges by different normal interpolations along the edges
- Your lighting model should be in the fragment shader, not in the vertex shader. Otherwise you get 3 light values that would be interpolated over the surface and might not have anything to do with the real lighting
- Always normalize your normals
- If you want to draw comlpex geometry lighting with a single triangle (like with bump mapping), you need to calculate the normal per fragment. Again: Along the edges, the normal calculation must be consistent!