Packagecom.yogurt3d.core.materials.shaders.base
Classpublic class Shader
InheritanceShader Inheritance Object
Subclasses ShaderAmbient, ShaderDiffuse, ShaderEnvMapping, ShaderEnvMapReflectivityMap, ShaderHitObject, ShaderHitTriangle, ShaderNormalsDebug, ShaderShadow, ShaderSolidFill, ShaderSpecular, ShaderTexture

This class represents a shader pass. You can extend this class and create your own shaders.



Public Properties
 PropertyDefined By
  key : String
Key string of a shader.
Shader
  params : ShaderParameters
Returns the shader parameters.
Shader
  requiresBoneData : Boolean
Flag indicating the shader requires bone indices and bone weights for selected mesh.\n BoneIndices are loaded into va4 and va5 on the gpu program, total of 8 influences.\n BoneWeights are loaded into va6 and va7 on the gpu program, total of 8 influences.\n If flag is set to false, no vertex attributes are loaded on 4,5,6,7\n
Shader
  requiresLight : Boolean
Shader
  requiresShadowCastingLight : Boolean
Shader
  requiresTangents : Boolean
Flag indicating the shader requires bone indices and bone weights for selected mesh.\n BoneIndices are loaded into va4 and va5 on the gpu program, total of 8 influences.\n
Shader
Public Methods
 MethodDefined By
  
Constructor of the shader class.
Shader
  
Shader
  
getFragmentProgram(_lightType:String):ByteArray
Shader
  
getProgram(_context3D:Context3D, _lightType:String, _meshKey:String):Program3D
Returns the Program3D object for this shader.
Shader
  
getVertexProgram(_meshKey:String):ByteArray
Shader
Property Detail
keyproperty
key:String

Key string of a shader. This key is used to cache Program3D objects, when the same shader is used several times. This key must be unique for every shader program you write. So this means if the AGAL changes you must change the key accordingly.


Implementation
    public function get key():String
    public function set key(value:String):void
paramsproperty 
params:ShaderParameters

Returns the shader parameters.


Implementation
    public function get params():ShaderParameters
    public function set params(value:ShaderParameters):void

See also

com.yogurt3d.core.materials.shaders.ShaderParameters
requiresBoneDataproperty 
requiresBoneData:Boolean

Flag indicating the shader requires bone indices and bone weights for selected mesh.\n BoneIndices are loaded into va4 and va5 on the gpu program, total of 8 influences.\n BoneWeights are loaded into va6 and va7 on the gpu program, total of 8 influences.\n If flag is set to false, no vertex attributes are loaded on 4,5,6,7\n


Implementation
    public function get requiresBoneData():Boolean
    public function set requiresBoneData(value:Boolean):void
requiresLightproperty 
requiresLight:Boolean


Implementation
    public function get requiresLight():Boolean
    public function set requiresLight(value:Boolean):void
requiresShadowCastingLightproperty 
requiresShadowCastingLight:Boolean


Implementation
    public function get requiresShadowCastingLight():Boolean
    public function set requiresShadowCastingLight(value:Boolean):void
requiresTangentsproperty 
requiresTangents:Boolean

Flag indicating the shader requires bone indices and bone weights for selected mesh.\n BoneIndices are loaded into va4 and va5 on the gpu program, total of 8 influences.\n


Implementation
    public function get requiresTangents():Boolean
    public function set requiresTangents(value:Boolean):void
Constructor Detail
Shader()Constructor
public function Shader()

Constructor of the shader class. You must call this constructor using super() from your own class that extends Shader.

Method Detail
disposeShaders()method
public function disposeShaders():void

getFragmentProgram()method 
public function getFragmentProgram(_lightType:String):ByteArray

Parameters

_lightType:String

Returns
ByteArray
getProgram()method 
public function getProgram(_context3D:Context3D, _lightType:String, _meshKey:String):Program3D

Returns the Program3D object for this shader. \n This function uses it's parameters to determine to fetch the appropiate Program3D object.\n

Parameters

_context3D:Context3D
 
_lightType:String
 
_meshKey:String

Returns
Program3D
getVertexProgram()method 
public function getVertexProgram(_meshKey:String):ByteArray

Parameters

_meshKey:String

Returns
ByteArray