Add Games File
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Subsystems/EngineSubsystem.h"
|
||||
#include "Misc/EngineVersionComparison.h"
|
||||
#include "VrmSceneViewExtension.h"
|
||||
#include "VrmExtensionRimFilterData.h"
|
||||
#include "VRM4URender.h"
|
||||
|
||||
#if WITH_EDITOR
|
||||
#include "UnrealEdMisc.h"
|
||||
#endif
|
||||
|
||||
#include "VRM4U_RenderSubsystem.generated.h"
|
||||
|
||||
|
||||
|
||||
#if UE_VERSION_OLDER_THAN(4,22,0)
|
||||
|
||||
//Couldn't find parent type for 'VRM4U_AnimSubsystem' named 'UEngineSubsystem'
|
||||
#error "please remove VRM4U_AnimSubsystem.h/cpp for <=UE4.21"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
UCLASS()
|
||||
class VRM4URENDER_API UVRM4U_RenderSubsystem : public UEngineSubsystem
|
||||
{
|
||||
|
||||
GENERATED_BODY()
|
||||
|
||||
FDelegateHandle HandleTearDown;
|
||||
bool bInitPIE = false;
|
||||
|
||||
public:
|
||||
|
||||
//// rim filter
|
||||
FCriticalSection cs_rim;
|
||||
|
||||
TArray< TWeakObjectPtr<class UVrmExtensionRimFilterData> > RimFilterData;
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "VRM4U")
|
||||
void AddRimFilterData(class UVrmExtensionRimFilterData *FilterData);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "VRM4U")
|
||||
void RemoveRimFilterData(class UVrmExtensionRimFilterData* FilterData);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "VRM4U")
|
||||
void RemoveRimFilterDataByPriority(int Priotiry = -1);
|
||||
|
||||
TArray<struct UVrmExtensionRimFilterData::FFilterData> GenerateFilterData();
|
||||
|
||||
////
|
||||
|
||||
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
|
||||
virtual void Deinitialize() override;
|
||||
|
||||
void RenderPre(FRDGBuilder& GraphBuilder);
|
||||
void RenderPost(FRDGBuilder& GraphBuilder);
|
||||
|
||||
void OnPostOpaque(FPostOpaqueRenderParameters& Parameters);
|
||||
void OnOverlay(FPostOpaqueRenderParameters& Parameters);
|
||||
void OnResolvedSceneColor_RenderThread(FRDGBuilder& GraphBuilder, const FSceneTextures& SceneTextures);
|
||||
|
||||
#if WITH_EDITOR
|
||||
void OnMapChange(UWorld* World, EMapChangeType ChangeType);
|
||||
|
||||
void OnPIEEvent(bool bPIEBegin, bool bPIEEnd);
|
||||
#endif
|
||||
|
||||
// keep class
|
||||
TSharedPtr<class FVrmSceneViewExtension, ESPMode::ThreadSafe> SceneViewExtension;
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "VRM4U")
|
||||
void AddCaptureTexture(UTextureRenderTarget2D *Texture, EVRM4U_CaptureSource CaptureSource = EVRM4U_CaptureSource::ColorTextureOverlay);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "VRM4U")
|
||||
void RemoveCaptureTexture(UTextureRenderTarget2D* Texture);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "VRM4U")
|
||||
void RemoveAllCaptureTexture();
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "VRM4U")
|
||||
void ResetSceneTextureExtentHistory();
|
||||
|
||||
//
|
||||
UFUNCTION(BlueprintCallable, Category = "VRM4U")
|
||||
void SetViewExtension(bool bEnable);
|
||||
};
|
||||
@@ -0,0 +1,125 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "VrmExtensionRimFilterData.generated.h"
|
||||
|
||||
|
||||
UCLASS(BlueprintType)
|
||||
class VRM4URENDER_API UVrmExtensionRimFilterData : public UObject
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
|
||||
struct FFilterData {
|
||||
bool bUseFilter = false;
|
||||
int Priority = 0;
|
||||
|
||||
bool bUseCustomLighPosition = false;
|
||||
FVector LightPosition;
|
||||
FVector LightDirection;
|
||||
|
||||
bool bUseCustomLighColor = false;
|
||||
FLinearColor LightColor;
|
||||
float LightScale = 100.f;
|
||||
float RimEdgeFade = 1.f;
|
||||
|
||||
bool bUseBinaryEdge = false;
|
||||
float RimEdgeBinaryRange = 0.2f;
|
||||
|
||||
float SampleScreenScale = 0.25f;
|
||||
float SampleScale = 1.5;
|
||||
|
||||
int CustomStencilMask = 0xFFFF;
|
||||
|
||||
};
|
||||
|
||||
public:
|
||||
// Sets default values for this actor's properties
|
||||
//UVrmExtensionRimFilterData();
|
||||
|
||||
protected:
|
||||
// Called when the game starts or when spawned
|
||||
//virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRM4U")
|
||||
bool bUseFilter = false;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRM4U")
|
||||
int Priority = 0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRM4U")
|
||||
bool bUseCustomLighPosition = false;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRM4U")
|
||||
FVector LightPosition;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRM4U")
|
||||
FVector LightDirection;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRM4U")
|
||||
float LightScale = 1.f;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRM4U")
|
||||
float RimEdgeFade = 1.f;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRM4U")
|
||||
bool bUseBinaryEdge = false;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRM4U")
|
||||
float RimEdgeBinaryRange = 0.2f;
|
||||
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRM4U")
|
||||
bool bUseCustomLighColor = false;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRM4U")
|
||||
FLinearColor LightColor;
|
||||
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRM4U")
|
||||
float SampleScreenScale = 0.5f;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRM4U")
|
||||
float SampleScale = 1.0;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRM4U")
|
||||
int CustomStencilMask = 0xFFFF;
|
||||
|
||||
// Called every frame
|
||||
//virtual void Tick(float DeltaTime) override;
|
||||
|
||||
//UObject::UObject(const FObjectInitializer& ObjectInitializer)
|
||||
// virtual void OnConstruction(const FTransform& Transform) override;
|
||||
//virtual void BeginDestroy() override;
|
||||
virtual void PostInitProperties() override;
|
||||
|
||||
FFilterData GetFilterData() {
|
||||
FFilterData d;
|
||||
|
||||
d.bUseFilter = bUseFilter;
|
||||
d.Priority = Priority;
|
||||
|
||||
d.bUseCustomLighPosition = bUseCustomLighPosition;
|
||||
d.LightPosition = LightPosition;
|
||||
d.LightDirection = LightDirection;
|
||||
|
||||
d.bUseCustomLighColor = bUseCustomLighColor;
|
||||
d.LightColor = LightColor;
|
||||
d.LightScale = LightScale;
|
||||
d.RimEdgeFade = RimEdgeFade;
|
||||
|
||||
d.bUseBinaryEdge = bUseBinaryEdge;
|
||||
d.RimEdgeBinaryRange = RimEdgeBinaryRange;
|
||||
|
||||
d.SampleScreenScale = SampleScreenScale;
|
||||
d.SampleScale = SampleScale;
|
||||
|
||||
d.CustomStencilMask = CustomStencilMask;
|
||||
|
||||
return d;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,47 @@
|
||||
// VRM4U Copyright (c) 2021-2024 Haruyoshi Yamamoto. This software is released under the MIT License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Components/SceneCaptureComponent2D.h"
|
||||
#include "VrmSceneCaptureComponent.generated.h"
|
||||
|
||||
//DECLARE_LOG_CATEGORY_EXTERN(LogCineCapture, Log, All);
|
||||
|
||||
class FVrmSceneCaptureSceneViewExtension;
|
||||
class UCineCameraComponent;
|
||||
|
||||
/**
|
||||
* Cine Capture Component extends Scene Capture to allow users to render Cine Camera Component into a render target.
|
||||
* Cine Capture has a few modifiable properties, but most of the properties are controlled by Cine Camera Component.
|
||||
* Cine Capture Component is required to be parented to Cine Camera Component or a class that extends it.
|
||||
*
|
||||
*/
|
||||
UCLASS(meta = (BlueprintSpawnableComponent))
|
||||
//UCLASS(hidecategories = (Transform, Collision, Object, Physics, SceneComponent, PostProcessVolume, Projection, Rendering, PlanarReflection), ClassGroup = Rendering, editinlinenew, meta = (BlueprintSpawnableComponent))
|
||||
class VRM4URENDER_API UVrmSceneCaptureComponent2D : public USceneCaptureComponent2D
|
||||
{
|
||||
GENERATED_UCLASS_BODY()
|
||||
public:
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture Settings")
|
||||
TObjectPtr<UTextureRenderTarget2D> RenderTargetA;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Capture Settings")
|
||||
TObjectPtr<UTextureRenderTarget2D> RenderTargetB;
|
||||
|
||||
public:
|
||||
virtual void OnRegister() override;
|
||||
virtual void OnUnregister() override;
|
||||
|
||||
/** Used for validation of this componet's attachment to Cine Camera Component. */
|
||||
virtual void OnAttachmentChanged() override;
|
||||
virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||
|
||||
private:
|
||||
|
||||
private:
|
||||
/** This scene view extension is used to get ahold of views during the setup process. */
|
||||
TSharedPtr<FVrmSceneCaptureSceneViewExtension, ESPMode::ThreadSafe> SceneViewExtension;
|
||||
//TSharedPtr<class FVrmSceneViewExtension, ESPMode::ThreadSafe> SceneViewExtension;
|
||||
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "VrmSceneViewExtensionSettings.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class VRM4URENDER_API AVrmSceneViewExtensionSettings : public AActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// Sets default values for this actor's properties
|
||||
AVrmSceneViewExtensionSettings();
|
||||
|
||||
protected:
|
||||
// Called when the game starts or when spawned
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VRM4U")
|
||||
bool bUseExtension = false;
|
||||
|
||||
|
||||
// Called every frame
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
|
||||
virtual void OnConstruction(const FTransform& Transform) override;
|
||||
};
|
||||
Reference in New Issue
Block a user