Joshua Smith
01-03-2006, 08:54 AM
I am adding OpenGL acceleration to a mature software rendering platform. The easiest way to do this was to use our existing transform, clipping, and sorting, and just pass 2D primitives to the OpenGL pipeline. I set up the viewport to do orthographic projection. I'm passing projected xyz coordinates, but I'm passing world coordinate lighting and normal information (we only use directional lights, so this works fine).
Everything works great, except that specular lighting is wrong, because the GL pipeline has no idea where my eyepoint is, so it cannot correctly compute the Blinn halfway vectors.
Can anyone here suggest a work-around to get specular highlights into the right places without have to incur the trouble of setting up OpenGL to do the perspective projection identically to our existing software?
Also, our software rendering engine uses a real Phong shader for lighting interpolation, and everything I've found about OpenGL suggests that it only supports Gouraud interpolation. Is there any extention that asks the hardware to better interpolate normals?
Thanks in advance for any clues!
-Joshua
Everything works great, except that specular lighting is wrong, because the GL pipeline has no idea where my eyepoint is, so it cannot correctly compute the Blinn halfway vectors.
Can anyone here suggest a work-around to get specular highlights into the right places without have to incur the trouble of setting up OpenGL to do the perspective projection identically to our existing software?
Also, our software rendering engine uses a real Phong shader for lighting interpolation, and everything I've found about OpenGL suggests that it only supports Gouraud interpolation. Is there any extention that asks the hardware to better interpolate normals?
Thanks in advance for any clues!
-Joshua