Follow up of this thread. @MonsterNice showed a working stereoscopic movie render queue render, but didn’t posted the solutions. I’m not very good at C++, so starting this thread to share my workaround to get stereoscopic panorama working. Hopefully it can help someone, and maybe figure out better solutions!
I’ll first share my working workaround, and then the steps, attempts and possible improvements afterwards.
Workaround
The CPP files for panorama rendering is in Engine/Plugins/MovieScene/MoviePipelineMaskRenderPass
, with an extra header file in the main MovieRenderPipeline plugin.
Basically utilizing the existed but unfinished stereo features in MoviePipelinePanoramicPass.cpp
and the respective header file, exposing the settings, and override the eye index interger. This way I can simply render 2 times to get the panorama of both eyes, then combine it afterwards.
In the header:
Add a new variable EyeIndex
after the line bool bStereo;
, and expose it to MRQ panel
/**
* -1=Disabled, 0=Left eye, 1=Right eye. Use this instead of stereo rendering!
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Panoramic Settings")
int32 EyeIndex;
In CPP:
Set the default value to -1 on top of the file
UMoviePipelinePanoramicPass::UMoviePipelinePanoramicPass()
: UMoviePipelineImagePassBase()
, NumHorizontalSteps(8)
, NumVerticalSteps(3)
, bFollowCameraOrientation(true)
, bStereo(false)
, EyeIndex(-1) // Here is our variable!!!
, EyeSeparation(6.5f)
, EyeConvergenceDistance(EyeSeparation * 30.f)
, bAllocateHistoryPerPane(false)
, bPageToSystemMemory(false)
, bHasWarnedSettings(false)
Find the line
int32 StereoIndex = bStereo ? EyeLoopIndex : -1;
Override the variable it with EyeIndex
variable we created in header
int32 StereoIndex = bStereo ? EyeLoopIndex : -1;
int32 StereoIndex = EyeIndex; // Override with EyeIndex
Pane.Data.EyeIndex = StereoIndex;
Optionally disable stereo FOV values in function GetFieldOfView
, for some reason Epic’s dev locked it at a low value and doesn’t allow overriding. This doesn’t really matter to the workaround.
void UMoviePipelinePanoramicPass::GetFieldOfView(float& OutHorizontal, float& OutVertical, const bool bInStereo) const
{
// ToDo: These should probably be mathematically derived based on numSteps
// Allows manual override for FOV when using stereo
OutHorizontal = HorzFieldOfView > 0 ? HorzFieldOfView : 90.f;
OutVertical = VertFieldOfView > 0 ? VertFieldOfView : 90.f;
}
Then recompile the plugin Compiling a plugin for a new engine version | Community tutorial
Workaround result:
With the newly exposed Eye Index setting, we can now render with left/right eye. Set this to -1 to render neutrally without offset, 0 to render as right eye, 1 to render as left eye. Combine 2 afterwards in post.
Do note that with left/right eye offset, you will need more steps especially horizontal to have less ghosting effects.
Fix attempts and info:
Ideally stereoscopic rendering should produce 1 clean output with left, right eye stacked vertically, and should be driven by bStereo
variable.
In MoviePipelinePanoramicPass.h
, exposing bStereo
allows us to use the unfinished stereo rendering features. Without tweaking the code the renders will look something like this:
This is partially because in CPP devs locked stereo FOVs to a fixed value, so the individual panes doesn’t cover the entire image.
By tweaking the FOV function to allow manual FOV override for stereo and increases horizontal/vertical slices, I’ve managed to get the following render:
But I cannot get it to fill up the bottom side, also producing the ghosting effect. Ghosting is the result of blending both left and right eye’s image into one, and MRQ probably only rendered 1 eye worth of panes, which results in the missing half.
I’ll post updates if I figure out more info..