• Advertisement

3D D3D9 VertexBlending on HW_PROCESSING

Recommended Posts

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);

 

Edited by KellerHaus

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Advertisement