UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IHeadMountedDisplay Class Referenceabstract

#include <IHeadMountedDisplay.h>

+ Inheritance diagram for IHeadMountedDisplay:

Classes

struct  MonitorInfo
 

Public Member Functions

HEADMOUNTEDDISPLAY_API IHeadMountedDisplay ()
 
virtual bool IsHMDConnected ()=0
 
virtual bool IsHMDEnabled () const =0
 
virtual EHMDWornState::Type GetHMDWornState ()
 
virtual void EnableHMD (bool bEnable=true)=0
 
virtual FName GetHMDName () const =0
 
virtual bool GetHMDMonitorInfo (MonitorInfo &)=0
 
virtual void GetFieldOfView (float &InOutHFOVInDegrees, float &InOutVFOVInDegrees) const =0
 
virtual void SetClippingPlanes (float NCP, float FCP)
 
virtual void GetEyeRenderParams_RenderThread (const struct FHeadMountedDisplayPassContext &Context, FVector2D &EyeToSrcUVScaleValue, FVector2D &EyeToSrcUVOffsetValue) const
 
virtual void SetInterpupillaryDistance (float NewInterpupillaryDistance)=0
 
virtual float GetInterpupillaryDistance () const =0
 
virtual bool GetHMDDistortionEnabled (EShadingPath ShadingPath) const =0
 
virtual bool IsSpectatorScreenActive () const
 
virtual class ISpectatorScreenControllerGetSpectatorScreenController ()
 
virtual class ISpectatorScreenController const * GetSpectatorScreenController () const
 
virtual void CreateHMDPostProcessPass_RenderThread (FRDGBuilder &GraphBuilder, const FSceneView &View, const struct FHMDDistortionInputs &Inputs, struct FScreenPassTexture &OutPass) const
 
virtual float GetPixelDenity () const
 
virtual void SetPixelDensity (const float NewDensity)
 
virtual FIntPoint GetIdealRenderTargetSize () const
 
virtual FIntPoint GetIdealDebugCanvasRenderTargetSize () const
 
virtual float GetDistortionScalingFactor () const
 
virtual float GetLensCenterOffset () const
 
virtual void GetDistortionWarpValues (FVector4 &K) const
 
virtual bool IsChromaAbCorrectionEnabled () const =0
 
virtual bool GetChromaAbCorrectionValues (FVector4 &K) const
 
virtual bool HasHiddenAreaMesh () const
 
virtual bool HasVisibleAreaMesh () const
 
virtual void DrawHiddenAreaMesh (class FRHICommandList &RHICmdList, int32 ViewIndex) const
 
virtual void DrawHiddenAreaMesh (class FRHICommandList &RHICmdList, int32 ViewIndex, int32 InstanceCount) const
 
virtual void DrawVisibleAreaMesh (class FRHICommandList &RHICmdList, int32 ViewIndex) const
 
virtual void DrawVisibleAreaMesh (class FRHICommandList &RHICmdList, int32 ViewIndex, int32 InstanceCount) const
 
virtual void DrawDistortionMesh_RenderThread (struct FHeadMountedDisplayPassContext &Context, const FIntPoint &TextureSize)
 
virtual void UpdateScreenSettings (const class FViewport *InViewport)
 
virtual FTextureGetDistortionTextureLeft () const
 
virtual FTextureGetDistortionTextureRight () const
 
virtual FVector2D GetTextureOffsetLeft () const
 
virtual FVector2D GetTextureOffsetRight () const
 
virtual FVector2D GetTextureScaleLeft () const
 
virtual FVector2D GetTextureScaleRight () const
 
virtual const floatGetRedDistortionParameters () const
 
virtual const floatGetGreenDistortionParameters () const
 
virtual const floatGetBlueDistortionParameters () const
 
virtual bool NeedsUpscalePostProcessPass ()
 
virtual void RecordAnalytics ()
 
virtual HEADMOUNTEDDISPLAY_API bool DoesAppUseVRFocus () const
 
virtual HEADMOUNTEDDISPLAY_API bool DoesAppHaveVRFocus () const
 
virtual bool IsRenderingPaused () const
 
virtual bool SetColorScaleAndBias (FLinearColor ColorScale, FLinearColor ColorBias)
 
- Public Member Functions inherited from IModuleInterface
virtual ~IModuleInterface ()
 
virtual void StartupModule ()
 
virtual void PreUnloadCallback ()
 
virtual void PostLoadCallback ()
 
virtual void ShutdownModule ()
 
virtual bool SupportsDynamicReloading ()
 
virtual bool SupportsAutomaticShutdown ()
 
virtual bool IsGameModule () const
 

Detailed Description

HMD device interface

Constructor & Destructor Documentation

◆ IHeadMountedDisplay()

IHeadMountedDisplay::IHeadMountedDisplay ( )

Member Function Documentation

◆ CreateHMDPostProcessPass_RenderThread()

virtual void IHeadMountedDisplay::CreateHMDPostProcessPass_RenderThread ( FRDGBuilder GraphBuilder,
const FSceneView View,
const struct FHMDDistortionInputs Inputs,
struct FScreenPassTexture OutPass 
) const
inlinevirtual

When implemented, creates a new post process node to provide platform-specific HMD distortion.

◆ DoesAppHaveVRFocus()

bool IHeadMountedDisplay::DoesAppHaveVRFocus ( ) const
virtual

Returns true, if the app has VR focus, meaning if it is rendered in the HMD.

◆ DoesAppUseVRFocus()

bool IHeadMountedDisplay::DoesAppUseVRFocus ( ) const
virtual

Returns true, if the App is using VR focus. This means that the app may handle lifecycle events differently from the regular desktop apps. In this case, FCoreDelegates::ApplicationWillEnterBackgroundDelegate and FCoreDelegates::ApplicationHasEnteredForegroundDelegate reflect the state of VR focus (either the app should be rendered in HMD or not).

◆ DrawDistortionMesh_RenderThread()

virtual void IHeadMountedDisplay::DrawDistortionMesh_RenderThread ( struct FHeadMountedDisplayPassContext Context,
const FIntPoint TextureSize 
)
inlinevirtual

◆ DrawHiddenAreaMesh() [1/2]

virtual void IHeadMountedDisplay::DrawHiddenAreaMesh ( class FRHICommandList RHICmdList,
int32  ViewIndex 
) const
inlinevirtual

Optional method to draw a view's hidden area mesh where supported. This can be used to avoid rendering pixels which are not included as input into the final distortion pass.

◆ DrawHiddenAreaMesh() [2/2]

virtual void IHeadMountedDisplay::DrawHiddenAreaMesh ( class FRHICommandList RHICmdList,
int32  ViewIndex,
int32  InstanceCount 
) const
inlinevirtual

Optional method to draw a view's hidden area mesh where supported. This can be used to avoid rendering pixels which are not included as input into the final distortion pass. Supports instanced rendering.

◆ DrawVisibleAreaMesh() [1/2]

virtual void IHeadMountedDisplay::DrawVisibleAreaMesh ( class FRHICommandList RHICmdList,
int32  ViewIndex 
) const
inlinevirtual

Optional method to draw a view's visible area mesh where supported. This can be used instead of a full screen quad to avoid rendering pixels which are not included as input into the final distortion pass.

◆ DrawVisibleAreaMesh() [2/2]

virtual void IHeadMountedDisplay::DrawVisibleAreaMesh ( class FRHICommandList RHICmdList,
int32  ViewIndex,
int32  InstanceCount 
) const
inlinevirtual

Optional method to draw a view's visible area mesh where supported. This can be used instead of a full screen quad to avoid rendering pixels which are not included as input into the final distortion pass. Supports instanced rendering.

◆ EnableHMD()

virtual void IHeadMountedDisplay::EnableHMD ( bool  bEnable = true)
pure virtual

Enables or disables switching to stereo.

◆ GetBlueDistortionParameters()

virtual const float * IHeadMountedDisplay::GetBlueDistortionParameters ( ) const
inlinevirtual

◆ GetChromaAbCorrectionValues()

virtual bool IHeadMountedDisplay::GetChromaAbCorrectionValues ( FVector4 K) const
inlinevirtual

Gets the chromatic aberration correction shader values for the device. Returns 'false' if chromatic aberration correction is off.

◆ GetDistortionScalingFactor()

virtual float IHeadMountedDisplay::GetDistortionScalingFactor ( ) const
inlinevirtual

Gets the scaling factor, applied to the post process warping effect

◆ GetDistortionTextureLeft()

virtual FTexture * IHeadMountedDisplay::GetDistortionTextureLeft ( ) const
inlinevirtual

Additional optional distortion rendering parameters

◆ GetDistortionTextureRight()

virtual FTexture * IHeadMountedDisplay::GetDistortionTextureRight ( ) const
inlinevirtual

◆ GetDistortionWarpValues()

virtual void IHeadMountedDisplay::GetDistortionWarpValues ( FVector4 K) const
inlinevirtual

Gets the barrel distortion shader warp values for the device

◆ GetEyeRenderParams_RenderThread()

virtual void IHeadMountedDisplay::GetEyeRenderParams_RenderThread ( const struct FHeadMountedDisplayPassContext Context,
FVector2D EyeToSrcUVScaleValue,
FVector2D EyeToSrcUVOffsetValue 
) const
inlinevirtual

Returns eye render params, used from PostProcessHMD, RenderThread.

◆ GetFieldOfView()

virtual void IHeadMountedDisplay::GetFieldOfView ( float InOutHFOVInDegrees,
float InOutVFOVInDegrees 
) const
pure virtual

Calculates the FOV, based on the screen dimensions of the device. Original FOV is passed as params.

◆ GetGreenDistortionParameters()

virtual const float * IHeadMountedDisplay::GetGreenDistortionParameters ( ) const
inlinevirtual

◆ GetHMDDistortionEnabled()

virtual bool IHeadMountedDisplay::GetHMDDistortionEnabled ( EShadingPath  ShadingPath) const
pure virtual

Whether HMDDistortion post processing is enabled or not

◆ GetHMDMonitorInfo()

virtual bool IHeadMountedDisplay::GetHMDMonitorInfo ( MonitorInfo )
pure virtual

Get the name or id of the display to output for this HMD.

◆ GetHMDName()

virtual FName IHeadMountedDisplay::GetHMDName ( ) const
pure virtual

Retrieves the HMD name.

◆ GetHMDWornState()

virtual EHMDWornState::Type IHeadMountedDisplay::GetHMDWornState ( )
inlinevirtual

Returns EHMDWornState::Worn if we detect that the user is wearing the HMD, EHMDWornState::NotWorn if we detect the user is not wearing the HMD, and EHMDWornState::Unknown if we cannot detect the state.

◆ GetIdealDebugCanvasRenderTargetSize()

virtual FIntPoint IHeadMountedDisplay::GetIdealDebugCanvasRenderTargetSize ( ) const
inlinevirtual

Gets the ideal render target size for the debug canvas on the device.

◆ GetIdealRenderTargetSize()

virtual FIntPoint IHeadMountedDisplay::GetIdealRenderTargetSize ( ) const
inlinevirtual

Gets the ideal render target size for the device. See xr.SecondaryScreenPercentage.HMDRenderTarget description.

◆ GetInterpupillaryDistance()

virtual float IHeadMountedDisplay::GetInterpupillaryDistance ( ) const
pure virtual

◆ GetLensCenterOffset()

virtual float IHeadMountedDisplay::GetLensCenterOffset ( ) const
inlinevirtual

Gets the offset (in clip coordinates) from the center of the screen for the lens position

◆ GetPixelDenity()

virtual float IHeadMountedDisplay::GetPixelDenity ( ) const
inlinevirtual

Gets the current pixel density setting.

◆ GetRedDistortionParameters()

virtual const float * IHeadMountedDisplay::GetRedDistortionParameters ( ) const
inlinevirtual

◆ GetSpectatorScreenController() [1/2]

virtual class ISpectatorScreenController * IHeadMountedDisplay::GetSpectatorScreenController ( )
inlinevirtual

Return a pointer to the SpectatorScreenController for the HMD if supported, else null. The controller is owned by the HMD, and will be destroyed when the HMD is destroyed.

◆ GetSpectatorScreenController() [2/2]

virtual class ISpectatorScreenController const * IHeadMountedDisplay::GetSpectatorScreenController ( ) const
inlinevirtual

◆ GetTextureOffsetLeft()

virtual FVector2D IHeadMountedDisplay::GetTextureOffsetLeft ( ) const
inlinevirtual

◆ GetTextureOffsetRight()

virtual FVector2D IHeadMountedDisplay::GetTextureOffsetRight ( ) const
inlinevirtual

◆ GetTextureScaleLeft()

virtual FVector2D IHeadMountedDisplay::GetTextureScaleLeft ( ) const
inlinevirtual

◆ GetTextureScaleRight()

virtual FVector2D IHeadMountedDisplay::GetTextureScaleRight ( ) const
inlinevirtual

◆ HasHiddenAreaMesh()

virtual bool IHeadMountedDisplay::HasHiddenAreaMesh ( ) const
inlinevirtual
Returns
true if a hidden area mesh is available for the device.

◆ HasVisibleAreaMesh()

virtual bool IHeadMountedDisplay::HasVisibleAreaMesh ( ) const
inlinevirtual
Returns
true if a visible area mesh is available for the device.

◆ IsChromaAbCorrectionEnabled()

virtual bool IHeadMountedDisplay::IsChromaAbCorrectionEnabled ( ) const
pure virtual

Returns 'false' if chromatic aberration correction is off.

◆ IsHMDConnected()

virtual bool IHeadMountedDisplay::IsHMDConnected ( )
pure virtual

Returns true if HMD is currently connected. It may or may not be in use.

◆ IsHMDEnabled()

virtual bool IHeadMountedDisplay::IsHMDEnabled ( ) const
pure virtual

Whether or not switching to stereo is enabled; if it is false, then EnableStereo(true) will do nothing.

◆ IsRenderingPaused()

virtual bool IHeadMountedDisplay::IsRenderingPaused ( ) const
inlinevirtual

If true, scene rendering should be skipped.

◆ IsSpectatorScreenActive()

virtual bool IHeadMountedDisplay::IsSpectatorScreenActive ( ) const
inlinevirtual

◆ NeedsUpscalePostProcessPass()

virtual bool IHeadMountedDisplay::NeedsUpscalePostProcessPass ( )
inlinevirtual

◆ RecordAnalytics()

virtual void IHeadMountedDisplay::RecordAnalytics ( )
inlinevirtual

Record analytics

◆ SetClippingPlanes()

virtual void IHeadMountedDisplay::SetClippingPlanes ( float  NCP,
float  FCP 
)
inlinevirtual

Sets near and far clipping planes (NCP and FCP) for the HMD.

Parameters
NCP(in) Near clipping plane, in centimeters
FCP(in) Far clipping plane, in centimeters

◆ SetColorScaleAndBias()

virtual bool IHeadMountedDisplay::SetColorScaleAndBias ( FLinearColor  ColorScale,
FLinearColor  ColorBias 
)
inlinevirtual

Set the multiply and offset colors for composited images in the HMD

◆ SetInterpupillaryDistance()

virtual void IHeadMountedDisplay::SetInterpupillaryDistance ( float  NewInterpupillaryDistance)
pure virtual

Accessors to modify the interpupillary distance (meters)

◆ SetPixelDensity()

virtual void IHeadMountedDisplay::SetPixelDensity ( const float  NewDensity)
inlinevirtual

Sets the pixel density. This may cause render target resizing.

◆ UpdateScreenSettings()

virtual void IHeadMountedDisplay::UpdateScreenSettings ( const class FViewport InViewport)
inlinevirtual

This method is able to change screen settings right before any drawing occurs. It is called at the beginning of UGameViewportClient::Draw() method. We might remove this one as UpdatePostProcessSettings should be able to capture all needed cases


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