mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-22 15:02:54 +08:00
Fixed light cone angles
This commit is contained in:
parent
9a53c2147b
commit
f22826ea94
@ -50,8 +50,8 @@ VS_Output main(float4 ipos : POSITION, uint iid : SV_InstanceID)
|
|||||||
}
|
}
|
||||||
else if (LightType == 2)//spot (cone)
|
else if (LightType == 2)//spot (cone)
|
||||||
{
|
{
|
||||||
float arads = lodlight.OuterAngleOrCapExt * 0.01745329 * 1.5;//is this right?
|
float arads = lodlight.OuterAngleOrCapExt * 0.01745329 * 0.5; // deg -> rad
|
||||||
float3 cpos = ipos.xyz * (atan(arads) * extent);
|
float3 cpos = ipos.xyz * (tan(arads) * extent);
|
||||||
cpos.y += ipos.w * extent;
|
cpos.y += ipos.w * extent;
|
||||||
opos = (cpos.x * lodlight.TangentX.xyz) + (cpos.y * lodlight.Direction.xyz) + (cpos.z * lodlight.TangentY.xyz);
|
opos = (cpos.x * lodlight.TangentX.xyz) + (cpos.y * lodlight.Direction.xyz) + (cpos.z * lodlight.TangentY.xyz);
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user