Hey, I was wondering how to implement two effects at the same time, using the same shader file. For example, I have g_pEffect, which applies light perfectly. I used the standard loop to achieve this for my BSP-based map:
if (SUCCEEDED(pEffect->SetTechnique(hTechnique)))
{
if (SUCCEEDED(pEffect->Begin(&totalPasses, 0)))
{
for (UINT pass = 0; pass < totalPasses; ++pass)
{
if (SUCCEEDED(pEffect->BeginPass(pass)))
{
pDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST,
m_pFaces[nFace].FirstVert,
0,
m_pFaces[nFace].NumVerts,
m_pFaces[nFace].nFirstMeshVerts,
(m_pFaces[nFace].NumMeshVerts / 3));
pEffect->EndPass();
}
}
pEffect->End();
}
}
Is there a way I can make a separate effect, named g_pEffect2 and put it in the loop as …