DefaultLensFStop

DefaultLensFStop

#Overview

name: DefaultLensFStop

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of DefaultLensFStop is to set the default aperture (f-stop) value for the cinematic camera in Unreal Engine 5. This setting is primarily used in the rendering system, specifically for the cinematic camera functionality.

The Unreal Engine subsystem that relies on this setting variable is the CinematicCamera module. It’s used within the UCineCameraComponent and UCineCameraSettings classes.

The value of this variable is set in the UCineCameraSettings class, which inherits from UDeveloperSettings. It can be modified through the project settings or programmatically using the SetDefaultLensFStop function.

This variable interacts with other camera-related variables, such as CurrentAperture in the UCineCameraComponent class. The DefaultLensFStop value is used to initialize the CurrentAperture when a new UCineCameraComponent is created.

Developers must be aware that this variable is now located on the UCineCameraSettings object as of Unreal Engine 5.1. The property in UCineCameraComponent is marked as deprecated.

Best practices when using this variable include:

  1. Modifying it through the project settings or using the SetDefaultLensFStop function rather than directly changing the value.
  2. Considering the impact of the f-stop value on the depth of field and exposure in your cinematic scenes.
  3. Being aware that this is a default value and individual camera components may override it.
  4. Ensuring that the value is within a realistic range for camera lenses (typically between f/1.4 and f/22).
  5. Coordinating this setting with other camera parameters like focal length and sensor size for realistic results.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:3358, section: [/Script/CinematicCamera.CineCameraSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Private/CineCameraComponent.cpp:53

Scope (from outer to inner):

file
function     UCineCameraComponent::UCineCameraComponent

Source code excerpt:

	SetCropPresetByNameInternal(CineCameraSettings->DefaultCropPresetName);
	// other lens defaults
	CurrentAperture = CineCameraSettings->DefaultLensFStop;
	CurrentFocalLength = CineCameraSettings->DefaultLensFocalLength;


	RecalcDerivedData();

#if WITH_EDITORONLY_DATA

#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Private/CineCameraSettings.cpp:65

Scope (from outer to inner):

file
function     void UCineCameraSettings::SetDefaultLensFStop

Source code excerpt:

void UCineCameraSettings::SetDefaultLensFStop(const float InDefaultLensFStop)
{
	DefaultLensFStop = InDefaultLensFStop;
	SaveConfig();
}

void UCineCameraSettings::SetLensPresets(const TArray<FNamedLensPreset>& InLensPresets)
{
	LensPresets = InLensPresets;

#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Private/CineCameraSettings.cpp:226

Scope (from outer to inner):

file
function     void UCineCameraSettings::CopyOldConfigSettings

Source code excerpt:


	float OldDefaultLensFStop;
	if (GConfig->GetFloat(*CineCameraConfigSection, TEXT("DefaultLensFStop"), OldDefaultLensFStop, GEngineIni))
	{
		GConfig->SetFloat(*SettingsConfigSection, TEXT("DefaultLensFStop"), OldDefaultLensFStop, GEngineIni);
	}

	TArray<FString> OldLensPresets;
	if (GConfig->GetArray(*CineCameraConfigSection, TEXT("LensPresets"), OldLensPresets, GEngineIni))
	{
		TArray<FString> CurrentLensPresets;

#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Public/CineCameraComponent.h:239

Scope (from outer to inner):

file
class        class UCineCameraComponent : public UCameraComponent

Source code excerpt:

	UE_DEPRECATED(5.1, "This property is now located on the UCineCameraSettings object")
	UPROPERTY(config)
	float DefaultLensFStop;

	CINEMATICCAMERA_API virtual void UpdateCameraLens(float DeltaTime, FMinimalViewInfo& DesiredView);

	CINEMATICCAMERA_API virtual void NotifyCameraCut() override;
	
	CINEMATICCAMERA_API void RecalcDerivedData();

#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Public/CineCameraSettings.h:289

Scope (from outer to inner):

file
class        class UCineCameraSettings : public UDeveloperSettings

Source code excerpt:

	/** Default aperture (will be constrained by default lens) */
	UPROPERTY(config, EditAnywhere, BlueprintReadWrite, BlueprintSetter=SetDefaultLensFStop, Category=Lens)
	float DefaultLensFStop;
	
	/** List of available lens presets */
	UPROPERTY(config, EditAnywhere, BlueprintReadWrite, BlueprintSetter=SetLensPresets, Category=Lens, meta=(TitleProperty=Name))
	TArray<FNamedLensPreset> LensPresets;

	/** Name of the default filmback preset */