PDA

View Full Version : vertex "shader" spotlights



NitroGL
08-16-2002, 09:02 AM
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.

Dan82181
08-16-2002, 09:57 AM
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

Zeno
08-16-2002, 10:05 AM
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

NitroGL
08-16-2002, 10:14 AM
Originally posted by Zeno:
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

Thanks