• Advertisement
Sign in to follow this  

Extracting View*Projection

This topic is 2910 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to convert View*Projection back to View or Projection?, like seperate them ?

Share this post


Link to post
Share on other sites
Advertisement
You need more information that just View*Projection. For example if you know the projection matrix too you could multiply by its inverse (as long as it is invertible) to get the view matrix.

Share this post


Link to post
Share on other sites
Its getting it from the shader
npDevice->GetVertexShaderConstantF(5,ViewTimesProj,4); //view*proj
it's like that in the constant table

Name=[cViewProj]
RegisterSet=[D3DXRS_FLOAT4]
RegisterIndex=[8]
RegisterCount=[4]
Class=[D3DXPC_MATRIX_COLUMNS]
Type=[D3DXPT_FLOAT]
Rows=[4]
Columns=[4]
Elemets=[1]
StructMembers=[0]
Bytes=[64]
DefaultValue=[0x0]
StartRegister=[5]
END

because the shader sets the matrices you can't do
npDevice->GetTransform(D3DTS_PROJECTION,&Projection); etc....

Share this post


Link to post
Share on other sites
Not really - it may be possible, but it'll involve a significant amount of work to get, so much so that it's likely to exceed your instruction limit.

Just pass in the view and projection matrices separately and multiply them in the shader (Or, pass in the premultiplied matrix as well).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement