#include <shader_lightlist.h>
Public Member Functions | |
virtual size_t | set_current (size_t current)=0 |
set current light | |
virtual size_t | get_current () const =0 |
get current light index | |
virtual bool | sample ()=0 |
sample light source | |
virtual miScalar | get_dot_nl () const =0 |
dot prod. light dir, normal | |
virtual const miVector & | get_direction () const =0 |
get direction of sample | |
virtual void | get_contribution (miColor *c) const =0 |
get color contribution | |
virtual void | get_contribution (miSpectrum *s) const =0 |
get spectrum contribution | |
virtual int | get_number_of_samples () const =0 |
get current number of samples | |
virtual miTag | get_light_tag (size_t current) const =0 |
get current light tag | |
virtual size_t | get_number_of_lights () const =0 |
get number of lights in list | |
virtual void | connect ()=0 |
used for reference counting | |
virtual void | release ()=0 |
release resource if not ref'ed |
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.
|
used for reference counting 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 spectrum contribution The method gets the cached spectrum contribution obtained from the light source during the last sampling.
|
|
get color contribution The method gets the cached color contribution obtained from the light source during the last sampling.
|
|
get current light index The method is used by light iterators to obtain the current light index
|
|
get direction of sample
|
|
dot prod. light dir, normal
|
|
get current light tag The method obtains the light tag at the current'th position in the light list.
|
|
get number of lights in list
|
|
get current number of samples 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.
|
|
release resource if not ref'ed 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 light source The method samples the current light and caches the obtained results
|
|
set current light 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