add uCameraNormal
This commit is contained in:
parent
08f41596be
commit
7c2b228c46
4 changed files with 15 additions and 0 deletions
|
|
@ -40,6 +40,8 @@ struct HWViewpointUniforms
|
|||
|
||||
int mLightTilesWidth = 0;
|
||||
|
||||
FVector3 mCameraNormal;
|
||||
|
||||
void CalcDependencies()
|
||||
{
|
||||
mNormalViewMatrix.computeNormalMatrix(mViewMatrix);
|
||||
|
|
|
|||
|
|
@ -710,6 +710,13 @@ struct TVector3
|
|||
*this = *this ^ other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
// returns a version with swapped Z/Y
|
||||
constexpr const TVector3 ToXZY() const
|
||||
{
|
||||
return {X, Z, Y};
|
||||
}
|
||||
};
|
||||
|
||||
template<class vec_t>
|
||||
|
|
|
|||
|
|
@ -356,6 +356,10 @@ void HWDrawInfo::SetViewMatrix(const FRotator &angles, float vx, float vy, float
|
|||
VPUniforms.mViewMatrix.rotate(angles.Yaw.Degrees(), 0.0f, mult, 0.0f);
|
||||
VPUniforms.mViewMatrix.translate(vx * mult, -vz * planemult, -vy);
|
||||
VPUniforms.mViewMatrix.scale(-mult, planemult, 1);
|
||||
|
||||
FRotator unfuckedAngles(angles.Pitch, FAngle::fromDeg(90 - angles.Yaw.Degrees()), angles.Roll);
|
||||
|
||||
VPUniforms.mCameraNormal = FVector3(unfuckedAngles).ToXZY();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ layout(set = 1, binding = 0, std140) uniform readonly ViewpointUBO
|
|||
float uClipHeightDirection;
|
||||
|
||||
int uLightTilesWidth; // Levelmesh light tiles
|
||||
|
||||
vec3 uCameraNormal;
|
||||
};
|
||||
|
||||
layout(set = 1, binding = 1, std140) uniform readonly MatricesUBO
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue