Utilising GPU for calculations

Currently doin a project in university on some lighting calculations using dot product. Was wondering how do i utilise the GPU to do the calculations for me instead of using the CPU. Is there a certain opengl code to do it or something?

Hi,

Your project’s description is a little vague. From what you wrote, I would tell you that you can perform your lighting algorithms by using a vertex and/or pixel shader. Its up to you to choose between Cg and GLSL.

For my part, I use both GLSL vertex and pixel shaders to implement algorithms on the GPU instead of the CPU.

I hope it helps.

i think the most important thing that will help me right now is how do i go about telling the GPU to perform a Dot product for me?