Hi,
I've been trying to get bump mapping to work with lwjgl, it has been... difficult. I've used just about every tutorial and example I can find on the web. I think everything should be working fine except I'm not sure if I'm successsfully sending my array of tangent data to the vertex shader correctly.
In my InitGL (setting up Opengl):
VBOTangentid = createVBOID();
bufferData(VBOTangentid, VBOTangentData);
Where TangentData has all of the tangents calculated for the model in a correctly flipped FloatBuffer
Then in my render function I call
int loc = ARBVertexShader.glGetAttribLocationARB(shader.id,"tangent");
ARBVertexShader.glEnableVertexAttribArrayARB(VBOTangentid);
ARBVertexShader.glVertexAttribPointerARB(loc, 3, GL11.GL_FLOAT,false, 0, 0L);
ARBVertexBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, VBOid); // Bind my VBO
shader.bind();
GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, objects.get(0).count);
shader.unBind();
Now in my vertex shader I have an attribute
attribute vec3 tangent;
Should my tangent data be available in my shader now? I've been trying to follow fabien's bumpmapping tutorial (
http://fabiensanglard.net/bumpMapping/index.php) but my textures ends up just being extremely white.
If anyone had any success with this, any tips would be extremely helpful. Thanks.