mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-14 13:14:50 +08:00
Spot lights geometry improvement, LodLights cone angles and game crash fixes
This commit is contained in:
@@ -49,9 +49,9 @@ VS_Output main(float4 ipos : POSITION, uint iid : SV_InstanceID)
|
||||
else if (InstType == 2)//spot (cone)
|
||||
{
|
||||
float arads = InstConeOuterAngle;
|
||||
float3 cpos = ipos.xyz * (tan(arads) * extent);
|
||||
cpos.y += ipos.w * extent;
|
||||
opos = (cpos.x * InstTangentX) + (cpos.y * InstDirection) + (cpos.z * InstTangentY);
|
||||
float3 tpos = (ipos.xyz * sin(arads)) + float3(0, 0, ipos.w * cos(arads));
|
||||
float3 cpos = ((ipos.w > 0) ? normalize(tpos) : tpos) * extent;
|
||||
opos = (cpos.x * InstTangentX) + (cpos.y * InstTangentY) + (cpos.z * InstDirection);
|
||||
}
|
||||
else if (InstType == 4)//capsule
|
||||
{
|
||||
|
||||
@@ -47,9 +47,9 @@ VS_Output main(float4 ipos : POSITION, uint iid : SV_InstanceID)
|
||||
else if (LightType == 2)//spot (cone)
|
||||
{
|
||||
float arads = lodlight.OuterAngleOrCapExt;
|
||||
float3 cpos = ipos.xyz * (tan(arads) * extent);
|
||||
cpos.y += ipos.w * extent;
|
||||
opos = (cpos.x * lodlight.TangentX.xyz) + (cpos.y * lodlight.Direction.xyz) + (cpos.z * lodlight.TangentY.xyz);
|
||||
float3 tpos = (ipos.xyz * sin(arads)) + float3(0, 0, ipos.w * cos(arads));
|
||||
float3 cpos = ((ipos.w>0) ? normalize(tpos) : tpos) * extent;
|
||||
opos = (cpos.x * lodlight.TangentX.xyz) + (cpos.y * lodlight.TangentY.xyz) + (cpos.z * lodlight.Direction.xyz);
|
||||
}
|
||||
else if (LightType == 4)//capsule
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user