Lighted shader class.
This type of shader is the default type used by the application. It allows users to control luminosity, contrast and specularity as well as how the transparency is computed, should it be used.
There are two methods to create a FBShaderLighted object: using the FBShaderManager, or simply by instantiating a class object explicitely.
Sample C++ code:
// Creation of a lighted shader, and setting it to use // the constrast and specularity. HFBShaderLighted lShader = new FBShaderLighted( "New Shader" ); lShader->UseContrast = true; lShader->UseSpecular = true; lShader->Specular = 35.0; lShader->Transparency = kFBAlphaSourceTransluscentAlpha; // Use the shader. HFBModel lModel = FBFindModelByName( "Cube" ); if( lModel ) { lShader->ReplaceAll( lModel ); } // Do some more things... // And then delete it when no longer necessary; lShader->FBDelete();
The following sample code does the same task, but in Python.
Sample Python code:
from pyfbsdk import * # Creating the shader. lShader = FBShaderLighted( 'New Python Shader' ) lShader.UseContrast = True lShader.UseSpecular = True lShader.Specular = 35.0 lShader.Transparency = FBAlphaSource.kFBAlphaSourceTransluscentAlpha lModel = FBFindModelByName( 'Cube' ) if lModel: lShader.ReplaceAll( lModel )
Definition at line 574 of file fbshader.h.
#include <fbshader.h>
Public Member Functions |
|
FBShaderLighted (const char *pName, HIObject pObject=NULL) | |
Constructor. |
|
Public Attributes |
|
FBPropertyBool | UseContrast |
Read Write Property: Activate the
Contrast option. |
|
FBPropertyDouble | Contrast |
Read Write Property: Changes the
contrast of the object when it reflects light. |
|
FBPropertyBool | UseLuminosity |
Read Write Property: Activate the
Luminosity option. |
|
FBPropertyDouble | Luminosity |
Read Write Property: Changes the
brightness of the object when reflecting light. |
|
FBPropertyBool | UseSpecular |
Read Write Property: Activate the
Specularity option. |
|
FBPropertyDouble | Specular |
Read Write Property: Changes an
object's level of shininess when it reflects light by affecting the
specular highlight. |
|
FBPropertyAlphaSource | Transparency |
Read Write Property: Indicates the
computation method of the transparency. |
|
FBPropertyAnimatableDouble | Alpha |
Read Write Property: Controls the
actual effect of the shader on the object. |
FBShaderLighted | ( | const char * | pName, |
HIObject | pObject =
NULL |
||
) |
Constructor.
pName | Name of shader. |
pObject | Internal parent object to own shader(default=NULL). |
Read Write Property: Activate the Contrast option.
Definition at line 586 of file fbshader.h.
Read Write Property: Changes the contrast of the object when it reflects light.
Definition at line 587 of file fbshader.h.
Read Write Property: Activate the Luminosity option.
Definition at line 589 of file fbshader.h.
Read Write Property: Changes the brightness of the object when reflecting light.
Definition at line 590 of file fbshader.h.
Read Write Property: Activate the Specularity option.
Definition at line 592 of file fbshader.h.
Read Write Property: Changes an object's level of shininess when it reflects light by affecting the specular highlight.
Definition at line 593 of file fbshader.h.
FBPropertyAlphaSource Transparency |
Read Write Property: Indicates the computation method of the transparency.
Definition at line 595 of file fbshader.h.
Read Write Property: Controls the actual effect of the shader on the object.
At 0.0 it does nothing, and at 1.0 it fully affects the object.
Definition at line 596 of file fbshader.h.