Sign in to follow this  

Light Shaft Help(Solved)

This topic is 3301 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

Im a little confused at how to transform light frustum from light space to view space In mitchell_lightshafts's paper, they use // Transformation from light space to view space D3DXMatrixInverse (&matFrustumWorld, NULL, &m_matLightView); D3DXMatrixMultiply (&matFrustumWorldView, &matFrustumWorld, g_matWorldView); But it dosen't make scense in my situation... Here is what i did. D3DXVECTOR3 kSource(200.0f, 200.0f, 200.0f); D3DXVECTOR3 kTarget(0.0f, 0.0f, 0.0f); D3DXVECTOR3 kDUp(0.0f, 0.0f, 1.0f); D3DXMATRIX mLightView; D3DXMatrixLookAtLH (&mLightView, &kSource, &kTarget, &kDUp); // Transformation from light space to view space D3DXMATRIX matFrustumWorld; D3DXMatrixInverse (&matFrustumWorld, NULL, &matLightView); D3DXMatrixMultiply (&matFrustumWorldView, &matFrustumWorld, &mView); Any info would be great helpful. [Edited by - wmonash on December 3, 2008 9:37:52 AM]

Share this post


Link to post
Share on other sites
Why do you have a "lightView" and a "lightWorld" matrix? You only need one, since a view matrix is just the inverse of the world matrix. This is why the code from the paper merely takes the inverse of the of LightView matrix to get the world matrix. You should be able to do the same.

Share this post


Link to post
Share on other sites
Quote:
Original post by MJP
Why do you have a "lightView" and a "lightWorld" matrix? You only need one, since a view matrix is just the inverse of the world matrix. This is why the code from the paper merely takes the inverse of the of LightView matrix to get the world matrix. You should be able to do the same.


Thx MJP, you are right!

Share this post


Link to post
Share on other sites

This topic is 3301 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.

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