Okay. . . I've -finally- managed to get bump-mapping working two different ways: calculating the light vector in tangent space in software, and doing the same via a vertex shader. Upon examining fragment shaders, however, it looks like the same job will require an entirely different method. Vertex colours appear to be irrelevant since the shading is done on a per pixel basis. Not only that, but fragment shading seems to deal entirely with textures.
I can see the basic theory as to how this -might- be accomplished. One has to find the light vector in tangent space to the individual pixel. This will determine the colour and can be sent through the fragment shader to undergo the same equations with the tangent map that they go through via the texture environments. I hope that made sense. . . because I have no idea how I might get that colour to the fragment shader in the first place. . .
Any possible help, here?
I can see the basic theory as to how this -might- be accomplished. One has to find the light vector in tangent space to the individual pixel. This will determine the colour and can be sent through the fragment shader to undergo the same equations with the tangent map that they go through via the texture environments. I hope that made sense. . . because I have no idea how I might get that colour to the fragment shader in the first place. . .
Any possible help, here?