#include <shader_lightlist.h>
Public Member Functions | |
virtual size_t | set_current (size_t current)=0 |
sets the current light in the light list | |
virtual size_t | get_current () const =0 |
get the index of the current light | |
virtual bool | sample ()=0 |
sample the current light source | |
virtual miScalar | get_dot_nl () const =0 |
return dot product between light direction and surface normal | |
virtual const miVector & | get_direction () const =0 |
return the direction to the light source | |
virtual void | get_contribution (miColor *c) const =0 |
get the color contribution of the light source | |
virtual void | get_contribution (miSpectrum *s) const =0 |
get the spectrum contribution of the light source | |
virtual int | get_number_of_samples () const =0 |
returns the number of light samples taken so far. | |
virtual miTag | get_light_tag (size_t current) const =0 |
get the requested light tag | |
virtual size_t | get_number_of_lights () const =0 |
obtain the number of lights in the list | |
virtual void | connect ()=0 |
increase reference count | |
virtual void | release ()=0 |
decrease reference count |
The LightList class manages the iteration over light sources. The class is only used internally by the LightIterator class. The class is reference counted to allow several iterators to refer to the same light list. However, the class maintains only one cache for the results of light sampling. Therefore, if there are several LightIterators referencing the same light list, then most of the class "get" methods will return results obtained from the most recent call of the sample method.
|
increase reference count Tell the light list that one more object (most likely a LightIterator) has connected to the list. As long as there are objects connected, the light list is not deleted. |
|
get the spectrum contribution of the light source The method gets the cached spectrum contribution obtained from the light source during the last sampling.
|
|
get the color contribution of the light source The method gets the cached color contribution obtained from the light source during the last sampling.
|
|
get the index of the current light The method is used by light iterators to obtain the current light index.
|
|
return the direction to the light source
|
|
return dot product between light direction and surface normal
|
|
get the requested light tag The method obtains the light tag at the current'th position in the light list.
|
|
obtain the number of lights in the list
|
|
returns the number of light samples taken so far. The method should be invoked after the sample method returned false. It allows to weight the color/spectrum contributions of a light source with the number of samples taken.
|
|
decrease reference count Tell the light list that an object (most likely a LightIterator) releases its connection to the list. If there are no more connections left, then the LightList will be deleted. |
|
sample the current light source The method samples the current light and caches the obtained results.
|
|
sets the current light in the light list The method is used by light iterators to set the light list to the wanted light. It is used when dereferencing a light iterator to specify which light should be sampled.
|
Copyright © 1986-2008 by
mental images GmbH