Interfaces > Core Interfaces > SceneEffectLoader |
This Core Interface exposes the Scene Effect Loader Utility to MAXScript.
Available in 3ds Max 9 and higher.
<bool>SceneEffectLoader.LoadSceneEffect <filename>effectFile effectType:<enum> numberOfPasses:<integer> effectType enums: { #Post | #Pre | #Env} effectType default value: #Post numberOfPasses default value: 0
Loads the specified effects file into the Scene Effect Loader.
Loads the specified file and registers it with the Scene Effect system. The system maintains three lists: Post, Pre, and Env.
#Post - The effect is applied at the end of the scene graph. For example, Sepia or edge detect.
#Pre - Runs before any geometry is rendered. Useful for background effects. Only the first loaded pre-effect will be used.
#Env - Environmental effects. These are run in a separate pass and generally create data for object based shaders or shaders later on in the scene graph. For example, shadows or depth info.
To specify which list the effect belongs to, use the effectType: argument.
The numberOfPasses: argumentis only used with Env type shaders. Environment shaders must specify how many passes it requires to the system, for example, to create a cubemap, the shader will need six passed.
The lists are maintained in the order they are generated. This means that the effects are run in the same order. So, if you want to reorganize the list, simply remove all effects and apply them in the correct order.
Resets the Scene Effect Loader, removing all effects.
Enables or disables the Scene Effect Loader depending on the boolean argument. If there are no "post" effects present, the system will not be enabled. There needs to be at least one post effect for the system to be able to render.
Returns true if the Scene Effect Loader is enabled, false otherwise.
<integer>SceneEffectLoader.GetNumberOfSceneEffects effectType:<enum> effectType enums: { #Post | #Pre | #Env } effectType default value: #Post
Returns the number of scene effects currently loaded in the Scene Effect Loader. By default, returns only Post Effects unless the effect type is specified explicitly.
<bool>SceneEffectLoader.RemoveSceneEffect <index>index effectType:<enum> effectType enums: { #Post | #Pre | #Env } effectType defaultvalue: #Post
Removes the indexed scene effect from the Loader. By default, it affects the Post Effects list. A different effect type can be specified to affect the corresponding effects list.
<material>SceneEffectLoader.GetSceneEffect <index>index effectType:<enum> effectType enums: { #Post | #Pre | #Env } effectType default value: #Post
Returns a DirectX Shader material hosting the indexed effect from the specified effects list.
For example, if the Post list contains the effect post_corona.fx, calling this method with index 1 will create a DirectX Shader with this fx file loaded, which can be assigned to any slot of the Material Editor for tweaking or manipulated using MAXScript.