64 lines
2.1 KiB
C++
64 lines
2.1 KiB
C++
// Luminosite, saturation, contraste et balance des blancs.
|
|
//
|
|
// Ce sont les reglages globaux du panneau Color Grading d'Unreal (FPostProcessSettings) :
|
|
// la compensation d'exposition, ColorSaturation, ColorContrast, et la balance des blancs
|
|
// (WhiteTemp / WhiteTint, methode White Balance). Ils s'appliquent a toute la vue par un
|
|
// volume de post-traitement non borne. Les valeurs neutres du moteur ne changent pas l'image.
|
|
// Enregistre dans Saved/Config/Windows/LPColorGrade.ini, pas dans GameSettings.sav.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Containers/Ticker.h"
|
|
#include "Styling/SlateTypes.h"
|
|
#include "Subsystems/GameInstanceSubsystem.h"
|
|
#include "LPColorGradeSubsystem.generated.h"
|
|
|
|
class APostProcessVolume;
|
|
class UScrollBox;
|
|
class USlider;
|
|
class UTextBlock;
|
|
|
|
UCLASS()
|
|
class LIFEPLAY_API ULPColorGradeSubsystem : public UGameInstanceSubsystem
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
|
|
virtual void Deinitialize() override;
|
|
|
|
UFUNCTION()
|
|
void OnBrightnessChanged(float Value);
|
|
UFUNCTION()
|
|
void OnSaturationChanged(float Value);
|
|
UFUNCTION()
|
|
void OnContrastChanged(float Value);
|
|
UFUNCTION()
|
|
void OnWhiteBalanceChanged(float Value);
|
|
UFUNCTION()
|
|
void OnTintChanged(float Value);
|
|
|
|
private:
|
|
bool Tick(float DeltaTime);
|
|
void EnsureControls();
|
|
void EnsureVolume();
|
|
void ApplyGrade();
|
|
void Load();
|
|
void Save() const;
|
|
USlider* AddRow(UScrollBox* Scroll, const TCHAR* Name, const TCHAR* Label, float Min, float Max, float Step, float Value, FName Handler, const TCHAR* Tip, const FSlateFontInfo& Font, const FSlateColor& Color, const FSliderStyle* SliderStyle);
|
|
|
|
FTSTicker::FDelegateHandle TickHandle;
|
|
TWeakObjectPtr<APostProcessVolume> GradeVolume;
|
|
TWeakObjectPtr<UTextBlock> BrightnessValue;
|
|
TWeakObjectPtr<UTextBlock> SaturationValue;
|
|
TWeakObjectPtr<UTextBlock> ContrastValue;
|
|
TWeakObjectPtr<UTextBlock> WhiteBalanceValue;
|
|
TWeakObjectPtr<UTextBlock> TintValue;
|
|
|
|
float Brightness = 0.f;
|
|
float Saturation = 1.f;
|
|
float Contrast = 1.f;
|
|
float WhiteBalance = 6500.f;
|
|
float Tint = 0.f;
|
|
};
|