Torque 3D - Script Manual: CustomMaterial Class Reference

TorqueScript

Main   Class List   Namespace List   Online

CustomMaterial Class Reference
[Materials]

Material object which provides more control over surface properties. More...

Inheritance diagram for CustomMaterial:

List of all members.

Public Attributes

Material fallback
 Alternate material for targeting lower end hardware.
bool forwardLit
 Determines if the material should recieve lights in Basic Lighting. Has no effect in Advanced Lighting.
string shader
 Name of the ShaderData to use for this effect.
GFXStateBlockData stateBlock
 Name of a GFXStateBlockData for this effect.
string target
 String identifier of this material's target texture.
float version
 Specifies pixel shader version for hardware.

Detailed Description

Material object which provides more control over surface properties.

CustomMaterials allow the user to specify their own shaders via the ShaderData datablock. Because CustomMaterials are derived from Materials, they can hold a lot of the same properties. It is up to the user to code how these properties are used.

Example:
singleton CustomMaterial( WaterBasicMat )
{
   sampler["reflectMap"] = "$reflectbuff";
   sampler["refractBuff"] = "$backbuff";

   cubemap = NewLevelSkyCubemap;
   shader = WaterBasicShader;
   stateBlock = WaterBasicStateBlock;
   version = 2.0;
};
See also:
Material, GFXStateBlockData, ShaderData

Member Data Documentation

Alternate material for targeting lower end hardware.

If the CustomMaterial requires a higher pixel shader version than the one it's using, it's fallback Material will be processed instead. If the fallback material wasn't defined, Torque 3D will assert and attempt to use a very basic material in it's place.

Determines if the material should recieve lights in Basic Lighting. Has no effect in Advanced Lighting.

Name of the ShaderData to use for this effect.

String identifier of this material's target texture.

Specifies pixel shader version for hardware.

Valid pixel shader versions include 2.0, 3.0, etc.

Note:
All features aren't compatible with all pixel shader versions.


Copyright © GarageGames, LLC. All Rights Reserved.