Per-Fragment Spotlight effects in OpenGL. This video demonstrates per-pixel lighting calculations with spotlight effects. The objects are lit based on the cosine angle of the inner and outer cones of the spotlight. The shader is written in Cg, a platform-independent shading language. The application is written in C++ and rendered using the OpenGL graphics API.
For a full explanation of this effect you can refer to my article on shader programming:
[ Ссылка ]
Ещё видео!