Depth of field fixes and camera zoom fixes

This commit is contained in:
2026-09-11 23:19:03 +02:00
parent d72a9c957a
commit 6240f501ad
6 changed files with 25 additions and 12 deletions

View File

@@ -174,7 +174,7 @@ r.VolumetricFog.GridPixelSize=16
r.PathTracing=False
r.Shadow.Virtual.Enable=0
r.Velocity.EnableVertexDeformation=1
r.DepthOfFieldQuality=0
r.DepthOfFieldQuality=1
r.AmbientOcclusion.Compute= 3
r.VelocityOutputPass=1

View File

@@ -18,6 +18,7 @@ struct FArrayOfItemRefs
{
GENERATED_BODY()
public:
UPROPERTY()
TArray<UItemDataAsset*> ItemArray;
void SortByName();

View File

@@ -6,6 +6,7 @@
#include "Kismet/GameplayStatics.h"
#include "EleriSaveGame.h"
#include "EleriGameInstance.h"
#include "LTweenBPLibrary.h"
#include "PaperFlipbookComponent.h"
#include "Kismet/KismetMathLibrary.h"
#include "../GameObjects/WaterBall.h"
@@ -123,12 +124,12 @@ void AMyCharacter::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if (CurrentZoomTimer > 0.f) {
const float ZoomDelta = (NextZoomOffsetTarget * DeltaTime) / ZoomTime;
SpringArmRef->TargetArmLength += ZoomDelta;
CurrentZoomTimer -= DeltaTime;
UE_LOG(LogTemp, Warning, TEXT("Zooming in: ZoomDelta:%f"), ZoomDelta);
}
// if (CurrentZoomTimer > 0.f) {
// const float ZoomDelta = (NextZoomOffsetTarget * DeltaTime) / ZoomTime;
// SpringArmRef->TargetArmLength += ZoomDelta;
// CurrentZoomTimer -= DeltaTime;
// UE_LOG(LogTemp, Warning, TEXT("Zooming in: ZoomDelta:%f"), ZoomDelta);
// }
}
void AMyCharacter::EndPlay(const EEndPlayReason::Type EndPlayReason)
@@ -187,15 +188,23 @@ void AMyCharacter::OnHarvestSeed_Implementation(class UItem* HarvestedItem)
{
}
void AMyCharacter::UpdateCameraZoom(float NewZoom) const
{
SpringArmRef->TargetArmLength = NewZoom;
}
void AMyCharacter::ZoomCamera(float CameraZoomAmount, float Time)
{
CurrentZoomTimer = Time;
ZoomTime = Time;
NextZoomOffsetTarget = CameraZoomAmount;
FLTweenFloatSetterDynamic Setter;
Setter.BindDynamic(this, &AMyCharacter::UpdateCameraZoom);
ULTweenBPLibrary::FloatTo(this, Setter, SpringArmRef->TargetArmLength, SpringArmRef->TargetArmLength + CameraZoomAmount, Time);
}
void AMyCharacter::ZoomBack(float Time) {
ZoomCamera(SpringArmRef->TargetArmLength - DefaultZoom, Time);
ZoomCamera(DefaultZoom - SpringArmRef->TargetArmLength, Time);
}
void AMyCharacter::ReturnCameraToPlayer() {

View File

@@ -33,7 +33,7 @@ public class ProjectEleri : ModuleRules
"InteractionSystem"
});
PrivateDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "OnlineSubsystemUtils", "Landscape" });
PrivateDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "OnlineSubsystemUtils", "Landscape", "LTween" });
// Uncomment if you are using Slate UI
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });

View File

@@ -82,6 +82,9 @@ protected:
float CurrentZoomTimer = 0.f;
float ZoomTime = 0.f;
float NextZoomOffsetTarget = 0.f;
UFUNCTION()
void UpdateCameraZoom(float NewZoom) const;
static const FText PlayerName;
@@ -145,7 +148,7 @@ public:
void ZoomBack(float Time = 0.2f);
UFUNCTION(BlueprintCallable, Category = "Camera Controll")
void ReturnCameraToPlayer();
UFUNCTION(BlueprintCallable)
void SetNewCameraPitches(float NewMinPitch, float NewMaxPitch);