port from perforce

This commit is contained in:
2026-04-18 22:31:51 +02:00
commit 8d0ab5b7cc
8409 changed files with 3972376 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
cbuffer cb0 : register (b0)
{
float aspectRatio;
float distanceToCenter;
float dummy2;
float dummy3;
float4x4 modelRotation;
float4 pivot;
}
float4x4 getProjMatrix()
{
float yScale = 2.4142135623730950488016887242097;//cot(fovY/2)
float xScale = yScale / aspectRatio;
float n = 0.1f;
float f = 100.0f;
float4x4 proj =
{
xScale, 0, 0, 0,
0, yScale, 0, 0,
0, 0, f/(f-n), 1,
0, 0, -n*f/(f-n), 0
};
return proj;
}
void main(in float3 pos : POSITION, out float4 result : SV_POSITION, inout float3 normal : NORMAL, inout float4 uv : TEXCOORD)
{
float4 v = float4(pos, 1);
v.xyz -= pivot.xyz;
v = mul(v, modelRotation);
v.z += distanceToCenter;
v = mul(v, getProjMatrix());
result = v;
}