Can't rotate a USceneCaptureComponentCube for Rendering

Hey All,

I’m attempting to use a modified USceneCaptureComponentCube to create quick 360 monoscopic renders with post processing, which works fine, but for some reason I can’t change rotation of the 360 capture to choose a specific direction to be in the center of the render. Rotating the component or the actor does nothing, and I’m wondering if always renders from a set rotation. Any one have any ideas? I’d rather not manually remake the bit array of the rendered image if I don’t have to.

Came up with an alternate solution. I can just modify the order of the FColor data array that is pulled from the CaptureCube render data to fake rotation. Worked like a charm.

I needed to do this and came up with another solution, and thought i would post it here.

If you are building UE4 from source, a small edit to
\Engine\Source\Runtime\Renderer\Private\SceneCaptureRendering.cpp

void FScene::UpdateSceneCaptureContents(USceneCaptureComponentCube* CaptureComponent)

can change USceneCaptureComponentCube to use the orientation of the component.

just change (line ~818)

const FMatrix ViewRotationMatrix = FLocal::CalcCubeFaceTransform(TargetFace);

to

FTransform Transform = CaptureComponent->GetComponentToWorld();
Transform.SetTranslation(FVector::ZeroVector);
Transform.SetScale3D(FVector::OneVector);
const FMatrix ViewRotationMatrix = Transform.ToInverseMatrixWithScale() * Local::CalcCubeFaceTransform(TargetFace);

its kind of a hack, but it works

note that you have to be building from source (ie. github) or changes you make to ue4 source won’t be compiled