Sign in to follow this  
Anddos

Extracting View*Projection

Recommended Posts

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

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

Sign in to follow this