Context3D的setProgramConstantsFromMatrix使用时需注意的事项

setProgramConstantsFromMatrix()

public function setProgramConstantsFromMatrix(programType:String, firstRegister:int, matrix:Matrix3D, transposedMatrix:Boolean = false):void

Sets constants for use by shader programs using values stored in a Matrix3D.

Use this function to pass a matrix to a shader program. The function sets 4 constant registers used by the vertex or fragment program. The matrix is assigned to registers row by row. The first constant register is assigned the top row of the matrix. You can set 128 registers for a vertex program and 28 for a fragment program.

Parameters

  programType:String — The type of shader program, either Context3DProgramType.VERTEX or Context3DProgramType.FRAGMENT.
 
  firstRegister:int — the index of the first constant register to set. Since a Matrix3D has 16 values, four registers are set.
 
  matrix:Matrix3D — the matrix containing the constant values.
 
  transposedMatrix:Boolean (default = false) — if true the matrix entries are copied to registers in transposed order. The default value is false.

posted @ 2013-06-28 23:58  斯玛特琦  阅读(434)  评论(0编辑  收藏  举报