Jump to content
  • Advertisement
Sign in to follow this  
wmonash

Light Shaft Help(Solved)

This topic is 3515 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
Advertisement
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
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!