Packagecom.yogurt3d.core.materials.shaders.base
Classpublic class Shader
InheritanceShader Inheritance Object
Subclasses Filter, ShaderAmbient, ShaderChromatic, ShaderColorTextureFresnel, ShaderContour, ShaderDepth, ShaderDepthMap, ShaderDiffuse, ShaderDiffuseVertex, ShaderEnvMapFresnel, ShaderEnvMapping, ShaderEnvMapReflectivityMap, ShaderHalfLambert, ShaderHemisphere, ShaderHemisphereTexture, ShaderHitObject, ShaderHitTriangle, ShaderNormalsDebug, ShaderParticle, ShaderRefraction, ShaderShadow, ShaderSolidFill, ShaderSpecular, ShaderSpecularVertex, ShaderTexture, ShaderTextureColorFresnel, ShaderToon, ShaderToonTexture, ShaderTwoColorFresnel, ShaderTwoTextureFresnel, ShaderYogurtistan

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



Public Properties
 PropertyDefined By
  attributes : Vector.<EVertexAttribute>
[read-only]
Shader
  key : String
Key string of a shader.
Shader
  params : ShaderParameters
Returns the shader parameters.
Shader
Public Methods
 MethodDefined By
  
Constructor of the shader class.
Shader
  
Shader
  
getFragmentProgram(_lightType:ELightType = null):ByteArray
Shader
  
getProgram(_context3D:Context3D, _lightType:ELightType = null, _meshKey:String):Program3D
Returns the Program3D object for this shader.
Shader
  
getVertexProgram(_meshKey:String, _lightType:ELightType = null):ByteArray
Shader
Property Detail
attributesproperty
attributes:Vector.<EVertexAttribute>  [read-only]


Implementation
    public function get attributes():Vector.<EVertexAttribute>
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
m_attributesproperty 
YOGURT3D_INTERNAL var m_attributes:Vector.<EVertexAttribute>

m_paramsproperty 
YOGURT3D_INTERNAL var m_params:ShaderParameters

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
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:ELightType = null):ByteArray

Parameters

_lightType:ELightType (default = null)

Returns
ByteArray
getProgram()method 
public function getProgram(_context3D:Context3D, _lightType:ELightType = null, _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:ELightType (default = null)
 
_meshKey:String

Returns
Program3D
getVertexProgram()method 
public function getVertexProgram(_meshKey:String, _lightType:ELightType = null):ByteArray

Parameters

_meshKey:String
 
_lightType:ELightType (default = null)

Returns
ByteArray