MaterialKit

class HPS.MaterialKit : public HPS.Kit

The MaterialKit class is a user space object, useful for carrying a group of attribute settings. A MaterialKit can be associated with various geometry or subgeometery types using a material mapping kit or control.

Public Functions

override void Dispose ()
override bool Empty ()

Indicates whether this object has any values set on it.

Return

true if no values are set on this object, false otherwise.

bool Equals (HPS.MaterialKit in_kit)

Check if the source MaterialKit is equivalent to this object.

Param in_kit

The source MaterialKit to compare to this object.

Return

true if the objects are equivalent, false otherwise.

override bool Equals (Object obj)
override int GetHashCode ()
MaterialKit ()

The default constructor creates an empty MaterialKit object.

MaterialKit (HPS.MaterialKit in_kit)

The copy constructor creates a new MaterialKit object that contains the same settings as the source.

Param in_kit

The source MaterialKit to copy.

override HPS.Type ObjectType ()

This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).

Return

The declared type of the object in question, which may differ from the true, underlying type.

void Set (HPS.MaterialKit in_kit)

Copies all settings from the source MaterialKit into this object.

Param in_kit

The source MaterialKit to copy.

HPS.MaterialKit SetBump (string in_texture_name)

Applies a named texture to the bump channel, replacing any other texture on that channel.

Param in_texture_name

The name of a texture, defined in a portfolio that is accessible.

Return

A reference to this object.

HPS.MaterialKit SetDiffuse (HPS.RGBAColor in_color)

Applies an RGBA color to the whole diffuse channel, replacing any diffuse textures or shaders.

Param in_color

The color to be applied.

Return

A reference to this object.

HPS.MaterialKit SetDiffuse (HPS.RGBColor in_color)

Applies an RGB color to the whole diffuse channel, replacing any diffuse textures or shaders.

Param in_color

The color to be applied.

Return

A reference to this object.

HPS.MaterialKit SetDiffuseAlpha (float in_alpha)

Applies an alpha channel the diffuse color channel. Only one diffuse color may be set at a time but it can coexist with diffuse textures if they have transparency. If diffuse color has not been set, white will be set as a default value in the diffuse color channel with a transparent value of in_alpha.

Param in_alpha

The alpha to be applied.

Return

A reference to this object.

HPS.MaterialKit SetDiffuseColor (HPS.RGBAColor in_color)

Applies an RGBA color to the diffuse color channel. Only one diffuse color may be set at a time but it can coexist with diffuse textures if they have transparency.

Param in_color

The color to be applied.

Return

A reference to this object.

HPS.MaterialKit SetDiffuseColor (HPS.RGBColor in_color)

Applies an RGB color to the diffuse color channel. Only one diffuse color may be set at a time but it can coexist with diffuse textures if they have transparency.

Param in_color

The color to be applied.

Return

A reference to this object.

HPS.MaterialKit SetDiffuseTexture (string in_texture_name)

Applies a named texture to the specified layer of the diffuse texture channel, replacing any other textures on that layer.

Param in_texture_name

The name of a texture, defined in a portfolio that is accessible. There are two special values that can be passed in here. A null pointer removes the texture name from that layer, allowing the texture on that layer to be inherited from above in the tree. Passing an empty string, “”, removes the texture from that layer but indicates that no texture should be inherited from above, an explicit blank.

Return

A reference to this object.

HPS.MaterialKit SetDiffuseTexture (string in_texture_name, HPS.RGBAColor in_modulating_color)

Applies a modulated named texture to the specified layer of the diffuse texture channel, replacing any other textures on that layer.

Param in_texture_name

The name of a texture, defined in a portfolio that is accessible. There are two special values that can be passed in here. A null pointer removes the texture name from that layer, allowing the texture on that layer to be inherited from above in the tree. Passing an empty string, “”, removes the texture from that layer but indicates that no texture should be inherited from above, an explicit blank.

Param in_modulating_color

A color that will be applied as a filter to the texture.

Return

A reference to this object.

HPS.MaterialKit SetDiffuseTexture (string in_texture_name, HPS.RGBAColor in_modulating_color, ulong in_layer)

Applies a modulated named texture to the specified layer of the diffuse texture channel, replacing any other textures on that layer.

Param in_texture_name

The name of a texture, defined in a portfolio that is accessible. There are two special values that can be passed in here. A null pointer removes the texture name from that layer, allowing the texture on that layer to be inherited from above in the tree. Passing an empty string, “”, removes the texture from that layer but indicates that no texture should be inherited from above, an explicit blank.

Param in_modulating_color

A color that will be applied as a filter to the texture.

Param in_layer

The layer to apply the texture to. Higher numbered layers are applied on top of lower numbered ones.

Return

A reference to this object.

HPS.MaterialKit SetDiffuseTexture (string in_texture_name, ulong in_layer)

Applies a named texture to the specified layer of the diffuse texture channel, replacing any other textures on that layer.

Param in_texture_name

The name of a texture, defined in a portfolio that is accessible. There are two special values that can be passed in here. A null pointer removes the texture name from that layer, allowing the texture on that layer to be inherited from above in the tree. Passing an empty string, “”, removes the texture from that layer but indicates that no texture should be inherited from above, an explicit blank.

Param in_layer

The layer to apply the texture to. Higher numbered layers are applied on top of lower numbered ones.

Return

A reference to this object.

HPS.MaterialKit SetDiffuseTexture (string[] in_texture_names)

Applies named textures to each of the specified layers of the diffuse texture channel, replacing any other textures on those layers.

Param in_texture_names

The names of textures, one per layer. Uninitialized strings are ignored. An empty string, “”, removes the texture from that layer but indicates that no texture should be inherited from above, an explicit blank.

Return

A reference to this object.

HPS.MaterialKit SetDiffuseTexture (string[] in_texture_names, HPS.RGBAColor[] in_modulating_colors)

Applies named textures, possibly modulated, to each of the specified layers of the diffuse texture channel, replacing any other textures on those layers.

Param in_texture_names

The names of textures, one per layer. Uninitialized strings are ignored. An empty string, “”, removes the texture from that layer but indicates that no texture should be inherited from above, an explicit blank.

Param in_modulating_colors

An array of modulating colors to be applied to the corresponding layer. If a color in the this array is uninitialized, the texture on that layer will be unmodulated.

Return

A reference to this object.

HPS.MaterialKit SetEmission (HPS.RGBAColor in_rgba_color)

Applies an RGBA color to the emission channel, replacing any other color or texture on that channel.

Param in_rgba_color

The color to be applied.

Return

A reference to this object.

HPS.MaterialKit SetEmission (string in_texture_name)

Applies a named texture to the emission channel, replacing any other color or texture on that channel.

Param in_texture_name

The name of a texture, defined in a portfolio that is accessible.

Return

A reference to this object.

HPS.MaterialKit SetEmission (string in_texture_name, HPS.RGBAColor in_modulating_color)

Applies a modulated named texture to the emission channel, replacing any other color or texture on that channel.

Param in_texture_name

The name of a texture, defined in a portfolio that is accessible.

Param in_modulating_color

A color that will be applied as a filter to the texture.

Return

A reference to this object.

HPS.MaterialKit SetEnvironmentCubeMap (string in_cubemap_name)

Applies a named cube map to the environment channel, replacing any other texture or cube map on that channel.

Param in_cubemap_name

The name of a texture, defined in a portfolio that is accessible.

Return

A reference to this object.

HPS.MaterialKit SetEnvironmentCubeMap (string in_cubemap_name, HPS.RGBAColor in_modulating_color)

Applies a modulated named cube map to the environment channel, replacing any other texture or cube map on that channel.

Param in_cubemap_name

The name of a texture, defined in a portfolio that is accessible.

Param in_modulating_color

A color that will be applied as a filter to the cube map.

Return

A reference to this object.

HPS.MaterialKit SetEnvironmentTexture ()

Cancels any other texture or cube map on the environment channel.

Return

A reference to this object.

HPS.MaterialKit SetEnvironmentTexture (string in_texture_name)

Applies a named texture to the environment channel, replacing any other texture or cube map on that channel.

Param in_texture_name

The name of a texture, defined in a portfolio that is accessible.

Return

A reference to this object.

HPS.MaterialKit SetEnvironmentTexture (string in_texture_name, HPS.RGBAColor in_modulating_color)

Applies a modulated named texture to the environment channel, replacing any other texture or cube map on that channel.

Param in_texture_name

The name of a texture, defined in a portfolio that is accessible.

Param in_modulating_color

A color that will be applied as a filter to the texture.

Return

A reference to this object.

HPS.MaterialKit SetGloss (float in_gloss)

Gloss is a setting that helps to determine the specular response of a material. It is a single floating point value that describes the “focus” of specular reflections off a surface. The gloss value changes the area of the “glare” off a surface. A high gloss value gives a small, focused glare; a low gloss value results in a less polished, more scattered reflection.

Param in_gloss

Gloss is always positive, and most surfaces have a gloss in the range of 1.0 to 30.0.

Return

A reference to this object.

HPS.MaterialKit SetMirror (HPS.RGBAColor in_rgba_color)

Applies an RGBA color to the mirror channel, replacing any other color or texture on that channel.

Param in_rgba_color

The color to be applied.

Return

A reference to this object.

HPS.MaterialKit SetMirror (string in_texture_name)

Applies a named texture to the mirror channel, replacing any other color or texture on that channel.

Param in_texture_name

The name of a texture, defined in a portfolio that is accessible.

Return

A reference to this object.

HPS.MaterialKit SetMirror (string in_texture_name, HPS.RGBAColor in_modulating_color)

Applies a modulated named texture to the mirror channel, replacing any other color or texture on that channel.

Param in_texture_name

The name of a texture, defined in a portfolio that is accessible.

Param in_modulating_color

A color that will be applied as a filter to the texture.

Return

A reference to this object.

HPS.MaterialKit SetSpecular (HPS.RGBAColor in_rgba_color)

Applies an RGBA color to the specular channel, replacing any other color or texture on that channel.

Param in_rgba_color

The color to be applied.

Return

A reference to this object.

HPS.MaterialKit SetSpecular (string in_texture_name)

Applies a named texture to the specular channel, replacing any other color or texture on that channel.

Param in_texture_name

The name of a texture, defined in a portfolio that is accessible.

Return

A reference to this object.

HPS.MaterialKit SetSpecular (string in_texture_name, HPS.RGBAColor in_modulating_color)

Applies a modulated named texture to the specular channel, replacing any other color or texture on that channel.

Param in_texture_name

The name of a texture, defined in a portfolio that is accessible.

Param in_modulating_color

A color that will be applied as a filter to the texture.

Return

A reference to this object.

HPS.MaterialKit SetTransmission (string in_texture_name)

Applies a named texture to the transmission channel, replacing any other color or texture on that channel.

Param in_texture_name

The name of a texture, defined in a portfolio that is accessible.

Return

A reference to this object.

HPS.MaterialKit SetTransmission (string in_texture_name, HPS.RGBAColor in_modulating_color)

Applies a modulated named texture to the transmission channel, replacing any other color or texture on that channel.

Param in_texture_name

The name of a texture, defined in a portfolio that is accessible.

Param in_modulating_color

A color that will be applied as a filter to the texture.

Return

A reference to this object.

void Show (out HPS.MaterialKit out_kit)

Copies all settings from this MaterialKit into the given MaterialKit.

Param out_kit

The MaterialKit to populate with the contents of this object.

bool ShowBump (out string out_texture_name)

Retrieves the texture applied to the bump channel.

Param out_texture_name

The name of a texture applied to this channel.

Return

true if a texture has been set on the bump channel, false otherwise.

bool ShowDiffuse ()

If the diffuse color will override textures and shaders.

Return

true if the diffuse color will override textures and shaders, false otherwise.

bool ShowDiffuseAlpha (out float out_alpha)

Retrieves alpha set on the diffuse alpha channel.

Param out_alpha

The color set on the diffuse alpha channel.

Return

true if the internal selection limit is valid, false otherwise.

bool ShowDiffuseColor (out HPS.RGBAColor out_rgba_color)

Retrieves RGBA color set on the diffuse color channel.

Param out_rgba_color

The RGBA color set on the diffuse color channel.

Return

true if the diffuse RGB color is valid, false otherwise.

bool ShowDiffuseColor (out HPS.RGBColor out_rgb_color)

Retrieves RGB color set on the diffuse RGB channel.

Param out_rgb_color

The RGB color set on the diffuse RGB channel.

Return

true if the diffuse RGB color is valid, false otherwise.

bool ShowDiffuseTexture (out HPS.Material.Type out_type, out HPS.RGBAColor out_color, out string out_texture_name)

Retrieves the possibly modulated texture applied to layer 0 of the diffuse texture channel.

Param out_type

Indicates which of the following arguments is valid. If the type is TextureName, only the texture name is valid, the color should be ignored. If the type is ModulatedTexture, both the texture name and the modulating color are valid.

Param out_color

A modulating color applied as a filter to the named texture, only valid if out_type is ModulatedTexture.

Param out_texture_name

The name of a texture applied to this channel.

Return

true if a texture has been set on layer 0 of the diffuse texture channel, false otherwise.

bool ShowDiffuseTexture (out HPS.Material.Type[] out_types, out HPS.RGBAColor[] out_colors, out string[] out_texture_names)
bool ShowDiffuseTexture (ulong in_layer, out HPS.Material.Type out_type, out HPS.RGBAColor out_color, out string out_texture_name)

Retrieves the possibly modulated texture applied to the specified layer of the diffuse texture channel.

Param in_layer

The layer number to query for a texture.

Param out_type

Indicates which of the following arguments is valid. If the type is TextureName, only the texture name is valid, the color should be ignored. If the type is ModulatedTexture, both the texture name and the modulating color are valid.

Param out_color

A modulating color applied as a filter to the named texture, only valid if out_type is ModulatedTexture.

Param out_texture_name

The name of a texture applied to this channel.

Return

true if a texture has been set on the specified layer of the diffuse texture channel, false otherwise.

bool ShowEmission (out HPS.Material.Type out_type, out HPS.RGBAColor out_color, out string out_texture_name)

Retrieves the color, texture, or modulated texture applied to the emission channel.

Param out_type

Indicates which of the following arguments is valid. If the type is RGBAColor, only out_color is valid, the texture name should be ignored. If the type is TextureName, only the texture name is valid, the color should be ignored. If the type is ModulatedTexture, both the texture name and the modulating color are valid.

Param out_color

A color used either for the entire channel or to modulate a texture on this channel. See out_type to determine if this color is valid.

Param out_texture_name

The name of a possibly modulated texture applied to this channel. See out_type to determine if this texture name is valid.

Return

true if any color or texture has been set on the emission channel, false otherwise.

bool ShowEnvironment (out HPS.Material.Type out_type, out HPS.RGBAColor out_color, out string out_texture_name)

Retrieves the color, texture, or modulated texture applied to the environment channel.

Param out_type

Indicates which of the following arguments is valid. If the type is RGBAColor, only out_color is valid, the texture name should be ignored. If the type is TextureName, only the texture name is valid, the color should be ignored. If the type is ModulatedTexture, both the texture name and the modulating color are valid.

Param out_color

A color used either for the entire channel or to modulate a texture on this channel. See out_type to determine if this color is valid.

Param out_texture_name

The name of a possibly modulated texture applied to this channel. See out_type to determine if this texture name is valid.

Return

true if any color or texture has been set on the environment channel, false otherwise.

bool ShowGloss (out float out_gloss)

Retrieves the gloss of this material. Gloss is a single floating point value that describes the “focus” of specular reflections off a surface.

See

SetGloss().

Param out_gloss

The gloss value of this material. Gloss is always positive, and most surfaces have a gloss in the range of 1.0 to 30.0.

Return

true if gloss has been specified for this material, false otherwise.

bool ShowMirror (out HPS.Material.Type out_type, out HPS.RGBAColor out_color, out string out_texture_name)

Retrieves the color, texture, or modulated texture applied to the mirror channel.

Param out_type

Indicates which of the following arguments is valid. If the type is RGBAColor, only out_color is valid, the texture name should be ignored. If the type is TextureName, only the texture name is valid, the color should be ignored. If the type is ModulatedTexture, both the texture name and the modulating color are valid.

Param out_color

A color used either for the entire channel or to modulate a texture on this channel. See out_type to determine if this color is valid.

Param out_texture_name

The name of a possibly modulated texture applied to this channel. See out_type to determine if this texture name is valid.

Return

true if any color or texture has been set on the mirror channel, false otherwise.

bool ShowSpecular (out HPS.Material.Type out_type, out HPS.RGBAColor out_color, out string out_texture_name)

Retrieves the color, texture, or modulated texture applied to the specular channel.

Param out_type

Indicates which of the following arguments is valid. If the type is RGBAColor, only out_color is valid, the texture name should be ignored. If the type is TextureName, only the texture name is valid, the color should be ignored. If the type is ModulatedTexture, both the texture name and the modulating color are valid.

Param out_color

A color used either for the entire channel or to modulate a texture on this channel. See out_type to determine if this color is valid.

Param out_texture_name

The name of a possibly modulated texture applied to this channel. See out_type to determine if this texture name is valid.

Return

true if any color or texture has been set on the specular channel, false otherwise.

bool ShowTransmission (out HPS.Material.Type out_type, out HPS.RGBAColor out_color, out string out_texture_name)

Retrieves the color, texture, or modulated texture applied to the transmission channel.

Param out_type

Indicates which of the following arguments is valid. If the type is RGBAColor, only out_color is valid, the texture name should be ignored. If the type is TextureName, only the texture name is valid, the color should be ignored. If the type is ModulatedTexture, both the texture name and the modulating color are valid.

Param out_color

A color used either for the entire channel or to modulate a texture on this channel. See out_type to determine if this color is valid.

Param out_texture_name

The name of a possibly modulated texture applied to this channel. See out_type to determine if this texture name is valid.

Return

true if any color or texture has been set on the transmission channel, false otherwise.

HPS.MaterialKit UnsetBump ()

Removes all settings applied to the bump channel.

Return

A reference to this object.

HPS.MaterialKit UnsetDiffuseAlpha ()

Removes all settings applied to the diffuse alpha channel.

Return

A reference to this object.

HPS.MaterialKit UnsetDiffuseColor ()

Removes all settings applied to the diffuse color channel including alpha.

Return

A reference to this object.

HPS.MaterialKit UnsetDiffuseColorRGB ()

Removes all settings applied to the diffuse rgb channel.

Return

A reference to this object.

HPS.MaterialKit UnsetDiffuseTexture ()

Removes all settings applied to all layers of the diffuse texture channel.

Return

A reference to this object.

HPS.MaterialKit UnsetDiffuseTexture (ulong in_layer)

Removes all settings applied to the specified layer of the diffuse texture channel.

Param in_layer

The layer to remove the setting from.

Return

A reference to this object.

HPS.MaterialKit UnsetEmission ()

Removes all settings applied to the emission channel.

Return

A reference to this object.

HPS.MaterialKit UnsetEnvironment ()

Removes all settings applied to the environment channel.

Return

A reference to this object.

HPS.MaterialKit UnsetEverything ()

Removes all setting from this material.

Return

A reference to this object.

HPS.MaterialKit UnsetGloss ()

Removes the gloss setting applied to this material.

Return

A reference to this object.

HPS.MaterialKit UnsetMirror ()

Removes all settings applied to the mirror channel.

Return

A reference to this object.

HPS.MaterialKit UnsetSpecular ()

Removes all settings applied to the specular channel.

Return

A reference to this object.

HPS.MaterialKit UnsetTransmission ()

Removes all settings applied to the transmission channel.

Return

A reference to this object.

Public Static Functions

bool operator!= (HPS.MaterialKit a, HPS.MaterialKit b)
bool operator== (HPS.MaterialKit a, HPS.MaterialKit b)