Fix the cube map directions, hopefully

This commit is contained in:
Magnus Norddahl 2025-02-16 23:20:33 +01:00
commit 48e769b635
2 changed files with 21 additions and 21 deletions

View file

@ -280,23 +280,23 @@ TArray<uint16_t> VkLightprober::GenerateIrradianceMap()
cmdbuffer->bindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, irradianceMap.pipeline.get());
// +x, +y, +z, -x, -y, -z
// +x, -x, +y, -y, +z, -z
FVector3 dir[6] = {
FVector3( 1.0f, 0.0f, 0.0f),
FVector3( 0.0f, 1.0f, 0.0f),
FVector3( 0.0f, 0.0f, 1.0f),
FVector3(-1.0f, 0.0f, 0.0f),
FVector3( 0.0f, 1.0f, 0.0f),
FVector3( 0.0f, -1.0f, 0.0f),
FVector3( 0.0f, 0.0f, 1.0f),
FVector3( 0.0f, 0.0f, -1.0f)
};
FVector3 up[6] = {
FVector3(0.0f, -1.0f, 0.0f),
FVector3(0.0f, -1.0f, 0.0f),
FVector3(0.0f, 0.0f, 1.0f),
FVector3(0.0f, -1.0f, 0.0f),
FVector3(0.0f, -1.0f, 0.0f),
FVector3(0.0f, 0.0f, -1.0f),
FVector3(0.0f, -1.0f, 0.0f),
FVector3(0.0f, -1.0f, 0.0f)
};
@ -422,23 +422,23 @@ TArray<uint16_t> VkLightprober::GeneratePrefilterMap()
cmdbuffer->bindPipeline(VK_PIPELINE_BIND_POINT_COMPUTE, prefilterMap.pipeline.get());
// +x, +y, +z, -x, -y, -z
// +x, -x, +y, -y, +z, -z
FVector3 dir[6] = {
FVector3( 1.0f, 0.0f, 0.0f),
FVector3( 0.0f, 1.0f, 0.0f),
FVector3( 0.0f, 0.0f, 1.0f),
FVector3(-1.0f, 0.0f, 0.0f),
FVector3( 0.0f, 1.0f, 0.0f),
FVector3( 0.0f, -1.0f, 0.0f),
FVector3( 0.0f, 0.0f, 1.0f),
FVector3( 0.0f, 0.0f, -1.0f)
};
FVector3 up[6] = {
FVector3(0.0f, -1.0f, 0.0f),
FVector3(0.0f, -1.0f, 0.0f),
FVector3(0.0f, 0.0f, 1.0f),
FVector3(0.0f, -1.0f, 0.0f),
FVector3(0.0f, -1.0f, 0.0f),
FVector3(0.0f, 0.0f, -1.0f),
FVector3(0.0f, -1.0f, 0.0f),
FVector3(0.0f, -1.0f, 0.0f)
};

View file

@ -1078,25 +1078,25 @@ void R_SetupFrame(FRenderViewpoint& viewPoint, const FViewWindow& viewWindow, AA
cubeside.Yaw = DAngle::fromDeg(0);
cubeside.Pitch = DAngle::fromDeg(0);
break;
case 1: // +Y
cubeside.Yaw = DAngle::fromDeg(90);
cubeside.Pitch = DAngle::fromDeg(0);
break;
case 2: // +Z
cubeside.Yaw = DAngle::fromDeg(0);
cubeside.Pitch = DAngle::fromDeg(90);
break;
case 3: // -X
case 1: // -X
cubeside.Yaw = DAngle::fromDeg(180);
cubeside.Pitch = DAngle::fromDeg(0);
break;
case 4: // -Y
cubeside.Yaw = DAngle::fromDeg(-90);
case 2: // +Y
cubeside.Yaw = DAngle::fromDeg(90);
cubeside.Pitch = DAngle::fromDeg(90);
break;
case 3: // -Y
cubeside.Yaw = DAngle::fromDeg(90);
cubeside.Pitch = DAngle::fromDeg(-90);
break;
case 4: // +Z
cubeside.Yaw = DAngle::fromDeg(90);
cubeside.Pitch = DAngle::fromDeg(0);
break;
case 5: // -Z
cubeside.Yaw = DAngle::fromDeg(0);
cubeside.Pitch = DAngle::fromDeg(-90);
cubeside.Yaw = DAngle::fromDeg(-90);
cubeside.Pitch = DAngle::fromDeg(0);
break;
}
viewPoint.Angles = cubeside;