KindDragon wrote:
I see 2 solutions:
- Modify source vertex buffer when render to right viewport
- Emulate RHW using vertex shader or fixed pipeline
Thanks, I've tried your first solution with follow steps:
1 get the FVF from the desc of the current g_pVb, and see
if( (FVF & D3DFVF_XYZRHW ) == 0x04 ) // using D3DFVF_XYZRHW;
if true, create another vertext buffer g_pNewVb with the g_pVb data, now the g_pNewVb pointer's data is the same as the g_pVb's
here it works well, but the next step:
2 change the g_pNewVb's data, cause it uses D3DFVF_XYZRHW, so I must modify the x-coordinate data, but the problem is:
I can not know which data I should get and change. I mean:
g_pVb->Lock(0, 0, (VOID**) &(vtdata), 0);
g_pNewVb >Lock(0, 0, (VOID**) &(newpbv), 0);
memcpy(newpbv, vtdata, desc.Size); // here copy the g_pVb buffer's data to the g_pNewVb
the next I've no idea how to change the x-coordinate. The newpbv pointer contains all the vertex information but I don't know which one is the x-coordinate. Any suggestion for me?
With your second solution, I'm sorry that I cann't catch you exactly, would you please introduce more details for me?
Anyway, thank for your suggestion KindDragon!!