本文整理汇总了C#中Function.ResolveLocalParameter方法的典型用法代码示例。如果您正苦于以下问题:C# Function.ResolveLocalParameter方法的具体用法?C# Function.ResolveLocalParameter怎么用?C# Function.ResolveLocalParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Function
的用法示例。
在下文中一共展示了Function.ResolveLocalParameter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddPSFunctionInvocations
private bool AddPSFunctionInvocations( TextureUnitParams textureUnitParams, Function psMain,
ref int internalCounter )
{
LayerBlendModeEx colorBlend = textureUnitParams.TextureUnitState.ColorBlendMode;
LayerBlendModeEx alphaBlend = textureUnitParams.TextureUnitState.AlphaBlendMode;
Parameter source1;
Parameter source2;
var groupOrder = (int)FFPRenderState.FFPFragmentShaderStage.PSTexturing;
//Add texture sampling code
Parameter texel = psMain.ResolveLocalParameter( Parameter.SemanticType.Unknown, 0,
"texel_" + textureUnitParams.TextureSamplerIndex.ToString(),
GpuProgramParameters.GpuConstantType.Float4 );
AddPSSampleTexelInvocation( textureUnitParams, psMain, texel, groupOrder, ref internalCounter );
//Build color argument for source1
source1 = psMain.ResolveLocalParameter( Parameter.SemanticType.Unknown, 0, "source1",
GpuProgramParameters.GpuConstantType.Float4 );
AddPSArgumentInvocations( psMain, source1, texel, textureUnitParams.TextureSamplerIndex, colorBlend.source1,
colorBlend.colorArg1, colorBlend.alphaArg1, false, groupOrder, ref internalCounter );
//build color argument for source2
source2 = psMain.ResolveLocalParameter( Parameter.SemanticType.Unknown, 0, "source2",
GpuProgramParameters.GpuConstantType.Float4 );
AddPSArgumentInvocations( psMain, source2, texel, textureUnitParams.TextureSamplerIndex, colorBlend.source2,
colorBlend.colorArg2, colorBlend.alphaArg2, false, groupOrder, ref internalCounter );
bool needDifferentAlphaBlend = false;
if ( alphaBlend.operation != colorBlend.operation ||
alphaBlend.source1 != colorBlend.source1 ||
alphaBlend.source2 != colorBlend.source2 ||
colorBlend.source1 == LayerBlendSource.Manual ||
colorBlend.source2 == LayerBlendSource.Manual ||
alphaBlend.source1 == LayerBlendSource.Manual ||
alphaBlend.source2 == LayerBlendSource.Manual )
{
needDifferentAlphaBlend = true;
}
//Build colors blend
AddPSBlendInvocations( psMain, source1, source2, texel, textureUnitParams.TextureSamplerIndex, colorBlend,
groupOrder, ref internalCounter,
needDifferentAlphaBlend
? (int)( Operand.OpMask.X | Operand.OpMask.Y | Operand.OpMask.Z )
: (int)( Operand.OpMask.All ) );
//Case we need different alpha channel code
if ( needDifferentAlphaBlend )
{
//build alpha argument for source1
AddPSArgumentInvocations( psMain, source1, texel, textureUnitParams.TextureSamplerIndex,
alphaBlend.source1, alphaBlend.colorArg1, alphaBlend.alphaArg1, true,
groupOrder, ref internalCounter );
//Build alpha argument for source2
AddPSArgumentInvocations( psMain, source2, texel, textureUnitParams.TextureSamplerIndex,
alphaBlend.source2, alphaBlend.colorArg2, alphaBlend.alphaArg2, true,
groupOrder, ref internalCounter );
//Build alpha blend
AddPSBlendInvocations( psMain, source1, source2, texel, textureUnitParams.TextureSamplerIndex,
alphaBlend, groupOrder, ref internalCounter, (int)Operand.OpMask.W );
}
return true;
}