Navigation
API > API/Plugins > API/Plugins/CameraCalibrationCore
Asset user data that can be used on Camera Actors to manage lens distortion state and utilities
| Name | ULensDistortionModelHandlerBase |
| Type | class |
| Header File | /Engine/Plugins/VirtualProduction/CameraCalibrationCore/Source/CameraCalibrationCore/Public/LensDistortionModelHandlerBase.h |
| Include Path | #include "LensDistortionModelHandlerBase.h" |
Syntax
UCLASS (MinimalAPI, Abstract)
class ULensDistortionModelHandlerBase : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → ULensDistortionModelHandlerBase
Derived Classes
- UAnamorphicLensDistortionModelHandler
- UBrownConradyUDLensDistortionModelHandler
- USphericalLensDistortionModelHandler
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ULensDistortionModelHandlerBase() |
LensDistortionModelHandlerBase.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsDirty | bool | Tracks whether distortion state has been changed | LensDistortionModelHandlerBase.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
float ComputeInverseOverscanFactor() |
Use the current distortion state to compute the overscan factor needed when undistorting a distorted image | LensDistortionModelHandlerBase.h | |
float ComputeOverscanFactor() |
Use the current distortion state to compute the overscan factor needed such that all distorted UVs will fall into the valid range of [0,1] | LensDistortionModelHandlerBase.h | |
void CreateDisplacementMaps
(
const FIntPoint DisplacementMapResolution |
Create two displacement maps, for distortion and undistortion, using the input resolution | LensDistortionModelHandlerBase.h | |
bool DrawDistortionDisplacementMap
(
UTextureRenderTarget2D* DestinationTexture |
Draw the distortion displacement map associated with the current state to the DestinationTexture | LensDistortionModelHandlerBase.h | |
bool DrawUndistortionDisplacementMap
(
UTextureRenderTarget2D* DestinationTexture |
Draw the undistortion displacement map associated with the current state to the DestinationTexture | LensDistortionModelHandlerBase.h | |
virtual void ExecuteDistortionShader
(
FRDGBuilder& GraphBuilder, |
Execute the distortion shader with the specified parameters, which enables a modular SVE that doesn't need to know lens model specifics. | LensDistortionModelHandlerBase.h | |
FLensDistortionState GetCurrentDistortionState() |
Get the current distortion state (the lens model and properties that mathematically represent the distortion characteristics | LensDistortionModelHandlerBase.h | |
FString GetDisplayName() |
Get the display name of this lens distortion model handler | LensDistortionModelHandlerBase.h | |
TArray< FVector2D > GetDistortedUVs
(
TConstArrayView< FVector2D > UndistortedUVs |
Computes the distorted version of UndistortedUVs based on the current state | LensDistortionModelHandlerBase.h | |
UTextureRenderTarget2D * GetDistortionDisplacementMap() |
Get the UV displacement map used to distort an undistorted image | LensDistortionModelHandlerBase.h |
|
UMaterialInstanceDynamic * GetDistortionMID() |
Get the post-process MID for the currently specified lens model | LensDistortionModelHandlerBase.h | |
FGuid GetDistortionProducerID() |
Get the UObject that produces the distortion state for this handler | LensDistortionModelHandlerBase.h | |
FVector2D GetFxFy() |
Get the normalized focal length (unitless) | LensDistortionModelHandlerBase.h | |
const TSubclassOf< ULensModel > & GetLensModelClass() |
Get the specified lens model that characterizes the distortion effect | LensDistortionModelHandlerBase.h | |
float GetOverscanFactor() |
Returns the last overscan factor that was set | LensDistortionModelHandlerBase.h | |
| Returns the preferred rendering mode for this lens model. | LensDistortionModelHandlerBase.h | ||
FVector2D GetPrincipalPoint() |
Get the normalized center of projection of the image, in the range [0.0f, 1.0f] | LensDistortionModelHandlerBase.h | |
UTextureRenderTarget2D * GetUndistortionDisplacementMap() |
Get the UV displacement map used to undistort a distorted image | LensDistortionModelHandlerBase.h |
|
virtual bool IsForwardDistorting() |
Returns true if this model performs forward distortion (needs inverse overscan), false if reverse distortion (needs forward overscan) | LensDistortionModelHandlerBase.h | |
bool IsModelSupported
(
const TSubclassOf< ULensModel >& ModelToSupport |
Returns true if the input model is supported by this model handler, false otherwise. | LensDistortionModelHandlerBase.h |
|
void ProcessCurrentDistortion() |
Draws the current distortion state to the internal displacement map | LensDistortionModelHandlerBase.h | |
void SetCameraFilmback
(
const FCameraFilmbackSettings& InCameraFilmback |
Specify the filmback settings of the CineCamera that is being used for distortion | LensDistortionModelHandlerBase.h | |
void SetDisplayName
(
FString InDisplayName |
Set the display name of this lens distortion model handler | LensDistortionModelHandlerBase.h | |
void SetDistortionProducerID
(
const FGuid& InDistortionProducerID |
Set the UObject that produces the distortion state for this handler | LensDistortionModelHandlerBase.h | |
void SetDistortionState
(
const FLensDistortionState& InNewState |
Update the lens distortion state, recompute the overscan factor, and set all material parameters | LensDistortionModelHandlerBase.h |
|
void SetOverscanFactor
(
float OverscanFactor |
Updates overscan factor and applies to material instances | LensDistortionModelHandlerBase.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostEditChangeChainProperty
(
FPropertyChangedChainEvent& PropertyChangedEvent |
LensDistortionModelHandlerBase.h | ||
virtual void PostInitProperties() |
LensDistortionModelHandlerBase.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void virtual InitializeHandler() PURE_VIRTUAL(ULensDistortionModelHandlerBaseFVector2D ComputeDistortedUV
(
const FVector2D& InScreenUV |
Initialize the handler. | LensDistortionModelHandlerBase.h | |
virtual FVector2D ComputeUndistortedUV
(
const FVector2D& InScreenUV |
Use the current distortion state to compute the undistortion position of an input UV coordinate | LensDistortionModelHandlerBase.h | |
virtual void virtual InitDistortionMaterials() PURE_VIRTUAL(ULensDistortionModelHandlerBase void virtual UpdateMaterialParameters() PURE_VIRTUAL(ULensDistortionModelHandlerBase void virtual InterpretDistortionParameters() PURE_VIRTUAL(ULensDistortionModelHandlerBaseFString GetDistortionShaderPath() |
Create the distortion MIDs Set the material parameters for the displacement map and distortion post-process materials Convert the generic distortion parameter array into the specific structure of parameters used by the supported lens model Return the shader path for this model's distortion compute shader, promoting a modular shader architecture | LensDistortionModelHandlerBase.h |