diff --git a/Config/DefaultGame.ini b/Config/DefaultGame.ini index 2c053931..4bc174fc 100644 --- a/Config/DefaultGame.ini +++ b/Config/DefaultGame.ini @@ -224,7 +224,6 @@ LoadingScreenControlBusMix=/Game/Audio/Modulation/ControlBusMixes/CBM_LoadingScr [/Script/StyleTransfer.StyleTransferSettings] StyleTransferNetwork=/StyleTransfer/rstnet-960-32-3_transfer.rstnet-960-32-3_transfer StylePredictionNetwork=/StyleTransfer/rstnet-960-32-3_predictor.rstnet-960-32-3_predictor -+StyleTextures=/StyleTransfer/Styles/002af7d2cf8317f84d629a0b12cdb4dc10899f1d.002af7d2cf8317f84d629a0b12cdb4dc10899f1d +StyleTextures=/StyleTransfer/Styles/00059bb14dffa5cb836f35e2f207f39946d25ff6.00059bb14dffa5cb836f35e2f207f39946d25ff6 +StyleTextures=/StyleTransfer/Styles/0011fc013403f895146b783b2dd338d639883ec8.0011fc013403f895146b783b2dd338d639883ec8 +StyleTextures=/StyleTransfer/Styles/00217cb856d9d97865cd3c59669155d3b5c5c0cd.00217cb856d9d97865cd3c59669155d3b5c5c0cd @@ -235,5 +234,6 @@ StylePredictionNetwork=/StyleTransfer/rstnet-960-32-3_predictor.rstnet-960-32-3_ +StyleTextures=/StyleTransfer/Styles/T_StyleImage2.T_StyleImage2 +StyleTextures=/StyleTransfer/Styles/T_StyleImage3.T_StyleImage3 +StyleTextures=/StyleTransfer/Styles/T_StyleImage4.T_StyleImage4 ++StyleTextures=/StyleTransfer/Styles/002af7d2cf8317f84d629a0b12cdb4dc10899f1d.002af7d2cf8317f84d629a0b12cdb4dc10899f1d InterpolationCurve=(EditorCurveData=(Keys=((InterpMode=RCIM_Cubic,TangentMode=RCTM_User),(InterpMode=RCIM_Cubic,TangentMode=RCTM_User,Time=2.241476,Value=1.000000),(InterpMode=RCIM_Cubic,TangentMode=RCTM_User,Time=3.908512,Value=1.000000),(InterpMode=RCIM_Cubic,TangentMode=RCTM_User,Time=5.831762),(Time=7.971708)),DefaultValue=340282346638528859811704183484516925440.000000,PreInfinityExtrap=RCCE_Constant,PostInfinityExtrap=RCCE_Constant),ExternalCurve=None) diff --git a/Lyra.uproject b/Lyra.uproject index 6c9f5e56..5f866a71 100644 --- a/Lyra.uproject +++ b/Lyra.uproject @@ -1,300 +1,304 @@ { - "FileVersion": 3, - "EngineAssociation": "{67760C9E-4E78-132C-8B45-828F7E94A5A9}", - "Category": "", - "Description": "", - "Modules": [ - { - "Name": "LyraGame", - "Type": "Runtime", - "LoadingPhase": "Default", - "AdditionalDependencies": [ - "DeveloperSettings", - "Engine" - ] - }, - { - "Name": "LyraEditor", - "Type": "Editor", - "LoadingPhase": "Default" - } - ], - "Plugins": [ - { - "Name": "ActorPalette", - "Enabled": true - }, - { - "Name": "GameplayAbilities", - "Enabled": true - }, - { - "Name": "Gauntlet", - "Enabled": true - }, - { - "Name": "CommonLoadingScreen", - "Enabled": true - }, - { - "Name": "CommonConversation", - "Enabled": true - }, - { - "Name": "GameFeatures", - "Enabled": true - }, - { - "Name": "ModularGameplay", - "Enabled": true - }, - { - "Name": "ModularGameplayActors", - "Enabled": true - }, - { - "Name": "EnhancedInput", - "Enabled": true - }, - { - "Name": "WinDualShock", - "Enabled": true, - "SupportedTargetPlatforms": [ - "Win64" - ] - }, - { - "Name": "Volumetrics", - "Enabled": true - }, - { - "Name": "DataRegistry", - "Enabled": true - }, - { - "Name": "ReplicationGraph", - "Enabled": true - }, - { - "Name": "SignificanceManager", - "Enabled": true - }, - { - "Name": "Niagara", - "Enabled": true - }, - { - "Name": "Water", - "Enabled": true - }, - { - "Name": "CommonUI", - "Enabled": true - }, - { - "Name": "ControlFlows", - "Enabled": true - }, - { - "Name": "GameSettings", - "Enabled": true - }, - { - "Name": "CommonUser", - "Enabled": true - }, - { - "Name": "CommonGame", - "Enabled": true - }, - { - "Name": "GameSubtitles", - "Enabled": true - }, - { - "Name": "PocketWorlds", - "Enabled": true - }, - { - "Name": "UIExtension", - "Enabled": true - }, - { - "Name": "AsyncMixin", - "Enabled": true - }, - { - "Name": "Metasound", - "Enabled": true - }, - { - "Name": "MagicLeap", - "Enabled": false - }, - { - "Name": "MagicLeapMedia", - "Enabled": false - }, - { - "Name": "MagicLeapPassableWorld", - "Enabled": false - }, - { - "Name": "OculusVR", - "Enabled": false - }, - { - "Name": "OpenXR", - "Enabled": true, - "SupportedTargetPlatforms": [ - "Win64", - "Linux", - "Android", - "HoloLens" - ] - }, - { - "Name": "OpenXREyeTracker", - "Enabled": false - }, - { - "Name": "OpenXRHandTracking", - "Enabled": false - }, - { - "Name": "OpenXRHMD", - "Enabled": false - }, - { - "Name": "SteamVR", - "Enabled": false - }, - { - "Name": "GearVR", - "Enabled": false - }, - { - "Name": "LuminPlatformFeatures", - "Enabled": false, - "SupportedTargetPlatforms": [ - "Lumin" - ] - }, - { - "Name": "MLSDK", - "Enabled": false - }, - { - "Name": "OnlineFramework", - "Enabled": true - }, - { - "Name": "OnlineSubsystemEOS", - "Enabled": true - }, - { - "Name": "OnlineServicesEOS", - "Enabled": true - }, - { - "Name": "OnlineServicesNull", - "Enabled": true - }, - { - "Name": "OnlineServicesOSSAdapter", - "Enabled": true - }, - { - "Name": "OnlineSubsystemSteam", - "Enabled": true - }, - { - "Name": "GameplayMessageRouter", - "Enabled": true - }, - { - "Name": "SteamSockets", - "Enabled": true - }, - { - "Name": "AssetReferenceRestrictions", - "Enabled": true - }, - { - "Name": "ModelingToolsEditorMode", - "Enabled": true - }, - { - "Name": "GeometryScripting", - "Enabled": true - }, - { - "Name": "AnimationLocomotionLibrary", - "Enabled": true - }, - { - "Name": "AudioModulation", - "Enabled": true - }, - { - "Name": "AudioGameplayVolume", - "Enabled": true - }, - { - "Name": "AudioGameplay", - "Enabled": true - }, - { - "Name": "SoundUtilities", - "Enabled": true - }, - { - "Name": "AnimationWarping", - "Enabled": true - }, - { - "Name": "MovieRenderPipeline", - "Enabled": true - }, - { - "Name": "MoviePipelineMaskRenderPass", - "Enabled": true - }, - { - "Name": "AssetSearch", - "Enabled": true - }, - { - "Name": "GameplayInsights", - "Enabled": true - }, - { - "Name": "ResonanceAudio", - "Enabled": false - }, - { - "Name": "RuntimePhysXCooking", - "Enabled": false - }, - { - "Name": "Spatialization", - "Enabled": true - }, - { - "Name": "ShooterCore", - "Enabled": true - }, - { - "Name": "ShooterMaps", - "Enabled": true - }, - { - "Name": "TopDownArena", - "Enabled": true - }, - { - "Name": "FunctionalTestingEditor", - "Enabled": true - } - ] + "FileVersion": 3, + "EngineAssociation": "{0CEC6B5D-4712-B2FC-F019-9BBC776471A8}", + "Category": "", + "Description": "", + "Modules": [ + { + "Name": "LyraGame", + "Type": "Runtime", + "LoadingPhase": "Default", + "AdditionalDependencies": [ + "DeveloperSettings", + "Engine" + ] + }, + { + "Name": "LyraEditor", + "Type": "Editor", + "LoadingPhase": "Default" + } + ], + "Plugins": [ + { + "Name": "ActorPalette", + "Enabled": true + }, + { + "Name": "GameplayAbilities", + "Enabled": true + }, + { + "Name": "Gauntlet", + "Enabled": true + }, + { + "Name": "CommonLoadingScreen", + "Enabled": true + }, + { + "Name": "CommonConversation", + "Enabled": true + }, + { + "Name": "GameFeatures", + "Enabled": true + }, + { + "Name": "ModularGameplay", + "Enabled": true + }, + { + "Name": "ModularGameplayActors", + "Enabled": true + }, + { + "Name": "EnhancedInput", + "Enabled": true + }, + { + "Name": "WinDualShock", + "Enabled": true, + "SupportedTargetPlatforms": [ + "Win64" + ] + }, + { + "Name": "Volumetrics", + "Enabled": true + }, + { + "Name": "DataRegistry", + "Enabled": true + }, + { + "Name": "ReplicationGraph", + "Enabled": true + }, + { + "Name": "SignificanceManager", + "Enabled": true + }, + { + "Name": "Niagara", + "Enabled": true + }, + { + "Name": "Water", + "Enabled": true + }, + { + "Name": "CommonUI", + "Enabled": true + }, + { + "Name": "ControlFlows", + "Enabled": true + }, + { + "Name": "GameSettings", + "Enabled": true + }, + { + "Name": "CommonUser", + "Enabled": true + }, + { + "Name": "CommonGame", + "Enabled": true + }, + { + "Name": "GameSubtitles", + "Enabled": true + }, + { + "Name": "PocketWorlds", + "Enabled": true + }, + { + "Name": "UIExtension", + "Enabled": true + }, + { + "Name": "AsyncMixin", + "Enabled": true + }, + { + "Name": "Metasound", + "Enabled": true + }, + { + "Name": "MagicLeap", + "Enabled": false + }, + { + "Name": "MagicLeapMedia", + "Enabled": false + }, + { + "Name": "MagicLeapPassableWorld", + "Enabled": false + }, + { + "Name": "OculusVR", + "Enabled": false + }, + { + "Name": "OpenXR", + "Enabled": true, + "SupportedTargetPlatforms": [ + "Win64", + "Linux", + "Android", + "HoloLens" + ] + }, + { + "Name": "OpenXREyeTracker", + "Enabled": false + }, + { + "Name": "OpenXRHandTracking", + "Enabled": false + }, + { + "Name": "OpenXRHMD", + "Enabled": false + }, + { + "Name": "SteamVR", + "Enabled": false + }, + { + "Name": "GearVR", + "Enabled": false + }, + { + "Name": "LuminPlatformFeatures", + "Enabled": false, + "SupportedTargetPlatforms": [ + "Lumin" + ] + }, + { + "Name": "MLSDK", + "Enabled": false + }, + { + "Name": "OnlineFramework", + "Enabled": true + }, + { + "Name": "OnlineSubsystemEOS", + "Enabled": true + }, + { + "Name": "OnlineServicesEOS", + "Enabled": true + }, + { + "Name": "OnlineServicesNull", + "Enabled": true + }, + { + "Name": "OnlineServicesOSSAdapter", + "Enabled": true + }, + { + "Name": "OnlineSubsystemSteam", + "Enabled": true + }, + { + "Name": "GameplayMessageRouter", + "Enabled": true + }, + { + "Name": "SteamSockets", + "Enabled": true + }, + { + "Name": "AssetReferenceRestrictions", + "Enabled": true + }, + { + "Name": "ModelingToolsEditorMode", + "Enabled": true + }, + { + "Name": "GeometryScripting", + "Enabled": true + }, + { + "Name": "AnimationLocomotionLibrary", + "Enabled": true + }, + { + "Name": "AudioModulation", + "Enabled": true + }, + { + "Name": "AudioGameplayVolume", + "Enabled": true + }, + { + "Name": "AudioGameplay", + "Enabled": true + }, + { + "Name": "SoundUtilities", + "Enabled": true + }, + { + "Name": "AnimationWarping", + "Enabled": true + }, + { + "Name": "MovieRenderPipeline", + "Enabled": true + }, + { + "Name": "MoviePipelineMaskRenderPass", + "Enabled": true + }, + { + "Name": "AssetSearch", + "Enabled": true + }, + { + "Name": "GameplayInsights", + "Enabled": true + }, + { + "Name": "ResonanceAudio", + "Enabled": false + }, + { + "Name": "RuntimePhysXCooking", + "Enabled": false + }, + { + "Name": "Spatialization", + "Enabled": true + }, + { + "Name": "ShooterCore", + "Enabled": true + }, + { + "Name": "ShooterMaps", + "Enabled": true + }, + { + "Name": "TopDownArena", + "Enabled": true + }, + { + "Name": "FunctionalTestingEditor", + "Enabled": true + }, + { + "Name": "StyleTransfer", + "Enabled": true + } + ] } \ No newline at end of file diff --git a/Plugins/GameFeatures/ShooterCore/Content/Experiences/B_ShooterGame_Elimination.uasset b/Plugins/GameFeatures/ShooterCore/Content/Experiences/B_ShooterGame_Elimination.uasset index bc2b455b..80ecb175 100644 --- a/Plugins/GameFeatures/ShooterCore/Content/Experiences/B_ShooterGame_Elimination.uasset +++ b/Plugins/GameFeatures/ShooterCore/Content/Experiences/B_ShooterGame_Elimination.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fe9e047562ad4645e4fc98696672ee1f8e9ff4a61e4a4b1cc440e6c1c30f0aab -size 11414 +oid sha256:b6248c33e9b035ed1363c59db012bf85413cbf7fde5df319ad2d3ac2d3f9f9a4 +size 13446 diff --git a/Plugins/GameFeatures/ShooterCore/Content/Experiences/LAS_ShooterGame_StandardComponents.uasset b/Plugins/GameFeatures/ShooterCore/Content/Experiences/LAS_ShooterGame_StandardComponents.uasset index f1e752ac..738267b5 100644 --- a/Plugins/GameFeatures/ShooterCore/Content/Experiences/LAS_ShooterGame_StandardComponents.uasset +++ b/Plugins/GameFeatures/ShooterCore/Content/Experiences/LAS_ShooterGame_StandardComponents.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1e7909769ff32a60cead0347ec482517da8de24bfbfb11334e0b6c8da99f25c8 -size 4669 +oid sha256:bce87d4259e5c11f572814cde66b02ec7b99db01f9bb1239b058bd6c87ac38d9 +size 5661 diff --git a/Plugins/GameFeatures/ShooterCore/Content/StyleTransfer/B_StyleTransferComponent.uasset b/Plugins/GameFeatures/ShooterCore/Content/StyleTransfer/B_StyleTransferComponent.uasset new file mode 100644 index 00000000..db869f0d --- /dev/null +++ b/Plugins/GameFeatures/ShooterCore/Content/StyleTransfer/B_StyleTransferComponent.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd792a3f116196beada967d2a89d7fc7b8f2e500b0df9a4cbf9620a143f77900 +size 59249 diff --git a/Plugins/GameFeatures/ShooterCore/Content/StyleTransfer/LAS_StyleTransfer.uasset b/Plugins/GameFeatures/ShooterCore/Content/StyleTransfer/LAS_StyleTransfer.uasset new file mode 100644 index 00000000..191201cb --- /dev/null +++ b/Plugins/GameFeatures/ShooterCore/Content/StyleTransfer/LAS_StyleTransfer.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf1ae66e4f7fb0e352c73eabaaa8ff2b178040283d1b94db3b1dc98f109e7b38 +size 4957 diff --git a/Plugins/GameFeatures/ShooterCore/Content/StyleTransfer/W_StyleSwitcher.uasset b/Plugins/GameFeatures/ShooterCore/Content/StyleTransfer/W_StyleSwitcher.uasset new file mode 100644 index 00000000..460f30df --- /dev/null +++ b/Plugins/GameFeatures/ShooterCore/Content/StyleTransfer/W_StyleSwitcher.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0685a372b4f52fedab5080b4b87d961a0a705beedb998ae67e4bb282463a9d1 +size 135885 diff --git a/Plugins/GameFeatures/ShooterMaps/Content/B_ShooterGame_Elimination_StyleTransfer.uasset b/Plugins/GameFeatures/ShooterMaps/Content/B_ShooterGame_Elimination_StyleTransfer.uasset new file mode 100644 index 00000000..4122fd49 --- /dev/null +++ b/Plugins/GameFeatures/ShooterMaps/Content/B_ShooterGame_Elimination_StyleTransfer.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bce72f676ed94be94e12655b6e3a0931bd13f43371d11518f44a15ca76038f08 +size 2535 diff --git a/Plugins/GameFeatures/ShooterMaps/Content/Maps/L_Expanse.umap b/Plugins/GameFeatures/ShooterMaps/Content/Maps/L_Expanse.umap index 76f6a320..e1db370c 100644 --- a/Plugins/GameFeatures/ShooterMaps/Content/Maps/L_Expanse.umap +++ b/Plugins/GameFeatures/ShooterMaps/Content/Maps/L_Expanse.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f61f72f56ca30acca18a494796c2f87bae8325744472061f6a21dd93b75ee780 -size 118486 +oid sha256:e2fb4f81f1ccf82f5481fb2ca30217460621bd3407923c61c6356e735187a2dc +size 118632 diff --git a/Plugins/StyleTransfer/Content/T_StyleImage.uasset b/Plugins/StyleTransfer/Content/T_StyleImage.uasset deleted file mode 100644 index 17f5efaf..00000000 --- a/Plugins/StyleTransfer/Content/T_StyleImage.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:227985c6eba3c1b58822fb5c3d49ad7ed56d07701cc28217dd4ff370505e4b94 -size 1382 diff --git a/Plugins/StyleTransfer/Content/T_StyleImage1.uasset b/Plugins/StyleTransfer/Content/T_StyleImage1.uasset deleted file mode 100644 index 2e2d88f3..00000000 --- a/Plugins/StyleTransfer/Content/T_StyleImage1.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:18a6f98f6e4130d271fcecf86981a43e92c46ce3d76b4c0c865d8397052a10e2 -size 1389 diff --git a/Plugins/StyleTransfer/Content/T_StyleImage2.uasset b/Plugins/StyleTransfer/Content/T_StyleImage2.uasset deleted file mode 100644 index f47e3b3b..00000000 --- a/Plugins/StyleTransfer/Content/T_StyleImage2.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:85cb8d0aeacae169534c57bdcbdd2a325c4b4ff1b2f309b45ce3d3ae19bd3df4 -size 1389 diff --git a/Plugins/StyleTransfer/Content/T_StyleImage3.uasset b/Plugins/StyleTransfer/Content/T_StyleImage3.uasset deleted file mode 100644 index 9e6fb32e..00000000 --- a/Plugins/StyleTransfer/Content/T_StyleImage3.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f0898935f5f7b922d5795e4b597de5c4ea58059469675eab5011fd5e7c964d73 -size 1389 diff --git a/Plugins/StyleTransfer/Content/T_StyleImage4.uasset b/Plugins/StyleTransfer/Content/T_StyleImage4.uasset deleted file mode 100644 index 784c5b09..00000000 --- a/Plugins/StyleTransfer/Content/T_StyleImage4.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:19d898256a66a5106051ae1ec2deca1d5d174c9e857ef6a75cf4f55e858738ad -size 1389 diff --git a/Plugins/StyleTransfer/Source/StyleTransfer/Private/StyleTransferModule.cpp b/Plugins/StyleTransfer/Source/StyleTransfer/Private/StyleTransferModule.cpp index 3df6b3e7..616d36fa 100644 --- a/Plugins/StyleTransfer/Source/StyleTransfer/Private/StyleTransferModule.cpp +++ b/Plugins/StyleTransfer/Source/StyleTransfer/Private/StyleTransferModule.cpp @@ -2,7 +2,6 @@ #include "StyleTransferModule.h" -#include "ShaderCore.h" #include "Interfaces/IPluginManager.h" #include "Logging/LogMacros.h" diff --git a/Plugins/StyleTransfer/Source/StyleTransfer/Private/StyleTransferSettings.h b/Plugins/StyleTransfer/Source/StyleTransfer/Private/StyleTransferSettings.h index acb6af92..98a3c75a 100644 --- a/Plugins/StyleTransfer/Source/StyleTransfer/Private/StyleTransferSettings.h +++ b/Plugins/StyleTransfer/Source/StyleTransfer/Private/StyleTransferSettings.h @@ -17,15 +17,15 @@ class STYLETRANSFER_API UStyleTransferSettings : public UDeveloperSettings public: UStyleTransferSettings(); - UPROPERTY(EditAnywhere, Config) + UPROPERTY(EditAnywhere, BlueprintReadOnly, Config) TSoftObjectPtr StyleTransferNetwork = nullptr; - UPROPERTY(EditAnywhere, Config) + UPROPERTY(EditAnywhere, BlueprintReadOnly, Config) TSoftObjectPtr StylePredictionNetwork = nullptr; - UPROPERTY(EditAnywhere, Config) + UPROPERTY(EditAnywhere, BlueprintReadOnly, Config) TArray> StyleTextures; - UPROPERTY(EditAnywhere, Config) + UPROPERTY(EditAnywhere, BlueprintReadOnly, Config) FRuntimeFloatCurve InterpolationCurve; }; diff --git a/Plugins/StyleTransfer/Source/StyleTransfer/Private/StyleTransferSubsystem.cpp b/Plugins/StyleTransfer/Source/StyleTransfer/Private/StyleTransferSubsystem.cpp index d0b819a2..7e037da9 100644 --- a/Plugins/StyleTransfer/Source/StyleTransfer/Private/StyleTransferSubsystem.cpp +++ b/Plugins/StyleTransfer/Source/StyleTransfer/Private/StyleTransferSubsystem.cpp @@ -40,27 +40,6 @@ void UStyleTransferSubsystem::Deinitialize() Super::Deinitialize(); } -bool UStyleTransferSubsystem::Tick(float DeltaTime) -{ - return false; - if (!GetWorld()) - return true; - - - if (StylePredictionInferenceContexts.Num() > 1) - { - const UStyleTransferSettings* StyleTransferSettings = GetDefault(); - const FRichCurve* InterpCurve = StyleTransferSettings->InterpolationCurve.GetRichCurveConst(); - float MinTime, MaxTime; - InterpCurve->GetTimeRange(MinTime, MaxTime); - const double Time = MinTime + FMath::Fmod(GetWorld()->GetTimeSeconds(), static_cast(MaxTime - MinTime)); - const float Alpha = InterpCurve->Eval(Time); - UE_LOG(LogStyleTransfer, VeryVerbose, TEXT("Alpha is %0.4f"), Alpha); - InterpolateStyles(StylePredictionInferenceContexts[0], StylePredictionInferenceContexts[1], Alpha); - } - return true; -} - void UStyleTransferSubsystem::StartStylizingViewport(FViewportClient* ViewportClient) { if (!StylePredictionNetwork->IsLoaded() || !StyleTransferNetwork->IsLoaded()) @@ -284,6 +263,26 @@ void UStyleTransferSubsystem::InterpolateStyles(int32 StylePredictionInferenceCo }); } +float UStyleTransferSubsystem::GetStyleAlpha() const +{ + return StyleAlpha; +} + +void UStyleTransferSubsystem::SetStyleAlpha(float Alpha) +{ + Alpha = FMath::Clamp(Alpha, 0.0f, float(StylePredictionInferenceContexts.Num() - 1)); + + StyleAlpha = Alpha; + + if(!StyleTransferSceneViewExtension.IsValid()) + return; + + const int32 FromStyle = FMath::FloorToInt32(StyleAlpha); + const int32 ToStyle = FMath::CeilToInt32(StyleAlpha); + + InterpolateStyles(StylePredictionInferenceContexts[FromStyle], StylePredictionInferenceContexts[ToStyle], StyleAlpha - FromStyle); +} + IRenderCaptureProvider* BeginRenderCapture(FRHICommandListImmediate& RHICommandList) { IRenderCaptureProvider* RenderCaptureProvider = nullptr; diff --git a/Plugins/StyleTransfer/Source/StyleTransfer/Public/StyleTransferSubsystem.h b/Plugins/StyleTransfer/Source/StyleTransfer/Public/StyleTransferSubsystem.h index 90db09d5..e3eaff07 100644 --- a/Plugins/StyleTransfer/Source/StyleTransfer/Public/StyleTransferSubsystem.h +++ b/Plugins/StyleTransfer/Source/StyleTransfer/Public/StyleTransferSubsystem.h @@ -13,7 +13,7 @@ * */ UCLASS() -class STYLETRANSFER_API UStyleTransferSubsystem : public UGameInstanceSubsystem, public FTSTickerObjectBase +class STYLETRANSFER_API UStyleTransferSubsystem : public UGameInstanceSubsystem { GENERATED_BODY() @@ -23,10 +23,6 @@ public: virtual void Deinitialize() override; // -- - // - FTSTickerObjectBase - virtual bool Tick(float DeltaTime) override final; - // -- - void StartStylizingViewport(FViewportClient* ViewportClient); void StopStylizingViewport(); @@ -34,6 +30,12 @@ public: void UpdateStyle(FString StyleTensorDataPath); void InterpolateStyles(int32 StylePredictionInferenceContextA, int32 StylePredictionInferenceContextB, float Alpha); + UFUNCTION(BlueprintPure) + float GetStyleAlpha() const; + + UFUNCTION(BlueprintCallable) + void SetStyleAlpha(float Alpha); + private: FStyleTransferSceneViewExtension::Ptr StyleTransferSceneViewExtension; @@ -46,9 +48,10 @@ private: TArray StylePredictionInferenceContexts; TSharedPtr StyleTransferInferenceContext; - int32 StyleTransferStyleParamsInputIndex = INDEX_NONE; + float StyleAlpha = 0.0f; + void HandleConsoleVariableChanged(IConsoleVariable*); void LoadNetworks(); diff --git a/Plugins/StyleTransfer/Source/StyleTransfer/StyleTransfer.Build.cs b/Plugins/StyleTransfer/Source/StyleTransfer/StyleTransfer.Build.cs index 56394da4..679be04e 100644 --- a/Plugins/StyleTransfer/Source/StyleTransfer/StyleTransfer.Build.cs +++ b/Plugins/StyleTransfer/Source/StyleTransfer/StyleTransfer.Build.cs @@ -45,7 +45,7 @@ public class StyleTransfer : ModuleRules "StyleTransferShaders", "PixWinPlugin", "InputDevice", - "DeveloperSettings", + "DeveloperSettings", } ); } diff --git a/Plugins/StyleTransfer/StyleTransfer.uplugin b/Plugins/StyleTransfer/StyleTransfer.uplugin index ae4d515c..e319b2fb 100644 --- a/Plugins/StyleTransfer/StyleTransfer.uplugin +++ b/Plugins/StyleTransfer/StyleTransfer.uplugin @@ -13,6 +13,9 @@ "IsBetaVersion": false, "IsExperimentalVersion": false, "Installed": false, + "ExplicitlyLoaded": false, + "EnabledByDefault": true, + "BuiltInInitialFeatureState": "Registered", "Modules": [ { "Name": "StyleTransfer",