Graphics Reference
In-Depth Information
SetTriangleCount(dr.data[0]);
SetShaderComplexity(dr.data[1]);
#endif
//Get the projection & view matrix from the camera class
mWorld = *g_Camera.GetWorldMatrix();
mProj = *g_Camera.GetProjMatrix();
mView = *g_Camera.GetViewMatrix();
mWorldViewProjection = g_mCenterWorld * mWorld * mView * mProj;
g_Skybox.Render(&mWorldViewProjection);
//Update the effect's variables. Instead of using strings, it would
//be more efficient to cache a handle to the parameter by calling
//ID3DXEffect::GetParameterByName
V(g_pEffect->SetMatrix(“g_mWorldViewProjection”,
&mWorldViewProjection));
V(g_pEffect->SetMatrix(“g_mWorld”, &mWorld));
V(g_pEffect->SetMatrix(“g_mWorldI”, &mWorldI));
V(g_pEffect->SetMatrix(“g_mView”, &mView));
V(g_pEffect->SetMatrix(“g_mProj”, &mProj));
V(g_pEffect->SetFloat(“g_fTime”, (float)fTime));
V(g_pEffect->SetFloat(“g_fModelReflectivity”,
g_fModelReflectivity));
if(g_bUseHWNPatches)
{
float fNumSegs;
fNumSegs = (float)g_dwNumSegs;
pd3dDevice->SetNPatchMode(fNumSegs);
}
UINT cPasses;
switch (g_CurrentTechnique)
{
case 0:
g_pEffect->SetTechnique(g_pCurTechnique->XRay);
break;
case 1:
g_pEffect->SetTechnique(g_pCurTechnique->SimpleLighting);
break;
case 2:
g_pEffect->SetTechnique(g_pCurTechnique->SpecularLighting);
break;
case 3:
g_pEffect->SetTechnique(g_pCurTechnique->ToonEffect);
break;
case 4:
g_pEffect->SetTechnique(g_pCurTechnique->Reflect);
break;
case 5:
g_pEffect->SetTechnique(g_pCurTechnique->ReflectSpecular);
break;
}
g_pEffect->SetTexture(“g_tCube”, g_Skybox.GetEnvironmentMap());
Search WWH ::




Custom Search