Shader2 Class Reference

Base class for all shaders that support ambiance shading. More...

#include <ShadeDll.h>

Inheritance diagram for Shader2:

Inheritance graph
[legend]
Collaboration diagram for Shader2:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Shader2 (HTreeObject *treeobject)
virtual const char * GetShaderAmbianceFilters ()=0
virtual void GetAmbiance (HShading *shading)=0

Detailed Description

Base class for all shaders that support ambiance shading.

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 Shader2; 

Once you have declared your new class, you can begin overriding the virtual functions found in the Shader2 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 Shader2 may compute an ambiance value in addition to either a diffuse value, a specular value or all values.

The speciic Ambiance part of a Shader2 is called only once per scene per pixel. The returned ambiance value is added in the rendering equation.

The diffuse and specular parts of the 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 22 of file ShadeDll.h.


Constructor & Destructor Documentation

Shader2::Shader2 HTreeObject treeobject  )  [inline]
 

Parameters:
treeobject Points to the plugins owner. It is the class that the Texture 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 24 of file ShadeDll.h.


Member Function Documentation

void Shader2::GetAmbiance HShading shading  )  [pure virtual]
 

Returns in the HShading parameter the computed ambiance value.

Parameters:
shading Set the HShading::GetACol() to the new computed ambiance color.
Note:
GetAmbiance is called for every visible parts of the scene.

const char * Shader2::GetShaderAmbianceFilters  )  [pure virtual]
 

Indicated whether the plugin will compute an ambiance value.

Returns:
NULL if the plugin does not compute an ambiance value or a pointer to a MENUFILTER string if it does compute an ambiance value.
Example:
const char *CustomShader::GetShaderAmbianceFilters()
{
   AFX_MANAGE_STATE(AfxGetStaticModuleState());
   static CString filter;
   filter.LoadString(IDS_MENUFILTER);
   return (LPCTSTR)filter;
}


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 doxygen 1.4.5 written by Dimitri van Heesch, © 1997-2001