# I3DShShader Struct Reference
[Shell Interfaces]

Inheritance diagram for I3DShShader:

List of all members.

## Public Member Functions
virtual void MCCOMAPI | Clone (I3DShShader **clone, ECloneMode mode) const =0
virtual boolean MCCOMAPI | IsConstant ()=0
virtual boolean MCCOMAPI | AssignsChannels ()=0
virtual void MCCOMAPI | GetShadingFlags (ShadingFlags &theFlags)=0
virtual boolean MCCOMAPI | HasExplicitLightingModel (const LightingContext &lightingContext)=0
virtual void MCCOMAPI | ShadeAndLight2 (LightingDetail &result, const LightingContext &lightingContext, TAbsorptionFunction *absorptionFunction)=0
virtual void MCCOMAPI | DoShade (ShadingOut &result, ShadingIn &shadingIn)=0
virtual real MCCOMAPI | GetValue (real &result, boolean &fullArea, ShadingIn &shadingIn)=0
virtual real MCCOMAPI | GetColor (TMCColorRGBA &result, boolean &fullArea, ShadingIn &shadingIn)=0
virtual real MCCOMAPI | GetVector (TVector3 &result, ShadingIn &shadingIn)=0
virtual void MCCOMAPI | GetReflection (TReflectionParameters &reflectionParams, const ShadingIn &shadingIn)=0
virtual void MCCOMAPI | GetTransparency (TTransparencyParameters &transparencyParams, const ShadingIn &shadingIn)=0
virtual void MCCOMAPI | GetShaderApproximation (ShadingOut &result, ShadingIn &shadingIn)=0
virtual void MCCOMAPI | GetShaderApproxColor (TMCColorRGBA &result, ShadingIn &shadingIn)=0
virtual void MCCOMAPI | GetBump (TVector3 &result, ShadingIn &shadingIn)=0
virtual EShaderOutput MCCOMAPI | GetImplementedOutput () const =0
virtual MCCOMErr MCCOMAPI | GetOriginalParametricTextureMap (const uint32 &uvSpaceID, const uint32 &channelIndex, IShTextureMap **outMap)=0
virtual IShParameterComponent *MCCOMAPI | GetTransformComponent ()=0
virtual boolean MCCOMAPI | GetSubShaderPreview (IShParameterComponent **shader, IShParameterComponent *subShader, FourCharT subShaderKeyword)=0
virtual void MCCOMAPI | GetShaderPreview (IShParameterComponent **shader)=0
virtual EShaderFunctionType MCCOMAPI | GetSubShaderType (IDType keyword)=0
virtual MCCOMErr MCCOMAPI | SetupPreviewScene (IPreviewMaker *previewMaker, I3DShMasterShader *masterShader)=0
virtual boolean MCCOMAPI | IsChannelConstantInUVSpace (const uint32 &uvSpaceID, const uint32 &channelIndex)=0
virtual boolean MCCOMAPI | CanBeTransparent (int32 shadingDomainIndex)=0
virtual I3DShMasterShader *MCCOMAPI | GetMasterShader ()=0
virtual MCCOMErr MCCOMAPI | GetShadersForChannel (const uint32 &uvSpaceID, const uint32 &channelIndex, TMCPtrArray< I3DShShader > &outShaders)=0
virtual boolean MCCOMAPI | GetRecommendedTextureSize (uint32 channelIndex, uint32 &width, uint32 &height) const =0
virtual void MCCOMAPI | GetRelevantTextureBucketCache (uint32 channelIndex, boolean allowMultiplierModification, IShTextureMapBucketCache **outTextureMapFile) const =0
virtual MCCOMErr MCCOMAPI | GetConstantColor (TMCColorRGBA &resColor) const =0
virtual TMCColorRGB MCCOMAPI | GetTextureMultiplyColor () const =0
virtual real MCCOMAPI | GetBumpAmplitude () const =0
virtual MCCOMErr MCCOMAPI | GetConstantValue (real &resValue) const =0

## Detailed Description

I3DShShader is the shell interface of a shader function.

There are two interfaces to access a component: The shell interface (I3DShShader) and the external interface (I3DExShader) . You can get one from the other using QueryInterface.

Whenever it is possible you should use the Shell interface (I3DShShader) to access the component because the Shell will make sure that the parameter map of the external component is valid. This is especially important if the component is animated. For more information on components see the Overview of the SDK.

See also:
  I3DExShader

## Member Function Documentation

virtual boolean MCCOMAPI I3DShShader::AssignsChannels | ( |  | ) | `[pure virtual]`

Should returns true if DoShade is implemented.

virtual boolean MCCOMAPI I3DShShader::CanBeTransparent | ( | int32 | shadingDomainIndex | ) | `[pure virtual]`

Return true if the shader can have some transparency.

Parameters:

  | shadingDomainIndex | The shading domain that is considered.

virtual void MCCOMAPI I3DShShader::Clone | ( | I3DShShader ** | clone,
|  | ECloneMode | mode |
| ) |  |  | const`[pure virtual]`

Makes a copy of a shader and its sub shaders.

Parameters:

  | clone | A pointer to the copy of the shader.
  | mode | The clone Mode (see ECloneMode).

virtual void MCCOMAPI I3DShShader::DoShade | ( | ShadingOut & | result,
|  | ShadingIn & | shadingIn |
| ) |  |  | `[pure virtual]`

Returns the shading for a given point.

Parameters:

  | result | The shading of the point.
  | shadingIn | The information about the point to shade.

virtual void MCCOMAPI I3DShShader::GetBump | ( | TVector3 & | result,
|  | ShadingIn & | shadingIn |
| ) |  |  | `[pure virtual]`

Deprecated:
  Do not implement at this point.

Parameters:

  | result |
  | shadingIn |

virtual real MCCOMAPI I3DShShader::GetBumpAmplitude | ( |  | ) | const`[pure virtual]`

virtual real MCCOMAPI I3DShShader::GetColor | ( | TMCColorRGBA & | result,
|  | boolean & | fullArea,
|  | ShadingIn & | shadingIn |
| ) |  |  | `[pure virtual]`

Returns the value of the shading function at a given point.

Parameters:

  | result | The value of the shading function
  | fullArea | True if the shading as been averaged for antiliasing.
  | shadingIn | The info about the point to shade.

virtual MCCOMErr MCCOMAPI I3DShShader::GetConstantColor | ( | TMCColorRGBA & | resColor | ) | const`[pure virtual]`

virtual MCCOMErr MCCOMAPI I3DShShader::GetConstantValue | ( | real & | resValue | ) | const`[pure virtual]`

virtual EShaderOutput MCCOMAPI I3DShShader::GetImplementedOutput | ( |  | ) | const`[pure virtual]`

Returns a bit field that determines which methods are implemented by this shading function.

virtual I3DShMasterShader* MCCOMAPI I3DShShader::GetMasterShader | ( |  | ) | `[pure virtual]`

Returns the master shader associated with this shader.

virtual MCCOMErr MCCOMAPI I3DShShader::GetOriginalParametricTextureMap | ( | const uint32 & | uvSpaceID,
|  | const uint32 & | channelIndex,
|  | IShTextureMap ** | outMap |
| ) |  |  | `[pure virtual]`

Returns a texture map if there is one for a given channel (Color, Alpha, Transparency...)

Parameters:

  | uvSpaceID | The UVSpaceID that is considered.
  | channelIndex | The index of the channel
  | outMap | The map the is output if there is one.

virtual boolean MCCOMAPI I3DShShader::GetRecommendedTextureSize | ( | uint32 | channelIndex,
|  | uint32 & | width,
|  | uint32 & | height |
| ) |  |  | const`[pure virtual]`

Calculate the intrinsic appropriate texture size.

Parameters:

  `[in]` | channelIndex | The channel for which texture is searched

virtual void MCCOMAPI I3DShShader::GetReflection | ( | TReflectionParameters & | reflectionParams,
|  | const ShadingIn & | shadingIn |
| ) |  |  | `[pure virtual]`

Returns the parameters used to calculate the reflection. This function is only called if the shader is placed in the reflection channel of a multichannel.

Parameters:

  | reflectionParams | The parameters used for reflections calculations
  | shadingIn | The info about the point to shade

virtual void MCCOMAPI I3DShShader::GetRelevantTextureBucketCache | ( | uint32 | channelIndex,
|  | boolean | allowMultiplierModification,
|  | IShTextureMapBucketCache ** | outTextureMapFile |
| ) |  |  | const`[pure virtual]`

Parameters:

  `[in]` | channelIndex | The channel for which texture is searched Get the texture map file associated to the specified shading domain.

virtual void MCCOMAPI I3DShShader::GetShaderApproxColor | ( | TMCColorRGBA & | result,
|  | ShadingIn & | shadingIn |
| ) |  |  | `[pure virtual]`

Returns information used to approximate the shading for the real time display

Parameters:

  | result | The approximation of the shading.
  | shadingIn | The info about the point to shade.

virtual void MCCOMAPI I3DShShader::GetShaderApproximation | ( | ShadingOut & | result,
|  | ShadingIn & | shadingIn |
| ) |  |  | `[pure virtual]`

Returns information used to approximate the shading for the real time display

Parameters:

  | result | The approximation of the shading.
  | shadingIn | The info about the point to shade.

virtual void MCCOMAPI I3DShShader::GetShaderPreview | ( | IShParameterComponent ** | shader | ) | `[pure virtual]`

Creates a shader that can be used to preview this shader.

Parameters:

  | shader | Shader created to be used for the preview (this shader must be a clone).

virtual MCCOMErr MCCOMAPI I3DShShader::GetShadersForChannel | ( | const uint32 & | uvSpaceID,
|  | const uint32 & | channelIndex,
|  | TMCPtrArray< I3DShShader > & | outShaders |
| ) |  |  | `[pure virtual]`

Returns the shader part of a given uvspace / channel.

Parameters:

  | uvSpaceID | The uvSpaceID for which we want the texture
  | channelIndex | The index of the channel that we want (color,alpha,...)
  | outShaders | Returns the list of the shaders found.

virtual void MCCOMAPI I3DShShader::GetShadingFlags | ( | ShadingFlags & | theFlags | ) | `[pure virtual]`

Returns the ShadingFlags associated with this shader.

Parameters:

  | theFlags | The ShadingFlags associated with this shader.

virtual boolean MCCOMAPI I3DShShader::GetSubShaderPreview | ( | IShParameterComponent ** | shader,
|  | IShParameterComponent * | subShader,
|  | FourCharT | subShaderKeyword |
| ) |  |  | `[pure virtual]`

Creates a shader that can be used to preview one of the subshader.

Parameters:

  | shader | Shader created to be used for the preview.
  | subShader | Shader to put in the sub shader with the keyword subShaderKeyword.
  | subShaderKeyword | Keywork of the sub shader (in the PMap).

Returns:
  true if the shader created have to be processed by the parent shader false if not.

virtual EShaderFunctionType MCCOMAPI I3DShShader::GetSubShaderType | ( | IDType | keyword | ) | `[pure virtual]`

Get the type of a sub shader.

Parameters:

  | keyword | Id of the sub shader.

Returns:
  the type of the sub shader.

virtual TMCColorRGB MCCOMAPI I3DShShader::GetTextureMultiplyColor | ( |  | ) | const`[pure virtual]`

virtual IShParameterComponent* MCCOMAPI I3DShShader::GetTransformComponent | ( |  | ) | `[pure virtual]`

Returns a pointer to the transform component that defines the 3D transform of the shader.

Returns:
  A pointer to this shader's Transform component, or NULL if the shader does not have a Transform component.

virtual void MCCOMAPI I3DShShader::GetTransparency | ( | TTransparencyParameters & | transparencyParams,
|  | const ShadingIn & | shadingIn |
| ) |  |  | `[pure virtual]`

Returns the parameters used to calculate the transparency. This function is only called if the shader is placed in the transparency channel of a multichannel.

Parameters:

  | transparencyParams | The parameters used for transparency calculations
  | shadingIn | The info about the point to shade

virtual real MCCOMAPI I3DShShader::GetValue | ( | real & | result,
|  | boolean & | fullArea,
|  | ShadingIn & | shadingIn |
| ) |  |  | `[pure virtual]`

Returns the value of the shading function at a given point.

Parameters:

  | result | The value of the shading function
  | fullArea | True if the shading as been averaged for antiliasing.
  | shadingIn | The info about the point to shade.

virtual real MCCOMAPI I3DShShader::GetVector | ( | TVector3 & | result,
|  | ShadingIn & | shadingIn |
| ) |  |  | `[pure virtual]`

Returns a pertubation of the normal in local coordinates

Parameters:

  | result | A vector in local coordinates.
  | shadingIn | The info about the point to shade.

virtual boolean MCCOMAPI I3DShShader::HasExplicitLightingModel | ( | const LightingContext & | lightingContext | ) | `[pure virtual]`

**************************************************************************** HasExplicitLightingModel

Returns true if there is an explicit lighting model in the subtree. This is mostly used for layer lists to determine if DoShade or ShadeAndLight2 should be called on the layer.

Parameters:

  | lightingContext | The information about the point that should be lit.

virtual boolean MCCOMAPI I3DShShader::IsChannelConstantInUVSpace | ( | const uint32 & | uvSpaceID,
|  | const uint32 & | channelIndex |
| ) |  |  | `[pure virtual]`

Return true if this channel is constant on that UV Space. If not, an exporter should try to bake a texture map.

Parameters:

  | uvSpaceID | The UVSpaceID that is considered.
  | channelIndex | The index of the channel

virtual boolean MCCOMAPI I3DShShader::IsConstant | ( |  | ) | `[pure virtual]`

Returns true if the shader has a constant result (to optimize things like Value and Color shaders).

virtual MCCOMErr MCCOMAPI I3DShShader::SetupPreviewScene | ( | IPreviewMaker * | previewMaker,
|  | I3DShMasterShader * | masterShader |
| ) |  |  | `[pure virtual]`

Setup the preview maker to render a preview of this shader.

Parameters:

  | previewMaker | The preview maker to setup.
  | masterShader | The master shader to be previewed.

virtual void MCCOMAPI I3DShShader::ShadeAndLight2 | ( | LightingDetail & | result,
|  | const LightingContext & | lightingContext,
|  | TAbsorptionFunction * | absorptionFunction |
| ) |  |  | `[pure virtual]`

Calculates the shading and lighting in one point

Parameters:

  | result | The color seen by the observer
  | lightingContext | info about the point being shaded and the lighting of the scene
  | absorptionFunction | The absorption function that corresponds to the current medium.

The documentation for this struct was generated from the following file:

- I3DShShader.h