|
|
@@ -1,4 +1,11 @@
|
|
|
#ifdef COMPILEVS
|
|
|
+float3x3 GetCameraRot()
|
|
|
+{
|
|
|
+ return float3x3(cViewInv[0][0], cViewInv[0][1], cViewInv[0][2],
|
|
|
+ cViewInv[1][0], cViewInv[1][1], cViewInv[1][2],
|
|
|
+ cViewInv[2][0], cViewInv[2][1], cViewInv[2][2]);
|
|
|
+}
|
|
|
+
|
|
|
float4 GetScreenPos(float4 clipPos)
|
|
|
{
|
|
|
return float4(
|
|
|
@@ -36,7 +43,7 @@ float3 GetFarRay(float4 clipPos)
|
|
|
clipPos.y / clipPos.w * cFrustumSize.y,
|
|
|
cFrustumSize.z);
|
|
|
|
|
|
- return mul(viewRay, cCameraRot);
|
|
|
+ return mul(viewRay, GetCameraRot());
|
|
|
}
|
|
|
|
|
|
float3 GetNearRay(float4 clipPos)
|
|
|
@@ -46,6 +53,6 @@ float3 GetNearRay(float4 clipPos)
|
|
|
clipPos.y / clipPos.w * cFrustumSize.y,
|
|
|
0.0);
|
|
|
|
|
|
- return mul(viewRay, cCameraRot) * cDepthMode.z;
|
|
|
+ return mul(viewRay, GetCameraRot()) * cDepthMode.z;
|
|
|
}
|
|
|
#endif
|