Deferred shading - Incorrect lighting !

Started by
11 comments, last by MegaPixel 13 years, 9 months ago
If that can help I create the frustum corners in this way and I pass them into the shader (hope they are correct):

m_position is the camera position in world space.

//update the frustum corners in order for the deferred renderer to reconstruct the world space position	void updateFrustumCornersInfos()	{				D3DXVECTOR3 fc =  m_position + m_viewDir*m_fZFar;	//far plane center pos in world space		D3DXVECTOR3 nc =  m_position + m_viewDir*m_fZNear;	//near plane center pos in world space		float halfWFar = m_fWidthFar*0.5f;		float halfHFar = m_fHeightFar*0.5f;		float halfWNear = m_fWidthNear*0.5f;		float halfHNear = m_fHeightNear*0.5f;		//far plane frustum corners in world space		m_fFrustumCorners[eFC_FTR] = fc + (m_up*halfHFar)+(m_right*halfWFar);			m_fFrustumCorners[eFC_FTL] = fc + (m_up*halfHFar)-(m_right*halfWFar);				m_fFrustumCorners[eFC_FBR] = fc - (m_up*halfHFar)+(m_right*halfWFar);				m_fFrustumCorners[eFC_FBL] = fc - (m_up*halfHFar)-(m_right*halfWFar);				//near plane frustum corners		m_fFrustumCorners[eFC_NTR] = nc + (m_up*halfHNear)+(m_right*halfWNear);			m_fFrustumCorners[eFC_NTL] = nc + (m_up*halfHNear)-(m_right*halfWNear);				m_fFrustumCorners[eFC_NBR] = nc - (m_up*halfHNear)+(m_right*halfWNear);			m_fFrustumCorners[eFC_NBL] = nc - (m_up*halfHNear)-(m_right*halfWNear);			}	
Advertisement
Any Idea ? :((((
Fixed !!!! :D

This topic is closed to new replies.

Advertisement