vertex "shader" spotlights

How does one go about doing spotlights in a vertex shader?

I’ve looked at the source for the OpenGL SI, but that didn’t seem to help any.

If I remember correctly, I believe that EXT_vertex_shader allowed you to map all of the parameters for a specific light, including the all the spotlight stuff (cutoff and whatnot). In terms of the actual math, I’d have to look it up at home. I wrote a program last semester for my graphics class where I did calculate some lighting stuff per-vertex. I don’t recall actually implementing spotlights, but I do remember having to chart out the math for it on a test. But I wouldn’t think that it would be too terribly hard to do in a shader, although I would imagine that it could get somewhat lengthy with multiple spotlights.

Dan

This paper describes in detail how to recreate fixed-function pipeline capability with vertex programs:
http://developer.nvidia.com/view.asp?IO=fixed_function_pipeline

– Zeno

Originally posted by Zeno:
[b]This paper describes in detail how to recreate fixed-function pipeline capability with vertex programs:
http://developer.nvidia.com/view.asp?IO=fixed_function_pipeline

– Zeno[/b]

Thanks