UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FFakeStereoRenderingDevice Class Reference
+ Inheritance diagram for FFakeStereoRenderingDevice:

Public Member Functions

 FFakeStereoRenderingDevice (int ViewportWidth=640, int ViewportHeight=480, int RequestedNumViews=2)
 
virtual ~FFakeStereoRenderingDevice ()
 
virtual bool IsStereoEnabled () const override
 
virtual bool EnableStereo (bool stereo=true) override
 
virtual int32 GetDesiredNumberOfViews (bool bStereoRequested) const
 
virtual EStereoscopicPass GetViewPassForIndex (bool bStereoRequested, int32 ViewIndex) const override
 
virtual void AdjustViewRect (int32 ViewIndex, int32 &X, int32 &Y, uint32 &SizeX, uint32 &SizeY) const override
 
virtual void SetFinalViewRect (class FRHICommandListImmediate &RHICmdList, const int32 ViewIndex, const FIntRect &FinalViewRect) override
 
virtual void CalculateStereoViewOffset (const int32 ViewIndex, FRotator &ViewRotation, const float WorldToMeters, FVector &ViewLocation) override
 
virtual FMatrix GetStereoProjectionMatrix (const int32 ViewIndex) const override
 
virtual void InitCanvasFromView (FSceneView *InView, UCanvas *Canvas) override
 
virtual void RenderTexture_RenderThread (class FRDGBuilder &GraphBuilder, FRDGTextureRef BackBuffer, FRDGTextureRef SrcTexture, FVector2f WindowSize) const
 
virtual IStereoRenderTargetManagerGetRenderTargetManager () override
 
virtual bool ShouldUseSeparateRenderTarget () const
 
virtual void UpdateViewport (bool bUseSeparateRenderTarget, const class FViewport &Viewport, class SViewport *ViewportWidget=nullptr) override
 
virtual bool AllocateRenderTargetTextures (uint32 SizeX, uint32 SizeY, uint8 Format, uint32 NumLayers, ETextureCreateFlags Flags, ETextureCreateFlags TargetableTextureFlags, TArray< FTextureRHIRef > &OutTargetableTextures, TArray< FTextureRHIRef > &OutShaderResourceTextures, uint32 NumSamples=1)
 
virtual void CalculateRenderTargetSize (const class FViewport &Viewport, uint32 &InOutSizeX, uint32 &InOutSizeY)
 
virtual bool NeedReAllocateViewportRenderTarget (const class FViewport &Viewport)
 
- Public Member Functions inherited from IStereoRendering
virtual ~IStereoRendering ()
 
virtual bool IsStereoEnabledOnNextFrame () const
 
virtual uint32 GetLODViewIndex () const
 
virtual bool IsStandaloneStereoOnlyDevice () const
 
virtual FVector2D GetTextSafeRegionBounds () const
 
virtual void RenderTexture_RenderThread (class FRHICommandListImmediate &RHICmdList, class FRHITexture *BackBuffer, class FRHITexture *SrcTexture, FVector2D WindowSize) const final
 
virtual IStereoLayersGetStereoLayers ()
 
virtual void StartFinalPostprocessSettings (struct FPostProcessSettings *StartPostProcessingSettings, const enum EStereoscopicPass StereoPassType, const int32 StereoViewIndex)
 
virtual bool OverrideFinalPostprocessSettings (struct FPostProcessSettings *OverridePostProcessingSettings, const enum EStereoscopicPass StereoPassType, const int32 StereoViewIndex, float &BlendWeight)
 
virtual void EndFinalPostprocessSettings (struct FPostProcessSettings *FinalPostProcessingSettings, const enum EStereoscopicPass StereoPassType, const int32 StereoViewIndex)
 
- Public Member Functions inherited from IStereoRenderTargetManager
virtual bool NeedReAllocateDepthTexture (const TRefCountPtr< struct IPooledRenderTarget > &DepthTarget)
 
virtual bool NeedReAllocateShadingRateTexture (const TRefCountPtr< struct IPooledRenderTarget > &ShadingRateTarget)
 
virtual uint32 GetNumberOfBufferedFrames () const
 
virtual bool AllocateRenderTargetTexture (uint32 Index, uint32 SizeX, uint32 SizeY, uint8 Format, uint32 NumMips, ETextureCreateFlags Flags, ETextureCreateFlags TargetableTextureFlags, FTextureRHIRef &OutTargetableTexture, FTextureRHIRef &OutShaderResourceTexture, uint32 NumSamples=1)
 
virtual EPixelFormat GetActualColorSwapchainFormat () const
 
virtual int32 AcquireColorTexture ()
 
virtual int32 AcquireDepthTexture ()
 
virtual bool AllocateDepthTexture (uint32 Index, uint32 SizeX, uint32 SizeY, uint8 Format, uint32 NumMips, ETextureCreateFlags Flags, ETextureCreateFlags TargetableTextureFlags, FTextureRHIRef &OutTargetableTexture, FTextureRHIRef &OutShaderResourceTexture, uint32 NumSamples=1)
 
virtual bool AllocateShadingRateTexture (uint32 Index, uint32 RenderSizeX, uint32 RenderSizeY, uint8 Format, uint32 NumMips, ETextureCreateFlags Flags, ETextureCreateFlags TargetableTextureFlags, FTextureRHIRef &OutTexture, FIntPoint &OutTextureSize)
 
virtual bool HDRGetMetaDataForStereo (EDisplayOutputFormat &OutDisplayOutputFormat, EDisplayColorGamut &OutDisplayColorGamut, bool &OutbHDRSupported)
 
virtual bool ReconfigureForShaderPlatform (EShaderPlatform NewShaderPlatform)
 
virtual bool GetRecommendedMotionVectorTextureSize (FIntPoint &OutTextureSize)
 
virtual bool GetMotionVectorTexture (uint32 Index, const FIntPoint &Size, uint8 Format, uint32 NumMips, ETextureCreateFlags Flags, FTextureRHIRef &OutTexture, uint32 NumSamples=1)
 
virtual bool GetMotionVectorDepthTexture (uint32 Index, const FIntPoint &Size, uint8 Format, uint32 NumMips, ETextureCreateFlags Flags, FTextureRHIRef &OutTexture, uint32 NumSamples=1)
 

Public Attributes

float FOVInDegrees
 
float TopFOVRatio
 
float DifferenceBetweenEyes
 
int32 Width
 
int32 Height
 
int32 NumViews
 
bool bLayeredRTs
 

Additional Inherited Members

- Static Public Member Functions inherited from IStereoRendering
static bool IsStereoEyePass (EStereoscopicPass Pass)
 
static ENGINE_API bool IsStereoEyeView (const FSceneView &View)
 
static bool IsAPrimaryPass (EStereoscopicPass Pass)
 
static ENGINE_API bool IsAPrimaryView (const FSceneView &View)
 
static bool IsASecondaryPass (EStereoscopicPass Pass)
 
static ENGINE_API bool IsASecondaryView (const FSceneView &View)
 
static ENGINE_API bool IsStartInVR ()
 
- Static Public Member Functions inherited from IStereoRenderTargetManager
static EPixelFormat GetStereoLayerPixelFormat ()
 

Detailed Description

A fake stereo rendering device used to test stereo rendering without an attached device.

Constructor & Destructor Documentation

◆ FFakeStereoRenderingDevice()

FFakeStereoRenderingDevice::FFakeStereoRenderingDevice ( int  ViewportWidth = 640,
int  ViewportHeight = 480,
int  RequestedNumViews = 2 
)
inline

◆ ~FFakeStereoRenderingDevice()

virtual FFakeStereoRenderingDevice::~FFakeStereoRenderingDevice ( )
inlinevirtual

Member Function Documentation

◆ AdjustViewRect()

virtual void FFakeStereoRenderingDevice::AdjustViewRect ( int32  ViewIndex,
int32 X,
int32 Y,
uint32 SizeX,
uint32 SizeY 
) const
inlineoverridevirtual

Adjusts the viewport rectangle for stereo, based on which eye pass is being rendered.

Implements IStereoRendering.

◆ AllocateRenderTargetTextures()

virtual bool FFakeStereoRenderingDevice::AllocateRenderTargetTextures ( uint32  SizeX,
uint32  SizeY,
uint8  Format,
uint32  NumLayers,
ETextureCreateFlags  Flags,
ETextureCreateFlags  TargetableTextureFlags,
TArray< FTextureRHIRef > &  OutTargetableTextures,
TArray< FTextureRHIRef > &  OutShaderResourceTextures,
uint32  NumSamples = 1 
)
inlinevirtual

Allocates the render target textures, which includes the color textures and optionally other textures like depth. The default implementation always returns false to indicate that the default texture allocation should be used instead.

Returns
true, if textures were allocated; false, if the default texture allocation should be used.

Reimplemented from IStereoRenderTargetManager.

◆ CalculateRenderTargetSize()

virtual void FFakeStereoRenderingDevice::CalculateRenderTargetSize ( const class FViewport Viewport,
uint32 InOutSizeX,
uint32 InOutSizeY 
)
inlinevirtual

Calculates dimensions of the render target texture for direct rendering of distortion.

Implements IStereoRenderTargetManager.

◆ CalculateStereoViewOffset()

virtual void FFakeStereoRenderingDevice::CalculateStereoViewOffset ( const int32  ViewIndex,
FRotator ViewRotation,
const float  WorldToMeters,
FVector ViewLocation 
)
inlineoverridevirtual

Calculates the offset for the camera position, given the specified position, rotation, and world scale Specifying eSSE_MONOSCOPIC for the view index returns a center offset behind the stereo views

Implements IStereoRendering.

◆ EnableStereo()

virtual bool FFakeStereoRenderingDevice::EnableStereo ( bool  stereo = true)
inlineoverridevirtual

Switches stereo rendering on / off. Returns current state of stereo.

Returns
Returns current state of stereo (true / false).

Implements IStereoRendering.

◆ GetDesiredNumberOfViews()

virtual int32 FFakeStereoRenderingDevice::GetDesiredNumberOfViews ( bool  bStereoRequested) const
inlinevirtual

Returns the desired number of views, so that devices that require additional views can allocate them. Default is two viewports if using stereo rendering.

Reimplemented from IStereoRendering.

◆ GetRenderTargetManager()

virtual IStereoRenderTargetManager * FFakeStereoRenderingDevice::GetRenderTargetManager ( )
inlineoverridevirtual

Returns currently active render target manager.

Reimplemented from IStereoRendering.

◆ GetStereoProjectionMatrix()

virtual FMatrix FFakeStereoRenderingDevice::GetStereoProjectionMatrix ( const int32  ViewIndex) const
inlineoverridevirtual

Gets a projection matrix for the device, given the specified view index Specifying eSSE_MONOSCOPIC for the view index returns a center projection matrix encompassing all views

Implements IStereoRendering.

◆ GetViewPassForIndex()

virtual EStereoscopicPass FFakeStereoRenderingDevice::GetViewPassForIndex ( bool  bStereoRequested,
int32  ViewIndex 
) const
inlineoverridevirtual

For the specified view index in the view family, assign a stereoscopic pass type based on the extension's usage

Reimplemented from IStereoRendering.

◆ InitCanvasFromView()

virtual void FFakeStereoRenderingDevice::InitCanvasFromView ( FSceneView InView,
UCanvas Canvas 
)
inlineoverridevirtual

Sets view-specific params (such as view projection matrix) for the canvas.

Implements IStereoRendering.

◆ IsStereoEnabled()

virtual bool FFakeStereoRenderingDevice::IsStereoEnabled ( ) const
inlineoverridevirtual

Whether or not stereo rendering is on this frame.

Implements IStereoRendering.

◆ NeedReAllocateViewportRenderTarget()

virtual bool FFakeStereoRenderingDevice::NeedReAllocateViewportRenderTarget ( const class FViewport Viewport)
inlinevirtual

Returns true, if render target texture must be re-calculated.

Implements IStereoRenderTargetManager.

◆ RenderTexture_RenderThread()

virtual void FFakeStereoRenderingDevice::RenderTexture_RenderThread ( class FRDGBuilder GraphBuilder,
FRDGTextureRef  BackBuffer,
FRDGTextureRef  SrcTexture,
FVector2f  WindowSize 
) const
inlinevirtual

Reimplemented from IStereoRendering.

◆ SetFinalViewRect()

virtual void FFakeStereoRenderingDevice::SetFinalViewRect ( class FRHICommandListImmediate RHICmdList,
const int32  ViewIndex,
const FIntRect FinalViewRect 
)
inlineoverridevirtual

Provides the final view rect that the renderer will render into.

Reimplemented from IStereoRendering.

◆ ShouldUseSeparateRenderTarget()

virtual bool FFakeStereoRenderingDevice::ShouldUseSeparateRenderTarget ( ) const
inlinevirtual

Whether a separate render target should be used or not. In case the stereo rendering implementation does not require special handling of separate render targets at all, it can leave out implementing this interface completely and simply let the default implementation of IStereoRendering::GetRenderTargetManager() return nullptr.

Implements IStereoRenderTargetManager.

◆ UpdateViewport()

virtual void FFakeStereoRenderingDevice::UpdateViewport ( bool  bUseSeparateRenderTarget,
const class FViewport Viewport,
class SViewport ViewportWidget = nullptr 
)
inlineoverridevirtual

Updates viewport for direct rendering of distortion. Should be called on a game thread.

Parameters
bUseSeparateRenderTargetSet to true if a separate render target will be used. Can potentiallt be true even if ShouldUseSeparateRenderTarget() returned false earlier.
ViewportThe Viewport instance calling this method.
ViewportWidget(optional) The Viewport widget containing the view. Can be used to access SWindow object.

Implements IStereoRenderTargetManager.

Member Data Documentation

◆ bLayeredRTs

bool FFakeStereoRenderingDevice::bLayeredRTs

Whether the rendertargets are layered (like in MMV case) or not (side-by-side).

◆ DifferenceBetweenEyes

float FFakeStereoRenderingDevice::DifferenceBetweenEyes

How dissimilar are the eye frustums. If set to 0, they will be totally symmetric, if set to 1, totally different.

◆ FOVInDegrees

float FFakeStereoRenderingDevice::FOVInDegrees

max(HFOV, VFOV) in degrees of imaginable HMD

◆ Height

int32 FFakeStereoRenderingDevice::Height

◆ NumViews

int32 FFakeStereoRenderingDevice::NumViews

views of imaginable HMD

◆ TopFOVRatio

float FFakeStereoRenderingDevice::TopFOVRatio

Proportion between Top FOV and Bottom FOV

◆ Width

int32 FFakeStereoRenderingDevice::Width

resolution of imaginable HMD (per eye)


The documentation for this class was generated from the following file: