Open liuxd17thu opened 4 months ago
Looks like numbers in the red box is camPos
, but my old StaticLayer.fx still gives out wrong results.
// ffxiv_common.fxh
uniform float3 _camDir < source = "vec_CameraViewDir"; >;
float3 camPos()
{
return float3(matViewProjInv[0][2], matViewProjInv[1][2], matViewProjInv[2][2]) / matViewProjInv[3][2];
}
float3 camDir()
{
return _camDir.xyz;
}
// then replace all FFXIV::camPos by FFXIV::camPos() in StaticLayer
// ...
I'm not sure it is because I am using the wrong camDir
source or the depth related calculations need to be refactored.
EDIT: Anyway now I fixed StaticLayer with some workarounds. new StaticLayer.fx
In Endwalker REST extracts
camPos
andcamDir
as well as projection matrices from "Transform" group. What about these informations in Dawntrail?I guess the float3 at 0x010 offset should be vec_CameraViewDir, but not sure of camera position data.