Jump to content
  • Advertisement
Sign in to follow this  
Anddos

Extracting View*Projection

This topic is 3118 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!