Shader Class Reference
Base class for all shaders.
More...
#include <ShadeDll.h>
Inheritance diagram for Shader:
[legend]Collaboration diagram for Shader:
[legend]List of all members.
Detailed Description
Base class for all shaders.
To write a shader plug-in for Animation Master you must derive a class from the Shader class provided in "ShadeDll.h". The derivation should look something like this:
class MyCoolShader : public Shader;
Once you have declared your new class, you can begin overriding the virtual functions found in the Shader base class or in the DLLPlugin base class. You will need to override nearly every function in the base classes to have a completely functional new shader.
A shader may compute either a diffuse value, a specular value or both values.
Shaders are called for each lights in the scene. The hit point on the surface of the object is the actual world hit point. This is different from the hit point for Textures and Turbulence.
- See also:
- Texture and Turbulence.
Definition at line 11 of file ShadeDll.h.
Constructor & Destructor Documentation
|
- Parameters:
-
| treeobject | Points to the plugins owner. It is the class that the Shader is member of. It is the actual class you see in the PWS tree. The constructor only uses it to set the member variable m_treeobject. This member is used for ReAssignPtr. This is also the pointer returned by GetOwner(). |
- See also:
- DLLPlugin::DLLPlugin (HTreeObject *htreeobject)
Definition at line 14 of file ShadeDll.h. |
Member Function Documentation
void Shader::GetDiffuse |
( |
HShading * |
shading |
) |
[pure virtual] |
|
|
Returns in the HShading parameter the computed diffuse value. - Parameters:
-
- Note:
- GetDiffuse will not be called for any backfacing surfaces from the given shading light. So it is not possible to shade any part of a surface that falls in the shadow side of the light.
|
const char * Shader::GetShaderDiffuseFilters |
( |
|
) |
[pure virtual] |
|
|
Indicated whether the plugin will compute a diffuse value. - Returns:
- NULL if the plugin does not compute a diffuse value or a pointer to a MENUFILTER string if it does compute a difuse value.
Example: const char *CustomShader::GetShaderDiffuseFilters()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
static CString filter;
filter.LoadString(IDS_MENUFILTER);
return (LPCTSTR)filter;
}
|
const char * Shader::GetShaderSpecularFilters |
( |
|
) |
[pure virtual] |
|
|
Indicated whether the plugin will compute a specular value. - Returns:
- NULL if the plugin does not compute a specular value or a pointer to a MENUFILTER string if it dows compute a specular value.
- See also:
- Code example for GetShaderDiffuseFilters()
|
BOOL Shader::GetSpecular |
( |
HShading * |
shading, |
|
|
const RGBFloat & |
lightcolor |
|
) |
[pure virtual] |
|
|
Returns in the HShading parameter the computed specular value. - Parameters:
-
| shading | Set the HShading::GetDCol() to the new computed specular color. |
| lightcolor | The color of the light that may be used in the specular computation. |
- Note:
- GetSpecular will not be called for any backfacing surfaces from the given shading light. So it is not possible to shade any part of a surface that falls in the shadow side of the light.
GetSpecular will be called for part of the surface that is obscured from the given light by another object. In other words, the A:M shader will not take into account any occluding object between a light and the surface when calling GetSpecular. So object in the shadow of another object will still exibit specular highlight.
|
The documentation for this class was generated from the following files:
This A:M SDK v12.0 documentation is maintained by Hash Inc.
Please address any comments concerning this documentation to AMReports.
If you have any information, knowledge, or documentation to share with the A:M developer community, please post them on the Hash SDK forum.
Generated on Thu Oct 27 11:47:03 2005 with
1.4.5 written by Dimitri van Heesch,
© 1997-2001