Advertisement

D3D9 VertexBlending on HW_PROCESSING

Started by September 07, 2017 05:38 PM
0 comments, last by KellerHaus 7 years, 5 months ago

Hi guys,

Microsoft decreased perfomance of software processing and its problem for my project. This change is from (win10 1607)
Im using vertex blending for bone animation but my device does not support index matrices (MaxVertexBlendMatrixIndex = 0) so I use for it SW_PROCCESING.
Is there some way how to make bone animation without SW_PROCESSING ?

 

 

Quote

    pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
    pDevice->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
    pDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_SOLID);
    pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE);
    pDevice->SetRenderState( D3DRS_NORMALIZENORMALS, TRUE);
    pDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE );
    pDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
    
    
    {                
        pD3d->SetTransform( D3DTS_WORLDMATRIX(0), &pBone[0]);
        for( int i=0; i<pAni->GetNodeCount(); i++)
            pD3d->SetTransform( D3DTS_WORLDMATRIX(i + 1), pBone[i + 1]);
    }
    
    
    pD3d->SetRenderState( D3DRS_VERTEXBLEND, D3DVBF_3WEIGHTS);
    pD3d->SetFVF(T3DFVF_LMESHVERTEX);
    
    
    
    pD3d->SetStreamSource( 0, pVB, 0, sizeof(LMESHVERTEX));
    pD3d->SetIndices(pIB);
    
    pD3d->SetRenderState( D3DRS_INDEXEDVERTEXBLENDENABLE, TRUE);
            pD3d->DrawIndexedPrimitive(
                D3DPT_TRIANGLELIST,
                dwBaseVectorIndex, 0,
                dwNumVerctor,
                dwStartVertorIndex,
                pMesh->dwCount / 3);
            
    pD3d->SetRenderState( D3DRS_INDEXEDVERTEXBLENDENABLE, FALSE);
    
    pD3d->SetRenderState( D3DRS_VERTEXBLEND, D3DVBF_DISABLE);
    pD3d->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
    pD3d->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
    pD3d->SetRenderState( D3DRS_BLENDOP, D3DBLENDOP_ADD);
    pD3d->SetRenderState( D3DRS_ALPHATESTENABLE, FALSE);
    pD3d->SetRenderState( D3DRS_ALPHAREF, 0x00000000);
    pD3d->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW);
    pD3d->SetRenderState( D3DRS_ZWRITEENABLE, TRUE);
    pD3d->SetRenderState( D3DRS_ZENABLE, TRUE);

 

This topic is closed to new replies.

Advertisement