Simple OpenGL question - how to measure light levels on a rendered sur

I have a very simple OpenGL question. I am trying to figure out how to learn to get input from the scene. First I just want to learn how to measure light levels at a point on a rendered surface.

I am trying to simulate a device that finds the brightest spot.

Is one of the


  • You can call glReadPixels to grab the framebuffer.
    Then step through it to find the pixel with greatest luminence.

    Assuming that this is what you want to do. If you want the point in 3d space I think you'll have to calculate it. Assuming no light attenuation, it is where cos( normal dot light ) is at a minimum. Normal and light are two normalised vectors representing the normal and the reverse of the light vector. The dot product is simply x1*x2 + y1*y2 + z1 * z2.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion