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.Please consult the application documentation for more infos on shader properties and their effects.This class should not serve as a base class for another class.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 )
Public Member Functions |
|
FBShaderLighted (str pName) | |
Constructor. |
|
Public Attributes |
|
FBAnimatableDouble | Alpha |
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. |
|
float | Contrast |
Read Write Property: Changes the
contrast of the object when it reflects light.
|
|
float | Luminosity |
Read Write Property: Changes the
brightness of the object when reflecting light.
|
|
float | Specular |
Read Write Property: Changes an
object's level of shininess when it reflects light by affecting the
specular highlight. |
|
FBAlphaSource | Transparency |
Read Write Property: Indicates the
computation method of the transparency. |
|
bool | UseContrast |
Read Write Property: Activate the
Contrast option. |
|
bool | UseLuminosity |
Read Write Property: Activate the
Luminosity option. |
|
bool | UseSpecular |
Read Write Property: Activate the
Specularity option. |
FBShaderLighted | ( | str | pName | ) |
Constructor.
pName | Name of shader. |
FBAnimatableDouble Alpha |
Read Write Property: Changes the brightness of the object when reflecting light.
Read Write Property: Changes an object's level of shininess when it reflects light by affecting the specular highlight.
Read Write Property: Indicates the computation method of the transparency.
Read Write Property: Activate the Contrast option.
Read Write Property: Activate the Luminosity option.
Read Write Property: Activate the Specularity option.