本文整理汇总了C#中Axiom.Graphics.GpuProgramParameters.GetFloatConstantList方法的典型用法代码示例。如果您正苦于以下问题:C# GpuProgramParameters.GetFloatConstantList方法的具体用法?C# GpuProgramParameters.GetFloatConstantList怎么用?C# GpuProgramParameters.GetFloatConstantList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Axiom.Graphics.GpuProgramParameters
的用法示例。
在下文中一共展示了GpuProgramParameters.GetFloatConstantList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BindProgramParameters
public override void BindProgramParameters( GpuProgramParameters parms, GpuProgramParameters.GpuParamVariability mask )
{
var type = programType;
// only supports float constants
var floatStruct = parms.FloatLogicalBufferStruct;
foreach ( var i in floatStruct.Map )
{
if ( ( i.Value.Variability & mask ) != 0 )
{
var logicalIndex = i.Key;
var pFloat = parms.GetFloatConstantList();
var ptr = i.Value.PhysicalIndex;
{
for ( var j = 0; j < i.Value.CurrentSize; j += 4 )
{
var x = pFloat[ ptr + j ];
var y = pFloat[ ptr + j + 1 ];
var z = pFloat[ ptr + j + 2 ];
var w = pFloat[ ptr + j + 3 ];
Gl.glProgramLocalParameter4fARB( type, logicalIndex, x, y, z, w );
++logicalIndex;
}
}
}
}
}
示例2: BindProgramParameters
public override void BindProgramParameters( GpuProgramParameters parms, GpuProgramParameters.GpuParamVariability mask )
{
// Register combiners uses 2 constants per texture stage (0 and 1)
// We have stored these as (stage * 2) + const_index in the physical buffer
// There are no other parameters in a register combiners shader
var floatList = parms.GetFloatConstantList();
var index = 0;
for ( var i = 0; i < floatList.Length; ++i, ++index )
{
var combinerStage = Gl.GL_COMBINER0_NV + ( index/2 );
var pname = Gl.GL_CONSTANT_COLOR0_NV + ( index%2 );
Gl.glCombinerStageParameterfvNV( combinerStage, pname, ref floatList[ i ] );
}
}