本文整理汇总了C++中SubMesh::SetRenderCallBack方法的典型用法代码示例。如果您正苦于以下问题:C++ SubMesh::SetRenderCallBack方法的具体用法?C++ SubMesh::SetRenderCallBack怎么用?C++ SubMesh::SetRenderCallBack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SubMesh
的用法示例。
在下文中一共展示了SubMesh::SetRenderCallBack方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _update
void PS_Mesh::_update(Particle * p)
{
Float3 Position = p->Position;
if (mParent->IsLocalSpace())
Position.TransformA(mParent->GetParent()->GetWorldTM());
mMesh->SetPosition(Position);
mMesh->SetOpacity(p->Color.a);
mMesh->SetRotationEx(p->Rotation);
mMesh->SetScale(p->Size);
mMesh->_updateTM();
int blendMode = mParent->GetBlendMode();
for (int i = 0; i < mMesh->GetSubMeshCount(); ++i)
{
SubMesh * submesh = mMesh->GetSubMesh(i);
Material * mtl = submesh->GetMaterial();
mtl->diffuse = Float3(p->Color.r, p->Color.g, p->Color.b);
if (mParent->_getTexture() != NULL)
{
mtl->maps[eMapType::DIFFUSE] = mParent->_getTexture();
}
if (mParent->GetShaderEnable())
{
mtl->depthMode = eDepthMode::N_LESS_EQUAL;
if (blendMode == PS_BlendMode::ADD)
{
mtl->blendMode = eBlendMode::ADD;
}
else if (blendMode == PS_BlendMode::ALPHA_BLEND)
{
mtl->blendMode = eBlendMode::ALPHA_BLEND;
}
else if (blendMode == PS_BlendMode::COLOR_BLEND)
{
mtl->blendMode = eBlendMode::COLOR_BLEND;
}
else
{
mtl->blendMode = eBlendMode::OPACITY;
mtl->depthMode = eDepthMode::LESS_EQUAL;
}
submesh->SetShaderFX(mParent->_getShaderFX());
submesh->SetRenderCallBack(eRenderCallBack::SHADER, mParent->GetShader().c_ptr());
}
}
}