本文整理汇总了C++中VertexShader::SetShaderKey方法的典型用法代码示例。如果您正苦于以下问题:C++ VertexShader::SetShaderKey方法的具体用法?C++ VertexShader::SetShaderKey怎么用?C++ VertexShader::SetShaderKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VertexShader
的用法示例。
在下文中一共展示了VertexShader::SetShaderKey方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PostLink
//----------------------------------------------------------------------------
void StandardESMaterial_AlphaTest::PostLink ()
{
Material::PostLink();
MaterialPass* pass = mTechniques[0]->GetPass(0);
VertexShader* vshader = pass->GetVertexShader();
PixelShader* pshader = pass->GetPixelShader();
vshader->SetBaseRegisters(msVRegisters);
vshader->SetPrograms(msVPrograms);
pshader->SetTextureUnits(msPTextureUnits);
pshader->SetPrograms(msPPrograms);
vshader->SetShaderKey(SKT_STANNDES_ALPHATEST);
pshader->SetShaderKey(SKT_STANNDES_ALPHATEST);
}
示例2: VertexShader
//----------------------------------------------------------------------------
StandardESMaterial_AlphaTest::StandardESMaterial_AlphaTest ()
{
VertexShader* vshader = new0 VertexShader("PX2.StandardESMaterial_AlphaTest",
3, 3, 7, 0, false);
vshader->SetInput(0, "modelPosition", Shader::VT_FLOAT3,
Shader::VS_POSITION);
vshader->SetInput(1, "modelNormal", Shader::VT_FLOAT3,
Shader::VS_NORMAL);
vshader->SetInput(2, "modelTCoord0", Shader::VT_FLOAT2,
Shader::VS_TEXCOORD0);
vshader->SetOutput(0, "clipPosition", Shader::VT_FLOAT4,
Shader::VS_POSITION);
vshader->SetOutput(1, "vertexTCoord0", Shader::VT_FLOAT2,
Shader::VS_TEXCOORD0);
vshader->SetOutput(2, "vertexTCoord1", Shader::VT_FLOAT4,
Shader::VS_TEXCOORD1);
vshader->SetConstant(0, "gPVWMatrix", 4);
vshader->SetConstant(1, "gShineEmissive", 1);
vshader->SetConstant(2, "gShineAmbient", 1);
vshader->SetConstant(3, "gShineDiffuse", 1);
vshader->SetConstant(4, "gLightAmbient", 1);
vshader->SetConstant(5, "gLightDiffuse", 1);
vshader->SetConstant(6, "gLightModelDirection", 1);
vshader->SetBaseRegisters(msVRegisters);
vshader->SetPrograms(msVPrograms);
PixelShader* pshader = new0 PixelShader("PX2.StandardESMaterial_AlphaTest",
2, 1, 0, 1, false);
pshader->SetInput(0, "vertexTCoord0", Shader::VT_FLOAT2,
Shader::VS_TEXCOORD0);
pshader->SetInput(1, "vertexTCoord1", Shader::VT_FLOAT4,
Shader::VS_TEXCOORD1);
pshader->SetOutput(0, "pixelColor", Shader::VT_FLOAT4,
Shader::VS_COLOR0);
pshader->SetSampler(0, "gDiffuseSampler", Shader::ST_2D);
pshader->SetFilter(0, Shader::SF_LINEAR);
pshader->SetCoordinate(0, 0, Shader::SC_CLAMP);
pshader->SetCoordinate(0, 1, Shader::SC_CLAMP);
pshader->SetTextureUnits(msPTextureUnits);
pshader->SetPrograms(msPPrograms);
vshader->SetShaderKey(SKT_STANNDES_ALPHATEST);
pshader->SetShaderKey(SKT_STANNDES_ALPHATEST);
MaterialPass* pass = new0 MaterialPass();
pass->SetVertexShader(vshader);
pass->SetPixelShader(pshader);
pass->SetAlphaProperty(new0 AlphaProperty());
pass->SetCullProperty(new0 CullProperty());
pass->SetDepthProperty(new0 DepthProperty());
pass->SetOffsetProperty(new0 OffsetProperty());
pass->SetStencilProperty(new0 StencilProperty());
pass->SetWireProperty(new0 WireProperty());
pass->GetAlphaProperty()->CompareEnabled = true;
pass->GetAlphaProperty()->Compare = PX2::AlphaProperty::CM_GREATER;
pass->GetAlphaProperty()->Reference = 0.25f;
MaterialTechnique* technique = new0 MaterialTechnique();
technique->InsertPass(pass);
InsertTechnique(technique);
}