Class IRadiosityEffectExtension

3DS Max Plug-In SDK

Class IRadiosityEffectExtension

See Also: : Class RadiosityEffect

class IRadiosityEffectExtension : public BaseInterface

Description:

This class is only available in release 5 or later.

This class provides additional functionality for class RadiosityEffect. Given an instance of RadiosityEffect, you may retrieve the extension interface as follows:

 IRadiosityEffectExtension* r = static_cast<IRadiosityEffectExtension*>(radiosityInstance->GetInterface(IRADIOSITYEFFECT_EXTENSION_INTERFACE));

If the result is NULL, the RadiosityEffect does not support this interface.

All methods of this class are implemented by the plug-in.

 

Methods:

Prototype:

virtual bool useDefaultLight(const DefaultLight& defLight) const = 0

 

Remarks:

Returns whether the specified default light should be used by the scanline renderer. The scanline renderer normally creates default lights when there are no lights in the scene. A radiosity plug-in could override this if it uses objects other than lights as light sources (e.g. self-emitting surfaces)

 

Parameters:

Const DefaultLight& defLight

A default light created by the scanline renderer when it begins rendering.

 

Return value:

Returns whether or not the scanline renderer should use the light for the current rendering.

 

 

Prototype:

virtual bool IsInterestedInChannels(PartID part) const

 

Remarks:

This is used to control reference messages sent to the RadiosityEffect plug-in. It allows the RadiosityEffect to tell the system which messages will not invalidate the lighting solution.

If the RadiosityEffect decides that all messages of a given PartID are irrelevant to the lighting solution, it can return false when that PartID flag is present in the input parameter (and no other, more relevant, PartID flags are present). Otherwise it should return true, indicating it needs those messages.

If the return value is false, the system will add the PartID flag PART_EXCLUDE_RADIOSITY to all appropriate reference messages; this flag generically indicates an event which should not invalidate a radiosity solution. The RadiosityEffect will still receive the message but can ignore it. Other modules which need to discriminate messages pertinent radiosity, can also check this flag.

As an example of when this is important, an edit mesh modifier may send change messages which are meant to flush internal caches but not relevant to radiosity. As the message propagates, some PartID flags are added in order to force modifiers to re-evaluate downstream in the stack. This may confuse the radiosity engine into invalidating its lighting solution. But the edit mesh ensures the original message bears the PART_EXCLUDE_RADIOSITY flag, and as subsequent messages inherit the flag, the RadiosityEffect can correctly ignore the message.

 

Parameters:

PartID part

One or more PartID flags defining the category of messages to be filtered.

 

Return value:

Whether or not to filter the given messages, by setting their PART_EXCLUDE_RADIOSITY PartID flag.

 

 

Prototype:

virtual Interface_ID GetID()

 

Remarks:

This returns the ID of the interface, IRADIOSITYEFFECT_EXTENSION_INTERFACE, and should not be overridden by an implementation class.

 

Return value:

The IRadiosityEffectExtension interface ID, IRADIOSITYEFFECT_EXTENSION_INTERFACE.

 

Default Implementation:

{ return IRADIOSITYEFFECT_EXTENSION_INTERFACE; }