Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglSortedLightProcessor Class Reference

#include <sglLightProcessor.hpp>

Inheritance diagram for sglSortedLightProcessor::

sglLightProcessor sglObject List of all members.

Public Methods

 sglSortedLightProcessor ()
virtual ~sglSortedLightProcessor ()
virtual void reset ()
virtual void addLight (const sglMat4f &matrix, const sglLight *light)
virtual unsigned int getNumLights () const
virtual void apply ()

Detailed Description

The sglSortedLightProcessor uses an O(n*log(n)) sort to determine which lights are most likely to affect the scene the most. All directional lights are preferred over positional lights. The key values used for sorting the directional lights are the brightness of the lights, where brightness is computed as the Y (luminance) component of the YIQ colorspace. The sort key for positional lights is a combination of the brightness, bounding volume radius, and distance from the eyepoint. Since this processor uses an O(n*log(n)) sort, it can be significantly slower than the sglDefaultLightProcessor class for large numbers of lights.

Definition at line 119 of file sglLightProcessor.hpp.

Constructor & Destructor Documentation

sglSortedLightProcessor::sglSortedLightProcessor ( ) [inline]


Definition at line 123 of file sglLightProcessor.hpp.

sglSortedLightProcessor::~sglSortedLightProcessor ( ) [inline, virtual]


Definition at line 126 of file sglLightProcessor.hpp.

Member Function Documentation

void sglSortedLightProcessor::reset ( ) [inline, virtual]

Resets the processor for the next frame (e.g. clears list of lights).

Reimplemented from sglLightProcessor.

Definition at line 129 of file sglLightProcessor.hpp.

virtual void sglSortedLightProcessor::addLight ( const sglMat4f & matrix,
const sglLight * light ) [virtual]

Add a light for the current frame.

matrix   modelview matrix to be used when applying this light
light   pointer to the new light

Reimplemented from sglLightProcessor.

unsigned int sglSortedLightProcessor::getNumLights ( ) const [inline, virtual]

Query the number of lights collected while culling the current frame.

the number of lights collected while culling the current frame.

Reimplemented from sglLightProcessor.

Definition at line 139 of file sglLightProcessor.hpp.

virtual void sglSortedLightProcessor::apply ( ) [virtual]

Applys the lights collected for this frame. Note: this will apply at most sgl::s_max_lights.

Reimplemented from sglLightProcessor.

The documentation for this class was generated from the following file:
Generated at Mon Jul 1 18:00:10 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001