Shader manager. More...
#include <pyfbsdk_generated.h>
Public Member Functions | |
FBShaderManager () | |
Constructor. | |
FBShader | CreateShader (str pShaderTypeName) |
Creates a shader according to the shader type provided. | |
Public Attributes | |
FBStringList | ShaderTypeNames |
List of available shaders. | |
FBStringList | ShaderTypeNamesLocalized |
List of available shaders. | |
Shader manager.
This class provides access to the list of available shaders, both system shaders and user shaders. The list comes in two versions:ShaderTypeNames : which gives the internal names of the shaders,ShaderTypeNamesLocalized : uses the GUI names of the shaders.Both of these lists will have the same number of elements. The strings at position i in the lists refer to the same shader type. In cases where there is no localized version of the shader name, the internal name will be used in ShaderTypeNamesLocalized, thus ensuring consistency between the two lists.It also provides a generic shader creation method that uses the shader type name, internal or localized, to create the new shader instance.The destruction of shaders is achieved by calling the FBDelete method of a shader instance.The list of all the instantiated shaders can be obtained from instances of classes FBSystem or FBScene. Both classes have a Shaders property which lists the existing shader instances.Strings are used instead of enum, define or typedef values to refer to shader types as this proves to be more flexible.The system has a default shader of type 'Lighted'. Do not attempt to destroy it.The use of localized names in shader creation is non portable as it is dependent of the current language used by the application. The name may also change from one version to another. Using the internal name is the only way to ensure portable shader creation.Sample C++ code:
In the previous code sample, the lookup in the manager list is not necessary, as the call to CreateShader would have failed nonetheless and returned a NULL pointer.Sample Python code:
FBShaderManager | ( | ) |
Constructor.
Creates a shader according to the shader type provided.
This method provides a generic way of creating shaders using the type name, internal or localized. The name of the new shader will be the same as the type name used, subject to changes according to the system's unique name policy.
pShaderTypeName | Name of the type of shader desired. |
FBStringList ShaderTypeNames |
List of available shaders.
FBStringList ShaderTypeNamesLocalized |
List of available shaders.