An interface used to translate custom lights to mental ray.
This interface makes it possible for 3rd party light plugins to specify their own shaders and properties for use with mental ray. This interface is basically used to fill up the miLight structure (see the mental ray documentation for details on the miLight structure). Any miLight parameter which is not supported by this interface is queried on class LightObject instead. The shadow options, for example, are retrieved through the shadow generator plugin assigned to the light.
#include <imrLightTranslation.h>
Classes |
|
union | AreaPrimitive |
Describes an area primitive, equivalent to
miLight::primitive in the mental ray API. More... |
|
struct | VectorStruct |
A simple vector structure, equivalent to
miVector in the mental ray API. More... |
|
Public Types |
|
enum | LightType { kLightType_Origin, kLightType_Directional, kLightType_DirectionalWithOrigin, kLightType_Spot } |
Identifies the type of light to be used in the mental ray API. More... |
|
enum |
AreaType { kAreaType_None, kAreaType_Rectangle, kAreaType_Disc, kAreaType_Sphere, kAreaType_Cylinder, kAreaType_User } |
Identifies the type of area light to be created. More... |
|
Public Member Functions |
|
virtual bool | HasCustomFlux (INode &node)=0 |
Used by the translator to determine whether
this light calculates its own flux. |
|
virtual float | GetFlux (INode &node, imrTranslation &translationInterface, TimeValue t, Interval &valid)=0 |
Returns the flux to be used with this light
for GI and caustics. |
|
virtual LightType | GetLightType (TimeValue t, Interval &validity)=0 |
Returns the type of light to be created in
mental ray. |
|
virtual AreaType | GetAreaType (TimeValue t, Interval &validity)=0 |
Returns the type of area light to be created
in mental ray. |
|
virtual void | GetAreaPrimitive (AreaPrimitive &areaPrimitive, TimeValue t, Interval &validity)=0 |
Returns the description of the area
primitive to be created in mental ray. |
|
virtual short | GetAreaSamples (TimeValue t, Interval &validity)=0 |
Returns the number of area samples to be
used for this area light. |
|
virtual short | GetAreaLowSamples (TimeValue t, Interval &validity)=0 |
Returns the number of area samples to be
used once the trance depth given in "low_level is reached. |
|
virtual short | GetAreaLowLevel (TimeValue t, Interval &validity)=0 |
Returns the trace depth level at which the
number of area samples is changed to "low_samples". |
|
virtual bool | GetAreaVisible (TimeValue t, Interval &validity)=0 |
Returns whether this area light is visible.
|
|
virtual Texmap * | GetLightShader (INode &node)=0 |
Return the light and emitter shaders to be
used for this light. |
|
virtual Texmap * | GetPhotonEmitterShader (INode &node)=0 |
Static Public Member Functions |
|
static CoreExport Interface_ID | GetInterfaceID () |
Returns the interface ID of this class.
|
|
static
CoreExport imrLightTranslation * |
GetInterface (InterfaceServer &iserver) |
Queries a pointer to this class from an
interface server. |
enum LightType |
Identifies the type of light to be used in the mental ray API.
enum AreaType |
Identifies the type of area light to be created.
miTYPE_OBJECT is not yet supported.
static CoreExport Interface_ID GetInterfaceID | ( | ) | [static] |
Returns the interface ID of this class.
static CoreExport imrLightTranslation* GetInterface | ( | InterfaceServer & | iserver | ) | [static] |
Queries a pointer to this class from an interface server.
Return the light and emitter shaders to be used for this light.
These methods will usually return one of:
[in] | node | - The light node for which this shader is created, in case the shader has dependencies on that node. |
virtual bool HasCustomFlux | ( | INode & | node | ) | [pure virtual] |
Used by the translator to determine whether this light calculates its own flux.
If this returns false, the translator attempts to calculate the flux based on the light type, its intensity and other parameters. If this returns true, GetFlux() will be used to retrieve the flux.
virtual float GetFlux | ( | INode & | node, |
imrTranslation & | translationInterface, | ||
TimeValue | t, | ||
Interval & | valid | ||
) | [pure virtual] |
Returns the flux to be used with this light for GI and caustics.
If HasCustomFlux() returns true and GetPhotonEmitterShader() returns non-null, then this method needs to return a valid flux value. Otherwise, this method should simply return 0. The flux is used to calculate the energy used with GI and caustic, in lumen. The formula is: energy = PI * (flux * globalEnergyMultiplier * lightColor * globalLightLevel) / meterScale / physicalScale
[in] | node | - The light node with which this light is associated. |
[in] | translationInterface | - The interface for the mental ray translator. |
[in] | t | - The time value at which the flux is to be calculated. |
inout] | valid - The validity interval of the light. The validity interval of the flux calculation should be INTERSECTED with the incoming interval. |
Returns the type of light to be created in mental ray.
[in] | t | - The time value for which the value is queried. |
[in] | validity | - The validity interval of the value is to be intersected with this interval. |
Returns the type of area light to be created in mental ray.
[in] | t | - The time value for which the value is queried. |
[in] | validity | - The validity interval of the value is to be intersected with this interval. |
virtual void GetAreaPrimitive | ( | AreaPrimitive & | areaPrimitive, |
TimeValue | t, | ||
Interval & | validity | ||
) | [pure virtual] |
Returns the description of the area primitive to be created in mental ray.
Will only be called if the area light type is different than "none". Implement an empty methods if the light is not an area light.
[in] | t | - The time value for which the value is queried. |
[in] | validity | - The validity interval of the value is to be intersected with this interval. |
virtual short GetAreaSamples | ( | TimeValue | t, |
Interval & | validity | ||
) | [pure virtual] |
Returns the number of area samples to be used for this area light.
The number of samples is equivalent to miLight::samples_u * miLight::samples_v. If this light is not an area light, return 0.
[in] | t | - The time value for which the value is queried. |
[in] | validity | - The validity interval of the value is to be intersected with this interval. |
virtual short GetAreaLowSamples | ( | TimeValue | t, |
Interval & | validity | ||
) | [pure virtual] |
Returns the number of area samples to be used once the trance depth given in "low_level is reached.
This value is equivalent to miLight::low_samples_u * miLight::low_samples_v. Return 0 if this is not an area light.
[in] | t | - The time value for which the value is queried. |
[in] | validity | - The validity interval of the value is to be intersected with this interval. |
virtual short GetAreaLowLevel | ( | TimeValue | t, |
Interval & | validity | ||
) | [pure virtual] |
Returns the trace depth level at which the number of area samples is changed to "low_samples".
Return 0 to disable this feature and always use "samples". Return 0 if this is not an area light.
[in] | t | - The time value for which the value is queried. |
[in] | validity | - The validity interval of the value is to be intersected with this interval. |
virtual bool GetAreaVisible | ( | TimeValue | t, |
Interval & | validity | ||
) | [pure virtual] |
Returns whether this area light is visible.
Return false if this is not an area light.
[in] | t | - The time value for which the value is queried. |
[in] | validity | - The validity interval of the value is to be intersected with this interval. |