1 Reply Latest reply on Aug 13, 2012 1:33 PM by kcarney

    AMD fixedFuncShader with a hierarchy in place.

    lucky7456969

      I understood that fixfuncshader is directly transforming vectors from world to clip.

       

      But I now got a hierarchy. How do I define the following variables?

       

      - matView

      - matWorldView

      - matWorldViewIT

      - matViewIT

      - matWorldViewProj

       

      [code]

      virtual void Render()
      {
       
      CObjects::Render();
        g_pEffect
      ->SetTechnique(g_pEffect->GetTechniqueByName("basic_with_shader"));
        D3DXMATRIXA16 compMat
      , invMat;
        g_pEffect
      ->SetMatrixTranspose("matView", &g_Cam[iCurCam].GetViewMatrix());
        D3DXMatrixMultiply
      (&compMat, &m_matWorld, &g_Cam[iCurCam].GetViewMatrix());
        g_pEffect
      ->SetMatrixTranspose("matWorldView", &compMat);
        D3DXMatrixInverse
      (&invMat, NULL, &compMat);
        D3DXMatrixTranspose
      (&invMat, &invMat);
        g_pEffect
      ->SetMatrixTranspose("matWorldViewIT", &invMat);
        D3DXMatrixInverse
      (&invMat, NULL, &g_Cam[iCurCam].GetViewMatrix());
        D3DXMatrixTranspose
      (&invMat, &invMat);
        g_pEffect
      ->SetMatrixTranspose("matViewIT", &invMat);
        D3DXMatrixMultiply
      (&compMat, &compMat, &g_Cam[iCurCam].GetProjMatrix());
        g_pEffect
      ->SetMatrixTranspose("matWorldViewProj", &compMat);
        g_pEffect
      ->SetMatrixTranspose("matProj", &g_Cam[iCurCam].GetProjMatrix());
        m_Mesh
      ->UpdateFrame(NULL, &m_matWorld);
        m_Mesh
      ->RenderTransparent();
      }

      [/code]