Main   Class List   Namespace List   Wiki

ShaderData Class Reference
[Shaders]

Special type of data block that stores information about a handwritten shader. More...

Inheritance diagram for ShaderData:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void reload ()
 Rebuilds all the vertex and pixel shaders instances created from this ShaderData.

Public Attributes

string defines
 A semicolon, tab, or newline delimited string of case sensitive defines that are passed to the shader compiler.
filename DXPixelShaderFile
 Indicates a filename that contains a DirectX pixel shader program.
filename DXVertexShaderFile
 Indicates a filename that contains a DirectX vertex shader program.
filename OGLPixelShaderFile
 Indicates a filename that contains a DirectX pixel shader program.
filename OGLVertexShaderFile
 Indicates a filename that contains an OpenGL vertex shader program.
float pixVersion
 This indicates what target level of shader should be compiled.
bool useDevicePixVersion
 True to use the maximum pixel shader version offered by the graphics card, rather than manually specifying the version in script.

Detailed Description

Special type of data block that stores information about a handwritten shader.

To use hand written shaders, a ShaderData datablock must be used. This datablock refers only to the vertex and pixel shader filenames and a hardware target level. Shaders are API specific, so DirectX and OpenGL shaders must be explicitly identified.

Example:
// Used for the procedural clould system
singleton ShaderData( CloudLayerShader )
{
   DXVertexShaderFile   = "shaders/common/cloudLayerV.hlsl";
   DXPixelShaderFile    = "shaders/common/cloudLayerP.hlsl";
   OGLVertexShaderFile = "shaders/common/gl/cloudLayerV.glsl";
   OGLPixelShaderFile = "shaders/common/gl/cloudLayerP.glsl";
   pixVersion = 2.0;
};

Member Function Documentation

void ShaderData::reload (  ) 

Rebuilds all the vertex and pixel shaders instances created from this ShaderData.

Example:
// Rebuild the shader instances from ShaderData CloudLayerShader
CloudLayerShader.reload();

Member Data Documentation

A semicolon, tab, or newline delimited string of case sensitive defines that are passed to the shader compiler.

Indicates a filename that contains a DirectX pixel shader program.

It must contain only one program and no vertex shader, just the pixel shader. It can be either an HLSL or assembly level shader. The former must have a filename extension of .hlsl, otherwise it assumes it is an assembly file.

Indicates a filename that contains a DirectX vertex shader program.

It must contain only one program and no pixel shader, just the vertex shader.It can be either an HLSL or assembly level shader. The former must have a filename extension of .hlsl, otherwise it assumes it is an assembly file.

Indicates a filename that contains a DirectX pixel shader program.

It must contain only one program and no vertex shader, just the pixel shader.

Indicates a filename that contains an OpenGL vertex shader program.

It must contain only one program and no pixel shader, just the vertex shader.

This indicates what target level of shader should be compiled.

Valid numbers at the time of this writing are 1.1, 1.4, 2.0, and 3.0. The shader will not run properly if your hardware does not support the level of shader you have compiled.

True to use the maximum pixel shader version offered by the graphics card, rather than manually specifying the version in script.



Copyright © GarageGames, LLC. All Rights Reserved.