FBShaderLighted Class Reference


Detailed Description

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.

Note:
Please consult the application documentation for more infos on shader properties and their effects.
Warning:
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.
    FBShaderLighted* lShader = new FBShaderLighted( "New Shader" );

    lShader->UseContrast  = true;
    lShader->UseSpecular  = true;
    lShader->Specular     = 35.0;
    lShader->Transparency = kFBAlphaSourceTransluscentAlpha;

    // Use the shader.
    FBModel* lModel = FBFindModelByLabelName( "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

    # User the shader
    lModel = FBFindModelByLabelName( 'Cube' )
    if lModel <> None:
        lModel.Show = True
        lShader.ReplaceAll( lModel )
Inheritance diagram for FBShaderLighted:

List of all members.

Public Member Functions

 __init__ (str pName, object pObject=None)
 Constructor.

Public Attributes

FBPropertyBase UseContrast
 Read Write Property: Activate the Contrast option.
FBPropertyBase Contrast
 Read Write Property: Changes the contrast of the object when it reflects light.
FBPropertyBase UseLuminosity
 Read Write Property: Activate the Luminosity option.
FBPropertyBase Luminosity
 Read Write Property: Changes the brightness of the object when reflecting light.
FBPropertyBase UseSpecular
 Read Write Property: Activate the Specularity option.
FBPropertyBase 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.
FBPropertyBaseAnimatable Alpha
 Read Write Property: Controls the actual effect of the shader on the object.

Member Function Documentation

__init__ ( str  pName,
object  pObject = None 
)

Constructor.

Parameters:
pNameName of shader.
pObjectInternal parent object to own shader(default=NULL).

Reimplemented from FBShader.


Member Data Documentation

FBPropertyBase UseContrast

Read Write Property: Activate the Contrast option.

FBPropertyBase Contrast

Read Write Property: Changes the contrast of the object when it reflects light.

FBPropertyBase UseLuminosity

Read Write Property: Activate the Luminosity option.

FBPropertyBase Luminosity

Read Write Property: Changes the brightness of the object when reflecting light.

FBPropertyBase UseSpecular

Read Write Property: Activate the Specularity option.

FBPropertyBase 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.

FBPropertyBaseAnimatable 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.


FBShaderLighted FBShaderLighted FBShaderLighted FBShaderLighted FBShaderLighted FBShaderLighted FBShaderLighted FBShaderLighted FBShaderLighted FBShaderLighted
FBShaderLighted FBShaderLighted FBShaderLighted FBShaderLighted FBShaderLighted FBShaderLighted FBShaderLighted FBShaderLighted FBShaderLighted FBShaderLighted