From 8feee7b100f10454a2c2958201c780335cd71f10 Mon Sep 17 00:00:00 2001 From: PopcornFX Bot Date: Thu, 21 Sep 2023 11:42:47 +0200 Subject: [PATCH] PopcornFX Plugin v2.18.0 --- .../M_PK_Default_Mesh_AlphaBlend.uasset | 3 ++ Download_SDK_Desktop.bat | 2 +- Download_SDK_Mobile.bat | 2 +- PopcornFX.uplugin | 4 +- README.md | 4 +- Shaders/Private/PopcornFXVertexFactory.ush | 23 ++++++++--- .../Private/Assets/PopcornFXAssetDep.cpp | 1 + .../Private/Assets/PopcornFXFile.cpp | 4 +- .../Assets/PopcornFXRendererMaterial.cpp | 8 +++- .../PopcornFXAttributeSamplerSkinnedMesh.cpp | 20 +++++----- .../Attributes/PopcornFXAttributeSamplers.cpp | 2 + .../PopcornFXDependencyModuleLevelEditor.cpp | 36 ++++++++--------- .../PopcornFXDetailsAttributeList.cpp | 36 ++++++++--------- .../Private/Editor/EditorHelpers.cpp | 4 +- .../Private/Editor/PopcornFXEffectEditor.cpp | 4 +- .../PopcornFXCustomizationAssetDep.cpp | 20 +++++----- ...PopcornFXCustomizationRendererMaterial.cpp | 4 +- ...cornFXCustomizationSubRendererMaterial.cpp | 8 ++-- .../Private/GPUSim/PopcornFXGPUSim.cpp | 7 ++++ .../Private/GPUSim/PopcornFXGPUSim_D3D11.cpp | 7 +++- .../Private/GPUSim/PopcornFXGPUSim_D3D12.cpp | 40 +++++++++++++++---- .../GPUSim/PopcornFXSortComputeShader.cpp | 15 +++---- .../Private/HUD/PopcornFXHUDProfiler.cpp | 1 + .../Private/Internal/ParticleScene.cpp | 27 ++++++++----- .../Private/Internal/ParticleScene.h | 10 +++-- Source/PopcornFX/Private/Internal/Startup.cpp | 2 + .../Private/Platforms/PopcornFXPlatform.h | 10 ++++- .../Platforms/PopcornFXPlatformCommon.cpp | 29 +++++++++++--- Source/PopcornFX/Private/PopcornFXPlugin.cpp | 2 + Source/PopcornFX/Private/PopcornFXSDK.h | 3 ++ .../Render/BatchDrawer_Billboard_CPU.cpp | 5 ++- .../Render/BatchDrawer_Billboard_GPU.cpp | 4 +- .../Private/Render/BatchDrawer_Light.cpp | 4 +- .../Private/Render/BatchDrawer_Ribbon_CPU.cpp | 14 ++++++- .../Private/Render/BatchDrawer_Ribbon_CPU.h | 2 + .../Render/BatchDrawer_SkeletalMesh_CPU.cpp | 13 ++++-- .../Render/BatchDrawer_Triangle_CPU.cpp | 5 ++- .../PopcornFX/Private/Render/MaterialDesc.cpp | 4 ++ .../PopcornFX/Private/Render/MaterialDesc.h | 6 +++ .../Render/PopcornFXGPUVertexFactory.cpp | 5 +++ .../Render/PopcornFXMeshVertexFactory.cpp | 4 ++ .../PopcornFXSkeletalMeshVertexFactory.cpp | 4 ++ .../Private/Render/PopcornFXVertexFactory.cpp | 5 +++ .../Private/Render/PopcornFXVertexFactory.h | 2 + ...PopcornFXVertexFactoryShaderParameters.cpp | 1 + .../Private/Render/RenderBatchManager.cpp | 5 +++ .../Private/World/PopcornFXSceneComponent.cpp | 2 + .../Public/PopcornFXVersionGenerated.h | 4 +- .../Nodes/PopcornFXNode_DynamicField.cpp | 4 +- .../Private/PopcornFXEmitterFactory.cpp | 4 +- .../Private/PopcornFXFileFactory.cpp | 4 +- .../Private/PopcornFXFileReimportFactory.cpp | 4 +- 52 files changed, 300 insertions(+), 143 deletions(-) create mode 100644 Content/Materials/M_PK_Default_Mesh_AlphaBlend.uasset diff --git a/Content/Materials/M_PK_Default_Mesh_AlphaBlend.uasset b/Content/Materials/M_PK_Default_Mesh_AlphaBlend.uasset new file mode 100644 index 0000000..0efa80f --- /dev/null +++ b/Content/Materials/M_PK_Default_Mesh_AlphaBlend.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d9e9424bd336ee779c1c689b113855bf8348571d6e4b1ba05460ee1fa29bdda +size 100350 diff --git a/Download_SDK_Desktop.bat b/Download_SDK_Desktop.bat index 8be04d7..3d04272 100644 --- a/Download_SDK_Desktop.bat +++ b/Download_SDK_Desktop.bat @@ -6,7 +6,7 @@ setlocal bitsadmin /reset bitsadmin /create third_party_download_desktop -bitsadmin /addfile third_party_download_desktop https://downloads.popcornfx.com/Plugins/UE4/UnrealEngine_PopcornFXPlugin_2.17.4_Win64_Linux64_Mac64.7z "%~dp0\_PopcornFX_Runtime_SDK_Desktop.7z" +bitsadmin /addfile third_party_download_desktop https://downloads.popcornfx.com/Plugins/UE4/UnrealEngine_PopcornFXPlugin_2.18.0_Win64_Linux64_Mac64.7z "%~dp0\_PopcornFX_Runtime_SDK_Desktop.7z" bitsadmin /setpriority third_party_download_desktop "FOREGROUND" bitsadmin /resume third_party_download_desktop diff --git a/Download_SDK_Mobile.bat b/Download_SDK_Mobile.bat index 7a3f6b8..069f300 100644 --- a/Download_SDK_Mobile.bat +++ b/Download_SDK_Mobile.bat @@ -6,7 +6,7 @@ setlocal bitsadmin /reset bitsadmin /create third_party_download_mobile -bitsadmin /addfile third_party_download_mobile https://downloads.popcornfx.com/Plugins/UE4/UnrealEngine_PopcornFXPlugin_2.17.4_iOS_Android.7z "%~dp0\_PopcornFX_Runtime_SDK_Mobile.7z" +bitsadmin /addfile third_party_download_mobile https://downloads.popcornfx.com/Plugins/UE4/UnrealEngine_PopcornFXPlugin_2.18.0_iOS_Android.7z "%~dp0\_PopcornFX_Runtime_SDK_Mobile.7z" bitsadmin /setpriority third_party_download_mobile "FOREGROUND" bitsadmin /resume third_party_download_mobile diff --git a/PopcornFX.uplugin b/PopcornFX.uplugin index 67b7127..9dcea29 100644 --- a/PopcornFX.uplugin +++ b/PopcornFX.uplugin @@ -1,7 +1,7 @@ { "FileVersion": 3, - "Version": 21704, - "VersionName": "2.17.4", + "Version": 21800, + "VersionName": "2.18.0", "FriendlyName": "PopcornFX", "Description": "PopcornFX Realtime Particle Solution integration into Unreal Engine", "Category": "PopcornFX", diff --git a/README.md b/README.md index 90a993f..eb3ef58 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Unreal Engine PopcornFX Plugin Integrates the **PopcornFX Runtime SDK** into **Unreal Engine 4** and **Unreal Engine 5** as a Plugin. -* **Version:** `v2.17.4` -* **Unreal Engine:** `4.27`, `5.0`, `5.1` and `5.2` +* **Version:** `v2.18.0` +* **Unreal Engine:** `4.27`, `5.1`, `5.2` and `5.3` * **Supported platforms:** `Windows`, `MacOS`, `Linux`, `iOS`, `Android`, `PS4`, `PS5`, `XboxOne`, `Xbox Series`, `Switch` [Contact-us](http://www.popcornfx.com/contact-us/) to request access to the plugin for consoles. diff --git a/Shaders/Private/PopcornFXVertexFactory.ush b/Shaders/Private/PopcornFXVertexFactory.ush index 878fe9b..eeb1c1e 100644 --- a/Shaders/Private/PopcornFXVertexFactory.ush +++ b/Shaders/Private/PopcornFXVertexFactory.ush @@ -265,8 +265,10 @@ FVertexFactoryIntermediates GetVertexFactoryIntermediates(FVertexFactoryInput In Intermediates.SceneData = VF_GPUSCENE_GET_INTERMEDIATES(Input); #endif // (ENGINE_MAJOR_VERSION == 5) - uint vertexID = Input.VertexId; - uint particleID = 0; + uint particleID = 0; + const int vertexID = Input.VertexId; + const int vpp = PopcornFXBillboardVSUniforms.VPP; // Note: if tube/multiplane with differing vertex count end up being batched, this won't work. + const int vppHalf = vpp / 2 - 1; switch (PopcornFXBillboardVSUniforms.RendererType) { case Renderer_Billboard: @@ -279,9 +281,20 @@ FVertexFactoryIntermediates GetVertexFactoryIntermediates(FVertexFactoryInput In } case Renderer_Ribbon: { - // First two vertices within a quad: grab the current particle, last two: grab the next one - // Clamps to the total particle count to avoid overflowing the GPU sim buffers - particleID = min(vertexID / 4 + saturate((int)vertexID % 4 - 1), PopcornFXBillboardVSUniforms.TotalParticleCount - 1); + if (vertexID < PopcornFXBillboardVSUniforms.TubesPlanesOffset * 4) // No tube/multiplane batching yet with quad bb modes, but this might come. + { + // First two vertices within a quad: grab the current particle, last two: grab the next one + // Clamps to the total particle count to avoid overflowing the GPU sim buffers + particleID = min(vertexID / 4 + saturate(vertexID % 4 - 1), PopcornFXBillboardVSUniforms.TotalParticleCount - 1); + } + else + { + // First n (n being segmentCount/planeCount + 1) vertices: grab the current particle, last n: grab the next one + // Clamps to the total particle count to avoid overflowing the GPU sim buffers + particleID = min(PopcornFXBillboardVSUniforms.TubesPlanesOffset + (vertexID - (PopcornFXBillboardVSUniforms.TubesPlanesOffset * 4)) / vpp + + saturate(vertexID % vpp - vppHalf), + PopcornFXBillboardVSUniforms.TotalParticleCount - 1); + } break; } case Renderer_Triangle: diff --git a/Source/PopcornFX/Private/Assets/PopcornFXAssetDep.cpp b/Source/PopcornFX/Private/Assets/PopcornFXAssetDep.cpp index dfb533e..2ea2d04 100644 --- a/Source/PopcornFX/Private/Assets/PopcornFXAssetDep.cpp +++ b/Source/PopcornFX/Private/Assets/PopcornFXAssetDep.cpp @@ -12,6 +12,7 @@ #include "Assets/PopcornFXFont.h" #include "Assets/PopcornFXAnimTrack.h" #include "Assets/PopcornFXSimulationCache.h" +#include "AssetRegistry/AssetData.h" #include "Internal/FileSystemController_UE.h" diff --git a/Source/PopcornFX/Private/Assets/PopcornFXFile.cpp b/Source/PopcornFX/Private/Assets/PopcornFXFile.cpp index 04bfff4..b608621 100644 --- a/Source/PopcornFX/Private/Assets/PopcornFXFile.cpp +++ b/Source/PopcornFX/Private/Assets/PopcornFXFile.cpp @@ -17,11 +17,11 @@ #include "UObject/LinkerLoad.h" #if WITH_EDITOR # include "Factories/TextureFactory.h" -# if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +# if (ENGINE_MAJOR_VERSION == 5) # include "AssetRegistry/AssetRegistryModule.h" # else # include "AssetRegistryModule.h" -# endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +# endif // (ENGINE_MAJOR_VERSION == 5) # include "EditorReimportHandler.h" #endif // WITH_EDITOR diff --git a/Source/PopcornFX/Private/Assets/PopcornFXRendererMaterial.cpp b/Source/PopcornFX/Private/Assets/PopcornFXRendererMaterial.cpp index fc2dfd1..23364fe 100644 --- a/Source/PopcornFX/Private/Assets/PopcornFXRendererMaterial.cpp +++ b/Source/PopcornFX/Private/Assets/PopcornFXRendererMaterial.cpp @@ -15,6 +15,10 @@ #include "Engine/Texture2D.h" #include "Engine/StaticMesh.h" #include "Engine/SkeletalMesh.h" +#if (ENGINE_MAJOR_VERSION == 5) +# include "Engine/SkinnedAssetCommon.h" +#endif +#include "MaterialShared.h" #include "PopcornFXSDK.h" #include @@ -86,7 +90,7 @@ namespace for (int32 i = 0; i < params.StaticSwitchParameters.Num(); ++i) { FStaticSwitchParameter ¶m = params.StaticSwitchParameters[i]; -#elif (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION == 1) +#elif (ENGINE_MAJOR_VERSION == 5) for (int32 i = 0; i < params.EditorOnly.StaticSwitchParameters.Num(); ++i) { FStaticSwitchParameter ¶m = params.EditorOnly.StaticSwitchParameters[i]; @@ -94,7 +98,7 @@ namespace for (int32 i = 0; i < params.StaticSwitchParameters.Num(); ++i) { FStaticSwitchParameter ¶m = params.StaticSwitchParameters[i]; -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif if (param.ParameterInfo.Name == name) { diff --git a/Source/PopcornFX/Private/Attributes/PopcornFXAttributeSamplerSkinnedMesh.cpp b/Source/PopcornFX/Private/Attributes/PopcornFXAttributeSamplerSkinnedMesh.cpp index 515de11..09728f2 100644 --- a/Source/PopcornFX/Private/Attributes/PopcornFXAttributeSamplerSkinnedMesh.cpp +++ b/Source/PopcornFX/Private/Attributes/PopcornFXAttributeSamplerSkinnedMesh.cpp @@ -625,11 +625,11 @@ namespace { const TArray &GetMasterBoneMap(const USkinnedMeshComponent *skinnedMesh) { -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) return skinnedMesh->GetLeaderBoneMap(); #else return skinnedMesh->GetMasterBoneMap(); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) } const TArray &GetSections(const FSkeletalMeshLODRenderData *lodRenderData) @@ -672,11 +672,11 @@ namespace m_SkinnedMeshComponent = skinnedMesh; if (m_SkinnedMeshComponent == null) return false; -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) m_SkeletalMesh = Cast(m_SkinnedMeshComponent->GetSkinnedAsset()); #else m_SkeletalMesh = m_SkinnedMeshComponent->SkeletalMesh; -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) if (m_SkeletalMesh == null) return false; @@ -743,19 +743,19 @@ namespace } } -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) const USkinnedMeshComponent *masterPoseComponent = buildDesc.m_SkinnedMeshComponent->LeaderPoseComponent.Get(); #else const USkinnedMeshComponent *masterPoseComponent = buildDesc.m_SkinnedMeshComponent->MasterPoseComponent.Get(); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) const bool hasMasterPoseComponent = masterPoseComponent != null; if (hasMasterPoseComponent) { -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) PK_ASSERT(GetMasterBoneMap(buildDesc.m_SkinnedMeshComponent).Num() == SkeletalMeshRefSkeleton(Cast(buildDesc.m_SkinnedMeshComponent->GetSkinnedAsset())).GetNum()); #else PK_ASSERT(GetMasterBoneMap(buildDesc.m_SkinnedMeshComponent).Num() == SkeletalMeshRefSkeleton(buildDesc.m_SkinnedMeshComponent->SkeletalMesh).GetNum()); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) } PK_ONLY_IF_ASSERTS(u32 totalVertices = 0); @@ -899,11 +899,11 @@ bool UPopcornFXAttributeSamplerSkinnedMesh::BuildInitialPose() if (buildDesc.m_LODRenderData->SkinWeightVertexBuffer.GetBoneInfluenceType() == UnlimitedBoneInfluence) { -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) UE_LOG(LogPopcornFXAttributeSamplerSkinned, Warning, TEXT("Cannot build mesh '%s' for sampling: Unlimited bone influences not supported for sampling"), *buildDesc.m_SkinnedMeshComponent->GetSkinnedAsset()->GetName()); #else UE_LOG(LogPopcornFXAttributeSamplerSkinned, Warning, TEXT("Cannot build mesh '%s' for sampling: Unlimited bone influences not supported for sampling"), *buildDesc.m_SkinnedMeshComponent->SkeletalMesh->GetName()); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) return false; } diff --git a/Source/PopcornFX/Private/Attributes/PopcornFXAttributeSamplers.cpp b/Source/PopcornFX/Private/Attributes/PopcornFXAttributeSamplers.cpp index ffa64ee..8ac36a9 100644 --- a/Source/PopcornFX/Private/Attributes/PopcornFXAttributeSamplers.cpp +++ b/Source/PopcornFX/Private/Attributes/PopcornFXAttributeSamplers.cpp @@ -33,6 +33,8 @@ #include "VectorField/VectorFieldStatic.h" #include "Serialization/BulkData.h" #include "Curves/RichCurve.h" +#include "Engine/Texture.h" +#include "Engine/Texture2D.h" #if WITH_EDITOR # include "Editor.h" diff --git a/Source/PopcornFX/Private/DependencyModules/PopcornFXDependencyModuleLevelEditor.cpp b/Source/PopcornFX/Private/DependencyModules/PopcornFXDependencyModuleLevelEditor.cpp index fd55b40..7c92961 100644 --- a/Source/PopcornFX/Private/DependencyModules/PopcornFXDependencyModuleLevelEditor.cpp +++ b/Source/PopcornFX/Private/DependencyModules/PopcornFXDependencyModuleLevelEditor.cpp @@ -110,31 +110,31 @@ void FPopcornFXDependencyModuleLevelEditor::FillPopcornFXMenu(FMenuBuilder &menu menuBuilder.AddMenuEntry( LOCTEXT("DocumentationTitle", "Documentation"), LOCTEXT("DocumentationTooltip", "Opens the PopcornFX Wiki"), -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) FSlateIcon(FAppStyle::GetAppStyleSetName(), "LevelEditor.BrowseDocumentation"), #else FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.BrowseDocumentation"), -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) FUIAction(FExecuteAction::CreateRaw(this, &FPopcornFXDependencyModuleLevelEditor::OpenDocumentationURL, *FPopcornFXPlugin::DocumentationURL()))); menuBuilder.AddMenuEntry( LOCTEXT("WikiTitle", "Plugin Wiki"), LOCTEXT("WikiTooltip", "Opens the PopcornFX UE plugin wiki"), -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) FSlateIcon(FAppStyle::GetAppStyleSetName(), "LevelEditor.BrowseDocumentation"), #else FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.BrowseDocumentation"), -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) FUIAction(FExecuteAction::CreateRaw(this, &FPopcornFXDependencyModuleLevelEditor::OpenDocumentationURL, *FPopcornFXPlugin::PluginWikiURL()))); menuBuilder.AddMenuEntry( LOCTEXT("DiscordTitle", "Discord"), LOCTEXT("DiscordTooltip", "Join PopcornFX Discord server"), -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) FSlateIcon(FAppStyle::GetAppStyleSetName(), "LevelEditor.BrowseDocumentation"), #else FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.BrowseDocumentation"), -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) FUIAction(FExecuteAction::CreateRaw(this, &FPopcornFXDependencyModuleLevelEditor::OpenDocumentationURL, *FPopcornFXPlugin::DiscordURL()))); } menuBuilder.EndSection(); @@ -151,11 +151,11 @@ void FPopcornFXDependencyModuleLevelEditor::FillPopcornFXMenu(FMenuBuilder &menu menuBuilder.AddMenuEntry( LOCTEXT("OpenSourcePackTitle", "Open PopcornFX Editor Project"), tooltip, -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) FSlateIcon(FAppStyle::GetAppStyleSetName(), "PopcornFXLevelEditor.OpenSourcePack"), #else FSlateIcon(FEditorStyle::GetStyleSetName(), "PopcornFXLevelEditor.OpenSourcePack"), -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) FUIAction(FExecuteAction::CreateRaw(this, &FPopcornFXDependencyModuleLevelEditor::OpenSourcePack), FCanExecuteAction::CreateRaw(this, &FPopcornFXDependencyModuleLevelEditor::CanOpenSourcePack))); } @@ -166,51 +166,51 @@ void FPopcornFXDependencyModuleLevelEditor::FillPopcornFXMenu(FMenuBuilder &menu menuBuilder.AddMenuEntry( LOCTEXT("RuntimeSettingsTitle", "Runtime settings"), LOCTEXT("RuntimeSettingsTooltip", "Opens the project runtime settings"), -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) FSlateIcon(FAppStyle::GetAppStyleSetName(), "ProjectSettings.TabIcon"), #else FSlateIcon(FEditorStyle::GetStyleSetName(), "ProjectSettings.TabIcon"), -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) FUIAction(FExecuteAction::CreateRaw(this, &FPopcornFXDependencyModuleLevelEditor::OpenSettings, TEXT("PopcornFXSettings")))); menuBuilder.AddMenuEntry( LOCTEXT("EditorSettingsTitle", "Editor settings"), LOCTEXT("EditorSettingsTooltip", "Opens the project editor settings"), -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) FSlateIcon(FAppStyle::GetAppStyleSetName(), "ProjectSettings.TabIcon"), #else FSlateIcon(FEditorStyle::GetStyleSetName(), "ProjectSettings.TabIcon"), -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) FUIAction(FExecuteAction::CreateRaw(this, &FPopcornFXDependencyModuleLevelEditor::OpenSettings, TEXT("PopcornFXSettingsEditor")))); menuBuilder.AddMenuEntry( LOCTEXT("CmdStatPopcornFXTitle", "Cmd stat PopcornFX"), LOCTEXT("CmdStatPopcornFXTooltip", "Runs command \"stat PopcornFX\": Toggles PopcornFX Stats display."), -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) FSlateIcon(FAppStyle::GetAppStyleSetName(), "Log.TabIcon"), #else FSlateIcon(FEditorStyle::GetStyleSetName(), "Log.TabIcon"), -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) FUIAction(FExecuteAction::CreateRaw(this, &FPopcornFXDependencyModuleLevelEditor::RunCommand, TEXT("stat PopcornFX")))); menuBuilder.AddMenuEntry( LOCTEXT("CmdPopcornFXProfilerHUDTitle", "Cmd ToggleProfilerHUD"), LOCTEXT("CmdPopcornFXProfilerHUDTooltip", "Runs command \"PopcornFX.ToggleProfilerHUD\": Toggles PopcornFX Profiler HUD."), -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) FSlateIcon(FAppStyle::GetAppStyleSetName(), "Log.TabIcon"), #else FSlateIcon(FEditorStyle::GetStyleSetName(), "Log.TabIcon"), -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) FUIAction(FExecuteAction::CreateRaw(this, &FPopcornFXDependencyModuleLevelEditor::RunCommand, TEXT("PopcornFX.ToggleProfilerHUD")))); menuBuilder.AddMenuEntry( LOCTEXT("CmdPopcornFXDebugHUDTitle", "Cmd ToggleMemoryHUD"), LOCTEXT("CmdPopcornFXDebugHUDTooltip", "Runs command \"PopcornFX.ToggleMemoryHUD\": Toggles PopcornFX Memory HUD."), -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) FSlateIcon(FAppStyle::GetAppStyleSetName(), "Log.TabIcon"), #else FSlateIcon(FEditorStyle::GetStyleSetName(), "Log.TabIcon"), -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) FUIAction(FExecuteAction::CreateRaw(this, &FPopcornFXDependencyModuleLevelEditor::RunCommand, TEXT("PopcornFX.ToggleMemoryHUD")))); } diff --git a/Source/PopcornFX/Private/Editor/CustomizeDetails/PopcornFXDetailsAttributeList.cpp b/Source/PopcornFX/Private/Editor/CustomizeDetails/PopcornFXDetailsAttributeList.cpp index e0f9f5f..84fe137 100644 --- a/Source/PopcornFX/Private/Editor/CustomizeDetails/PopcornFXDetailsAttributeList.cpp +++ b/Source/PopcornFX/Private/Editor/CustomizeDetails/PopcornFXDetailsAttributeList.cpp @@ -392,11 +392,11 @@ namespace TSharedPtr inlineSplitter; SAssignNew(inlineSplitter, SSplitter) -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) .Style(FAppStyle::Get(), "DetailsView.Splitter") #else .Style(FEditorStyle::Get(), "DetailsView.Splitter") -#endif (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) .PhysicalSplitterHandleSize(1.0f) .HitDetectionSplitterHandleSize(5.0f) + SSplitter::Slot() @@ -439,11 +439,11 @@ namespace .Padding(0.0f, 2.0f) [ SNew(SSplitter) -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) .Style(FAppStyle::Get(), "DetailsView.Splitter") #else .Style(FEditorStyle::Get(), "DetailsView.Splitter") -#endif (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) .PhysicalSplitterHandleSize(1.0f) .HitDetectionSplitterHandleSize(5.0f) + SSplitter::Slot() @@ -879,19 +879,19 @@ namespace .OnClicked(this, &TSelf::OnDimResetClicked, dimi) .Visibility(this, &TSelf::GetDimResetVisibility, dimi) .ToolTipText(LOCTEXT("ResetToDefaultToolTip", "Reset to Default")) -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) .ButtonStyle(FAppStyle::Get(), "NoBorder") #else .ButtonStyle(FEditorStyle::Get(), "NoBorder") -#endif (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) .Content() [ SNew(SImage) -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) .Image(FAppStyle::GetBrush("PropertyWindow.DiffersFromDefault")) #else .Image(FEditorStyle::GetBrush("PropertyWindow.DiffersFromDefault")) -#endif (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) ]; } @@ -901,19 +901,19 @@ namespace .OnClicked(this, &TSelf::OnResetClicked) .Visibility(this, &TSelf::GetResetVisibility) .ToolTipText(LOCTEXT("ResetToDefaultToolTip", "Reset to Default")) -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) .ButtonStyle(FAppStyle::Get(), "NoBorder") #else .ButtonStyle(FEditorStyle::Get(), "NoBorder") -#endif (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) .Content() [ SNew(SImage) -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) .Image(FAppStyle::GetBrush("PropertyWindow.DiffersFromDefault")) #else .Image(FEditorStyle::GetBrush("PropertyWindow.DiffersFromDefault")) -#endif (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) ]; } @@ -1272,11 +1272,11 @@ namespace TSharedPtr inlineSplitter; SAssignNew(inlineSplitter, SSplitter) -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) .Style(FAppStyle::Get(), "DetailsView.Splitter") #else .Style(FEditorStyle::Get(), "DetailsView.Splitter") -#endif (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) .PhysicalSplitterHandleSize(1.0f) .HitDetectionSplitterHandleSize(5.0f) + SSplitter::Slot() @@ -1353,11 +1353,11 @@ namespace .FillHeight(1.0f) [ SNew(SSplitter) -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) .Style(FAppStyle::Get(), "DetailsView.Splitter") #else .Style(FEditorStyle::Get(), "DetailsView.Splitter") -#endif (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) .PhysicalSplitterHandleSize(1.0f) .HitDetectionSplitterHandleSize(5.0f) + SSplitter::Slot() @@ -1624,11 +1624,11 @@ namespace [ SNew(STextBlock) .Text(m_CategoryName) -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) .Font(FAppStyle::GetFontStyle("PropertyWindow.NormalFont")) #else .Font(FEditorStyle::GetFontStyle("PropertyWindow.NormalFont")) -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) ] ] ] diff --git a/Source/PopcornFX/Private/Editor/EditorHelpers.cpp b/Source/PopcornFX/Private/Editor/EditorHelpers.cpp index 7ff4ff7..23f61c2 100644 --- a/Source/PopcornFX/Private/Editor/EditorHelpers.cpp +++ b/Source/PopcornFX/Private/Editor/EditorHelpers.cpp @@ -11,11 +11,11 @@ #include "AssetToolsModule.h" #include "UObject/NameTypes.h" #include "FileHelpers.h" -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) # include "AssetRegistry/AssetRegistryModule.h" #else # include "AssetRegistryModule.h" -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) #include "IAssetTools.h" #include "Factories/Factory.h" #include "Editor.h" diff --git a/Source/PopcornFX/Private/Editor/PopcornFXEffectEditor.cpp b/Source/PopcornFX/Private/Editor/PopcornFXEffectEditor.cpp index 7b8e96d..334959f 100644 --- a/Source/PopcornFX/Private/Editor/PopcornFXEffectEditor.cpp +++ b/Source/PopcornFX/Private/Editor/PopcornFXEffectEditor.cpp @@ -191,11 +191,11 @@ void FPopcornFXEffectEditor::FillEffectToolbar(FToolBarBuilder &toolbarBuilder) .ToolTipText(LOCTEXT("DelayTooltip", "Time before the emitter restarts")) .MinValue(0.0f) .MaxValue(20.0f) -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) .Font(FAppStyle::GetFontStyle(TEXT("MenuItem.Font"))) #else .Font(FEditorStyle::GetFontStyle(TEXT("MenuItem.Font"))) -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) .Value(PreviewViewport.Get(), &SPopcornFXEffectPreviewViewport::OnGetLoopDelayValue) .OnValueChanged(PreviewViewport.Get(), &SPopcornFXEffectPreviewViewport::OnLoopDelayValueChanged) ] diff --git a/Source/PopcornFX/Private/Editor/PropertyCustomization/PopcornFXCustomizationAssetDep.cpp b/Source/PopcornFX/Private/Editor/PropertyCustomization/PopcornFXCustomizationAssetDep.cpp index 7895ab0..d623145 100644 --- a/Source/PopcornFX/Private/Editor/PropertyCustomization/PopcornFXCustomizationAssetDep.cpp +++ b/Source/PopcornFX/Private/Editor/PropertyCustomization/PopcornFXCustomizationAssetDep.cpp @@ -15,11 +15,11 @@ #include "DetailWidgetRow.h" #include "PropertyCustomizationHelpers.h" #include "AssetThumbnail.h" -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) # include "AssetRegistry/AssetData.h" #else # include "AssetData.h" -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) #include "Widgets/SBoxPanel.h" #include "Widgets/Input/SEditableTextBox.h" #include "Widgets/Layout/SSpacer.h" @@ -75,11 +75,11 @@ void FPopcornFXCustomizationAssetDep::CustomizeHeader( // Source\Editor\PropertyEditor\Private\UserInterface\PropertyEditor\PropertyEditorConstants.cpp static const FName PropertyFontStyle( TEXT("PropertyWindow.NormalFont") ); -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) FSlateFontInfo FontStyle = FAppStyle::GetFontStyle(PropertyFontStyle); #else FSlateFontInfo FontStyle = FEditorStyle::GetFontStyle(PropertyFontStyle); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) HeaderRow.NameContent() .MinDesiredWidth(125.f * 3.f) @@ -117,19 +117,19 @@ void FPopcornFXCustomizationAssetDep::CustomizeHeader( .OnClicked(this, &FPopcornFXCustomizationAssetDep::OnResetClicked) .Visibility(this, &FPopcornFXCustomizationAssetDep::GetResetVisibility) .ToolTipText(LOCTEXT("ResetToDefaultToolTip", "Reset to Default")) -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) .ButtonStyle(FAppStyle::Get(), "NoBorder") #else .ButtonStyle(FEditorStyle::Get(), "NoBorder") -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) .Content() [ SNew(SImage) -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) .Image(FAppStyle::GetBrush("PropertyWindow.DiffersFromDefault")) #else .Image(FEditorStyle::GetBrush("PropertyWindow.DiffersFromDefault")) -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) ] ] ] @@ -184,11 +184,11 @@ bool FPopcornFXCustomizationAssetDep::OnFilterAssetPicker(const FAssetData& InAs UClass *assetClass = InAssetData.GetClass(); // return filterOut; return !self->IsCompatibleClass(assetClass) || -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) !InAssetData.GetSoftObjectPath().ToString().StartsWith(FPopcornFXPlugin::Get().Settings()->PackMountPoint); #else !InAssetData.ObjectPath.ToString().StartsWith(FPopcornFXPlugin::Get().Settings()->PackMountPoint); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) } FReply FPopcornFXCustomizationAssetDep::OnResetClicked() diff --git a/Source/PopcornFX/Private/Editor/PropertyCustomization/PopcornFXCustomizationRendererMaterial.cpp b/Source/PopcornFX/Private/Editor/PropertyCustomization/PopcornFXCustomizationRendererMaterial.cpp index d4f9a7f..672357e 100644 --- a/Source/PopcornFX/Private/Editor/PropertyCustomization/PopcornFXCustomizationRendererMaterial.cpp +++ b/Source/PopcornFX/Private/Editor/PropertyCustomization/PopcornFXCustomizationRendererMaterial.cpp @@ -57,11 +57,11 @@ void FPopcornFXCustomizationRendererMaterial::CustomizeHeader( ; static const FName propertyFontStyle(TEXT("PropertyWindow.NormalFont")); -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) FSlateFontInfo fontStyle = FAppStyle::GetFontStyle(propertyFontStyle); #else FSlateFontInfo fontStyle = FEditorStyle::GetFontStyle(propertyFontStyle); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) uint32 numBaseObjects; //baseObjectNames->GetNumChildren(numBaseObjects); diff --git a/Source/PopcornFX/Private/Editor/PropertyCustomization/PopcornFXCustomizationSubRendererMaterial.cpp b/Source/PopcornFX/Private/Editor/PropertyCustomization/PopcornFXCustomizationSubRendererMaterial.cpp index 4ce667c..3bada8a 100644 --- a/Source/PopcornFX/Private/Editor/PropertyCustomization/PopcornFXCustomizationSubRendererMaterial.cpp +++ b/Source/PopcornFX/Private/Editor/PropertyCustomization/PopcornFXCustomizationSubRendererMaterial.cpp @@ -194,19 +194,19 @@ void FPopcornFXCustomizationSubRendererMaterial::CustomizeHeader( // too slow .Visibility(this, &FPopcornFXCustomizationSubRendererMaterial::GetResetVisibility) .ToolTipText(LOCTEXT("ResetToDefaultToolTip", "Reset to Default")) -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) .ButtonStyle(FAppStyle::Get(), "NoBorder") #else .ButtonStyle(FEditorStyle::Get(), "NoBorder") -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) .Content() [ SNew(SImage) -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) .Image(FAppStyle::GetBrush("PropertyWindow.DiffersFromDefault")) #else .Image(FEditorStyle::GetBrush("PropertyWindow.DiffersFromDefault")) -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) ] ] ] diff --git a/Source/PopcornFX/Private/GPUSim/PopcornFXGPUSim.cpp b/Source/PopcornFX/Private/GPUSim/PopcornFXGPUSim.cpp index d377cf8..7b3c1da 100644 --- a/Source/PopcornFX/Private/GPUSim/PopcornFXGPUSim.cpp +++ b/Source/PopcornFX/Private/GPUSim/PopcornFXGPUSim.cpp @@ -13,6 +13,13 @@ PK_STATIC_ASSERT(false); #endif +#if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 2) +# include "DataDrivenShaderPlatformInfo.h" +# if (ENGINE_MINOR_VERSION >= 3) +# include "RHIStaticShaderPlatformNames.h" +# endif +#endif + #include #include diff --git a/Source/PopcornFX/Private/GPUSim/PopcornFXGPUSim_D3D11.cpp b/Source/PopcornFX/Private/GPUSim/PopcornFXGPUSim_D3D11.cpp index d6d9240..84e529a 100644 --- a/Source/PopcornFX/Private/GPUSim/PopcornFXGPUSim_D3D11.cpp +++ b/Source/PopcornFX/Private/GPUSim/PopcornFXGPUSim_D3D11.cpp @@ -102,8 +102,11 @@ FRHIVertexBuffer *StreamBufferResourceToRHI(const PopcornFX::SParticleStreamB PK_ASSERT((desc.BindFlags & D3D11_BIND_SHADER_RESOURCE) != 0); // is BUF_ShaderResource PK_ASSERT((desc.Usage & D3D11_USAGE_DYNAMIC) == 0); // no BUF_AnyDynamic PK_ASSERT((desc.CPUAccessFlags) == 0); // no BUF_AnyDynamic - - const EBufferUsageFlags bufferUsage = BUF_UnorderedAccess | BUF_ByteAddressBuffer | BUF_ShaderResource; + + // Fixed #12899: removed BUF_UnorderedAccess | BUF_ByteAddressBuffer from the buffer usage, as it leads to crashes on some AMD GPU hardware. + // The driver does not properly set the buffer stride as it considers it raw (although the buffer isn't bound as a raw buffer). + // The BUF_UnorderedAccess could technically be left active, but none of the UE plugin shaders are binding any of the PK sim streams as UAV anyways. + const EBufferUsageFlags bufferUsage = BUF_ShaderResource; #if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 3) FD3D11Buffer *buffer = new FD3D11Buffer(stream->m_Buffer, FRHIBufferDesc(bytes, stride, bufferUsage)); #elif (ENGINE_MAJOR_VERSION == 5) diff --git a/Source/PopcornFX/Private/GPUSim/PopcornFXGPUSim_D3D12.cpp b/Source/PopcornFX/Private/GPUSim/PopcornFXGPUSim_D3D12.cpp index d40df6f..6ce8622 100644 --- a/Source/PopcornFX/Private/GPUSim/PopcornFXGPUSim_D3D12.cpp +++ b/Source/PopcornFX/Private/GPUSim/PopcornFXGPUSim_D3D12.cpp @@ -141,11 +141,21 @@ void FD3D12ResourceLocation::SetResource(FD3D12Resource* Value) } UnderlyingResource = Value; -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) ResidencyHandle = &UnderlyingResource->GetResidencyHandle(); #else ResidencyHandle = UnderlyingResource->GetResidencyHandle(); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) +} + +//---------------------------------------------------------------------------- + +namespace D3D12RHI +{ + void VerifyD3D12Result(HRESULT Result, const ANSICHAR* Code, const ANSICHAR* Filename, uint32 Line, ID3D12Device* Device, FString Message) + { + check(FAILED(Result)); + } } //---------------------------------------------------------------------------- @@ -206,24 +216,35 @@ FD3D12Resource::FD3D12Resource(FD3D12Device* ParentDevice, } InitalizeResourceState(InitialState, InResourceStateMode, InDefaultResourceState); -} +#if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 3) + if (!IsPlacedResource()) + { + ResidencyHandle = MakeUnique(); + } -namespace D3D12RHI -{ - void VerifyD3D12Result(HRESULT Result, const ANSICHAR* Code, const ANSICHAR* Filename, uint32 Line, ID3D12Device* Device, FString Message) + if (Desc.bReservedResource) { - check(FAILED(Result)); + checkf(Heap == nullptr, TEXT("Reserved resources are not expected to have a heap")); + ReservedResourceData = MakeUnique(); } +#endif // (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 3) } //---------------------------------------------------------------------------- FD3D12Resource::~FD3D12Resource() { +#if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 3) + if (!IsPlacedResource() && D3DX12Residency::IsInitialized(*ResidencyHandle)) + { + D3DX12Residency::EndTrackingObject(GetParentDevice()->GetResidencyManager(), *ResidencyHandle); + } +#else if (D3DX12Residency::IsInitialized(ResidencyHandle)) { D3DX12Residency::EndTrackingObject(GetParentDevice()->GetResidencyManager(), ResidencyHandle); } +#endif // (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 3) } //---------------------------------------------------------------------------- @@ -352,7 +373,10 @@ FRHIVertexBuffer *StreamBufferResourceToRHI(const PopcornFX::SParticleStreamBuff FD3D12DynamicRHI *dynamicRHI = static_cast(GDynamicRHI); FD3D12Device *device = dynamicRHI->GetAdapter().GetDevice(0); - const EBufferUsageFlags bufferUsage = BUF_UnorderedAccess | BUF_ByteAddressBuffer | BUF_ShaderResource; + // Fixed #12899: removed BUF_UnorderedAccess | BUF_ByteAddressBuffer from the buffer usage, as it leads to crashes on some AMD GPU hardware. + // The driver does not properly set the buffer stride as it considers it raw (although the buffer isn't bound as a raw buffer). + // The BUF_UnorderedAccess could technically be left active, but none of the UE plugin shaders are binding any of the PK sim streams as UAV anyways. + const EBufferUsageFlags bufferUsage = BUF_ShaderResource; const D3D12_RESOURCE_STATES resourceState = D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE | D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE; FD3D12Resource *resource = new FD3D12Resource(device, device->GetVisibilityMask(), stream->m_Resource, resourceState, ED3D12ResourceStateMode::Default, resourceState, desc, NULL, D3D12_HEAP_TYPE_DEFAULT); diff --git a/Source/PopcornFX/Private/GPUSim/PopcornFXSortComputeShader.cpp b/Source/PopcornFX/Private/GPUSim/PopcornFXSortComputeShader.cpp index ef45719..24a4a01 100644 --- a/Source/PopcornFX/Private/GPUSim/PopcornFXSortComputeShader.cpp +++ b/Source/PopcornFX/Private/GPUSim/PopcornFXSortComputeShader.cpp @@ -8,6 +8,7 @@ #include "GPUSim/PopcornFXGPUSim.h" #include "Render/PopcornFXShaderUtils.h" +#include "PipelineStateCache.h" #include "ShaderParameterUtils.h" #include "SceneUtils.h" @@ -258,7 +259,7 @@ void FPopcornFXSortComputeShader_Sorter::DispatchGenIndiceBatch(FRHICommandList& PK_ASSERT(params.m_Count > 0); -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 3) +#if (ENGINE_MAJOR_VERSION == 5) SetComputePipelineState(RHICmdList, shader); #else RHICmdList.SetComputeShader(shader); @@ -390,11 +391,11 @@ void FPopcornFXSortComputeShader_Sorter::DispatchSort(FRHICommandList& RHICmdLis //---------------------------------------------------------------------------- // Up Sweep -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) SetComputePipelineState(RHICmdList, upSweepShader); #else RHICmdList.SetComputeShader(upSweepShader); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) if (PK_VERIFY(upSweep->InKeys.IsBound())) { @@ -440,11 +441,11 @@ void FPopcornFXSortComputeShader_Sorter::DispatchSort(FRHICommandList& RHICmdLis //---------------------------------------------------------------------------- // Up Sweep Offsets -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) SetComputePipelineState(RHICmdList, upSweepOffsetsShader); #else RHICmdList.SetComputeShader(upSweepOffsetsShader); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) if (PK_VERIFY(upSweepOffsets->InOutOffsets.IsBound())) { @@ -480,11 +481,11 @@ void FPopcornFXSortComputeShader_Sorter::DispatchSort(FRHICommandList& RHICmdLis //---------------------------------------------------------------------------- // Down Sweep -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) SetComputePipelineState(RHICmdList, downSweepShader); #else RHICmdList.SetComputeShader(downSweepShader); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) if (PK_VERIFY(downSweep->InOffsets.IsBound())) { diff --git a/Source/PopcornFX/Private/HUD/PopcornFXHUDProfiler.cpp b/Source/PopcornFX/Private/HUD/PopcornFXHUDProfiler.cpp index b680957..cd37dec 100644 --- a/Source/PopcornFX/Private/HUD/PopcornFXHUDProfiler.cpp +++ b/Source/PopcornFX/Private/HUD/PopcornFXHUDProfiler.cpp @@ -12,6 +12,7 @@ #include "Engine/Canvas.h" #include "Debug/DebugDrawService.h" #include "Engine/Engine.h" +#include "UObject/UObjectIterator.h" #include "PopcornFXSceneComponent.h" diff --git a/Source/PopcornFX/Private/Internal/ParticleScene.cpp b/Source/PopcornFX/Private/Internal/ParticleScene.cpp index 848fa0c..53d74ef 100644 --- a/Source/PopcornFX/Private/Internal/ParticleScene.cpp +++ b/Source/PopcornFX/Private/Internal/ParticleScene.cpp @@ -50,6 +50,9 @@ # include "PBDRigidsSolver.h" # include "Chaos/ChaosScene.h" # include "Chaos/PBDRigidsEvolutionGBF.h" + +# include "Physics/Experimental/PhysScene_Chaos.h" +# include "PhysicsInterfaceDeclaresCore.h" #endif #include "Collision.h" @@ -61,6 +64,7 @@ #include "RenderingThread.h" #include "Engine/LocalPlayer.h" #include "Engine/Engine.h" +#include "Engine/GameViewportClient.h" #include "Materials/MaterialInstanceConstant.h" #include "Materials/MaterialInstanceDynamic.h" #include "PhysicalMaterials/PhysicalMaterial.h" @@ -68,8 +72,11 @@ #if WITH_EDITOR # include "Editor.h" # include "LevelEditorViewport.h" +# include "Settings/LevelEditorViewportSettings.h" #endif // WITH_EDITOR +#include "UnrealClient.h" + #include "PopcornFXSDK.h" #include #include @@ -1365,7 +1372,7 @@ class FBlockQueryCallbackChaos : public ICollisionQueryFilterCallbackBase return ECollisionQueryHitType::Block; } -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) virtual ECollisionQueryHitType PostFilter(const FCollisionFilterData &filterData, const ChaosInterface::FPTQueryHit &hit) override { return ECollisionQueryHitType::Block; } virtual ECollisionQueryHitType PreFilter(const FCollisionFilterData &filterData, const Chaos::FPerShapeData &shape, const Chaos::FGeometryParticleHandle &actor) { @@ -1379,7 +1386,7 @@ class FBlockQueryCallbackChaos : public ICollisionQueryFilterCallbackBase virtual PxQueryHitType::Enum preFilter(const PxFilterData& filterData, const PxShape* shape, const PxRigidActor* actor, PxHitFlags& queryFlags) { PK_ASSERT_NOT_REACHED(); return PxQueryHitType::eNONE; } virtual PxQueryHitType::Enum postFilter(const PxFilterData& filterData, const PxQueryHit& hit) { PK_ASSERT_NOT_REACHED(); return PxQueryHitType::eNONE; } # endif // PHYSICS_INTERFACE_PHYSX -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) }; #endif @@ -2148,7 +2155,7 @@ static void _D3D11_ExecuteImmTasksArray(CParticleScene *self) // Fake a UAV transition so UE is happy, and disables UAV overlap (undefined behavior, generates random artefacts in the D3D11 GPU sim) // This is ugly, but they removed the implementations of FD3D11DynamicRHI::RHIBeginUAVOverlap/RHIEndUAVOverlap in 4.26. FRHICommandListImmediate &RHICmdList = FRHICommandListExecutor::GetImmediateCommandList(); -#if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) if (self->m_D3D11_DummyResource == null) { check(self->m_D3D11_DummyView == null); @@ -2167,7 +2174,7 @@ static void _D3D11_ExecuteImmTasksArray(CParticleScene *self) RHICmdList.Transition(FRHITransitionInfo(self->m_D3D11_DummyView, ERHIAccess::UAVGraphics, ERHIAccess::UAVCompute)); #else RHICmdList.Transition(FRHITransitionInfo((FRHIUnorderedAccessView*)0x1234, ERHIAccess::UAVGraphics, ERHIAccess::UAVCompute)); -#endif // (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) RHICmdList.ImmediateFlush(EImmediateFlushType::FlushRHIThread); for (u32 i = 0; i < m_Exec_D3D11_Tasks.Count(); ++i) @@ -2208,7 +2215,7 @@ void CParticleScene::D3D11_Destroy() // GPU_Destroy() updateManager_D3D11->BindD3D11(null, null); } } -#if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) if (m_D3D11_DummyResource != null && m_D3D11_DummyView != null) { // Delete view, release resource for proper ref count tracking. @@ -2222,7 +2229,7 @@ void CParticleScene::D3D11_Destroy() // GPU_Destroy() check(m_D3D11_DummyResource == null); check(m_D3D11_DummyView == null); } -#endif // (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) m_D3D11_DeferedContext = null; m_D3D11_Device = null; @@ -2370,11 +2377,11 @@ namespace #endif #if (PK_PARTICLES_HAS_STATS != 0) -# if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +# if (ENGINE_MAJOR_VERSION == 5) m_DirectCommandQueue = GetID3D12DynamicRHI()->RHIGetCommandQueue(); # else m_DirectCommandQueue = dynamicRHI->RHIGetD3DCommandQueue(); // Returns the direct command queue -# endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +# endif // (ENGINE_MAJOR_VERSION == 5) #endif // (PK_PARTICLES_HAS_STATS != 0) if (!PK_VERIFY(m_Device != null)) { @@ -2398,13 +2405,13 @@ static void _D3D12_ExecuteTasksArray(CParticleScene *self) auto &m_Exec_D3D12_Tasks = self->m_Exec_D3D12_Tasks; //auto &m_UpdateLock = self->m_UpdateLock; -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) ID3D12CommandQueue *commandQueue = GetID3D12DynamicRHI()->RHIGetCommandQueue(); #else PK_RELEASE_ASSERT(GDynamicRHI != null); FD3D12DynamicRHI *dynamicRHI = static_cast(GDynamicRHI); ID3D12CommandQueue *commandQueue = dynamicRHI->RHIGetD3DCommandQueue(); // Returns the direct command queue -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) // TODO: Investigate performance when using the compute command queue diff --git a/Source/PopcornFX/Private/Internal/ParticleScene.h b/Source/PopcornFX/Private/Internal/ParticleScene.h index f2eabf5..3bea5be 100644 --- a/Source/PopcornFX/Private/Internal/ParticleScene.h +++ b/Source/PopcornFX/Private/Internal/ParticleScene.h @@ -33,13 +33,13 @@ class UPopcornFXSceneComponent; class FPopcornFXSceneProxy; -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) # define PK_WITH_PHYSX 0 # define PK_WITH_CHAOS 1 #else # define PK_WITH_PHYSX PHYSICS_INTERFACE_PHYSX && WITH_PHYSX # define PK_WITH_CHAOS !(PK_WITH_PHYSX) && WITH_CHAOS -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) // The plugin doesn't support both being active at the same time. #if PK_WITH_PHYSX && PK_WITH_CHAOS @@ -52,6 +52,8 @@ namespace physx struct PxRaycastHit; class PxScene; } +#else +# include "Chaos/ChaosScene.h" #endif // PK_WITH_PHYSX FWD_PK_API_BEGIN @@ -312,10 +314,10 @@ class CParticleScene : public PopcornFX::IParticleScene struct ID3D11Device *D3D11_Device() const { PK_ASSERT(D3D11Ready()); return m_D3D11_Device; } struct ID3D11DeviceContext *D3D11_DeferedContext() const { PK_ASSERT(D3D11Ready()); return m_D3D11_DeferedContext; } -#if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) class FRHIBuffer *m_D3D11_DummyResource = null; class FRHIUnorderedAccessView *m_D3D11_DummyView = null; -#endif // (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) private: bool D3D11_InitIFN(); diff --git a/Source/PopcornFX/Private/Internal/Startup.cpp b/Source/PopcornFX/Private/Internal/Startup.cpp index 450a93a..9efb63c 100644 --- a/Source/PopcornFX/Private/Internal/Startup.cpp +++ b/Source/PopcornFX/Private/Internal/Startup.cpp @@ -12,6 +12,8 @@ #include "PopcornFXSettings.h" #include "PopcornFXStats.h" +#include "Templates/ScopedCallback.h" + #include "GenericPlatform/GenericPlatformMemory.h" #include "HAL/PlatformAffinity.h" #include "Misc/ConfigCacheIni.h" diff --git a/Source/PopcornFX/Private/Platforms/PopcornFXPlatform.h b/Source/PopcornFX/Private/Platforms/PopcornFXPlatform.h index 5ead76a..d5f588a 100644 --- a/Source/PopcornFX/Private/Platforms/PopcornFXPlatform.h +++ b/Source/PopcornFX/Private/Platforms/PopcornFXPlatform.h @@ -18,13 +18,19 @@ # endif // (PK_HAS_GPU != 0) #endif // WITH_EDITOR +#if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 2) +# if (PK_COMPILE_GPU != 0) +# include "RHIShaderPlatform.h" +# endif +#endif + FWD_PK_API_BEGIN class CImage; FWD_PK_API_END //---------------------------------------------------------------------------- -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) # define PKFX_COMMON_NewImageFromTexture 1 #else # if PLATFORM_PS4 || PLATFORM_XBOXONE @@ -32,7 +38,7 @@ FWD_PK_API_END # else # define PKFX_COMMON_NewImageFromTexture 1 # endif // PLATFORM_PS4 || PLATFORM_XBOXONE -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) //---------------------------------------------------------------------------- diff --git a/Source/PopcornFX/Private/Platforms/PopcornFXPlatformCommon.cpp b/Source/PopcornFX/Private/Platforms/PopcornFXPlatformCommon.cpp index 812bb40..04bed7b 100644 --- a/Source/PopcornFX/Private/Platforms/PopcornFXPlatformCommon.cpp +++ b/Source/PopcornFX/Private/Platforms/PopcornFXPlatformCommon.cpp @@ -18,10 +18,18 @@ # include "ShaderCompilerCore.h" # include "Misc/FileHelper.h" +# if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 3) +# include "ShaderPreprocessTypes.h" +# endif // (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 3) + # include # include #endif // (PK_COMPILE_GPU != 0) +#if (PKFX_COMMON_NewImageFromTexture != 0) +# include "TextureResource.h" +#endif + #include //---------------------------------------------------------------------------- @@ -35,7 +43,7 @@ PopcornFX::CImage *_CreateFallbackImage() const PopcornFX::CUint3 size(16, 16, 1); const PopcornFX::CImage::EFormat format = PopcornFX::CImage::Format_BGRA8; - const u32 bufferSize = PopcornFX::CImage::GetFormatPixelBufferSizeInBytes(format, size); + const u32 bufferSize = PopcornFX::CImage::GetFormatPixelBufferSizeInBytes(format, size); PopcornFX::PRefCountedMemoryBuffer dstBuffer = PopcornFX::CRefCountedMemoryBuffer::AllocAligned(bufferSize, 0x80); if (!PK_VERIFY(dstBuffer != null)) return null; @@ -314,9 +322,20 @@ bool CompileComputeShaderForAPI( const PopcornFX::CString &source, #endif // (ENGINE_MAJOR_VERSION == 5) } - FShaderCompilerOutput output; - const FString workingDirectory; + FShaderCompilerOutput output; + const FString workingDirectory; +#if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 3) + FShaderPreprocessOutput preprocessorOutput; + FShaderCompilerEnvironment mergedEnvironment; + if (!shaderFormat->PreprocessShader(input, mergedEnvironment, preprocessorOutput)) + { + UE_LOG(LogPopcornFXPlatformCommon, Verbose, TEXT("Failed preprocessing shader for %s"), ANSI_TO_TCHAR(apiName.Data())); + return false; + } + shaderFormat->CompilePreprocessedShader(input, preprocessorOutput, output, workingDirectory); +#else shaderFormat->CompileShader(shaderFormatName, input, output, workingDirectory); +#endif // (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 3) if (output.bSucceeded) { @@ -401,12 +420,12 @@ namespace PopcornFX::CMessageStream &outMessages) { TArray compilerFlags; -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) return CompileComputeShaderForAPI(source, buildInfos, "D3D12", SP_PCD3D_SM6, "DXBC", compilerFlags, outBytecode, outMessages); #else compilerFlags.Add(CFLAG_ForceDXC); // Force SM6.0 return CompileComputeShaderForAPI(source, buildInfos, "D3D12", SP_PCD3D_SM5, "DXBC", compilerFlags, outBytecode, outMessages); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) } } diff --git a/Source/PopcornFX/Private/PopcornFXPlugin.cpp b/Source/PopcornFX/Private/PopcornFXPlugin.cpp index 7264dbd..84be13b 100644 --- a/Source/PopcornFX/Private/PopcornFXPlugin.cpp +++ b/Source/PopcornFX/Private/PopcornFXPlugin.cpp @@ -16,6 +16,8 @@ # include "Editor/PopcornFXEffectEditor.h" #endif +#include "ShaderCore.h" + #include "EngineModule.h" #include "Engine/Texture.h" #include "Engine/StaticMesh.h" diff --git a/Source/PopcornFX/Private/PopcornFXSDK.h b/Source/PopcornFX/Private/PopcornFXSDK.h index af79579..63baffd 100644 --- a/Source/PopcornFX/Private/PopcornFXSDK.h +++ b/Source/PopcornFX/Private/PopcornFXSDK.h @@ -28,6 +28,9 @@ # ifndef PLATFORM_XBOXONE # define PLATFORM_XBOXONE 0 # endif +# if (ENGINE_MINOR_VERSION < 1) +# error PopcornFX Plugin only supported in UE5 >= 5.1 +# endif #endif // (ENGINE_MAJOR_VERSION == 5) #if PLATFORM_WINDOWS diff --git a/Source/PopcornFX/Private/Render/BatchDrawer_Billboard_CPU.cpp b/Source/PopcornFX/Private/Render/BatchDrawer_Billboard_CPU.cpp index aa59c0a..8c610a5 100644 --- a/Source/PopcornFX/Private/Render/BatchDrawer_Billboard_CPU.cpp +++ b/Source/PopcornFX/Private/Render/BatchDrawer_Billboard_CPU.cpp @@ -7,6 +7,7 @@ #include "RenderBatchManager.h" #include "SceneManagement.h" #include "MaterialDesc.h" +#include "SceneInterface.h" #include "Engine/Engine.h" #include "World/PopcornFXSceneProxy.h" @@ -709,11 +710,11 @@ void CBatchDrawer_Billboard_CPUBB::_IssueDrawCall_Billboard(const SUERenderConte meshElement.MaxVertexIndex = m_TotalVertexCount - 1; FDynamicPrimitiveUniformBuffer &dynamicPrimitiveUniformBuffer = collector->AllocateOneFrameResource(); -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) dynamicPrimitiveUniformBuffer.Set(localToWorld, previousLocalToWorld, bounds, localBounds, true, hasPrecomputedVolumetricLightmap, outputVelocity); #else dynamicPrimitiveUniformBuffer.Set(localToWorld, previousLocalToWorld, bounds, localBounds, true, hasPrecomputedVolumetricLightmap, drawsVelocity, outputVelocity); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) meshElement.PrimitiveUniformBuffer = dynamicPrimitiveUniformBuffer.UniformBuffer.GetUniformBufferRHI(); PK_ASSERT(meshElement.NumPrimitives > 0); diff --git a/Source/PopcornFX/Private/Render/BatchDrawer_Billboard_GPU.cpp b/Source/PopcornFX/Private/Render/BatchDrawer_Billboard_GPU.cpp index a2b8003..411dec2 100644 --- a/Source/PopcornFX/Private/Render/BatchDrawer_Billboard_GPU.cpp +++ b/Source/PopcornFX/Private/Render/BatchDrawer_Billboard_GPU.cpp @@ -918,11 +918,11 @@ bool CBatchDrawer_Billboard_GPUBB::LaunchCustomTasks(PopcornFX::SRenderContext & copyParams.m_IsCapsule = m_CapsulesDC; copyParams.m_DrawIndirectArgsOffset = iDr * POPCORNFX_INDIRECT_ARGS_ARG_COUNT; -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) SetComputePipelineState(RHICmdList, copySizeBufferCS.GetComputeShader()); #else RHICmdList.SetComputeShader(copySizeBufferCS.GetComputeShader()); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) copySizeBufferCS->Dispatch(RHICmdList, copyParams); } diff --git a/Source/PopcornFX/Private/Render/BatchDrawer_Light.cpp b/Source/PopcornFX/Private/Render/BatchDrawer_Light.cpp index 9e27666..e5b4887 100644 --- a/Source/PopcornFX/Private/Render/BatchDrawer_Light.cpp +++ b/Source/PopcornFX/Private/Render/BatchDrawer_Light.cpp @@ -191,11 +191,11 @@ void CBatchDrawer_Light::_IssueDrawCall_Light(const SUERenderContext &renderCont PopcornFX::CGuid ldatai = lightDatas.PushBack(); FSimpleLightEntry &lightdata = lightDatas[ldatai]; -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) lightdata.Color = ToUE(colors[parti] * kColorMultiplier); #else lightdata.Color = FVector(ToUE(colors[parti] * kColorMultiplier)); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) lightdata.Radius = radius; // Set the exponent to 0 if we want to enable inverse squared falloff diff --git a/Source/PopcornFX/Private/Render/BatchDrawer_Ribbon_CPU.cpp b/Source/PopcornFX/Private/Render/BatchDrawer_Ribbon_CPU.cpp index cf58de3..942f9bd 100644 --- a/Source/PopcornFX/Private/Render/BatchDrawer_Ribbon_CPU.cpp +++ b/Source/PopcornFX/Private/Render/BatchDrawer_Ribbon_CPU.cpp @@ -7,6 +7,7 @@ #include "RenderBatchManager.h" #include "SceneManagement.h" #include "MaterialDesc.h" +#include "SceneInterface.h" #include "Engine/Engine.h" #include "World/PopcornFXSceneProxy.h" @@ -103,6 +104,12 @@ bool CBatchDrawer_Ribbon_CPUBB::Setup(const PopcornFX::CRendererDataBase *render m_SecondUVSet = renderer->m_RendererCache->m_Flags.m_HasAtlasBlending && renderer->m_RendererCache->m_Flags.m_HasUV; m_RibbonCorrectDeformation = renderer->m_RendererCache->m_Flags.m_HasRibbonCorrectDeformation; m_FlipUVs = renderer->m_RendererCache->m_Flags.m_RotateTexture; + + const PopcornFX::ERibbonMode mode = renderer->m_Declaration.GetPropertyValue_Enum(PopcornFX::BasicRendererProperties::SID_BillboardingMode(), PopcornFX::RibbonMode_ViewposAligned); + if (mode == PopcornFX::RibbonMode_SideAxisAlignedTube) + m_VPP = (renderer->m_Declaration.GetPropertyValue_I1(PopcornFX::BasicRendererProperties::SID_GeometryRibbon_SegmentCount(), 8) + 1) * 2; + else if (mode == PopcornFX::RibbonMode_SideAxisAlignedMultiPlane) + m_VPP = renderer->m_Declaration.GetPropertyValue_I1(PopcornFX::BasicRendererProperties::SID_GeometryRibbon_PlaneCount(), 2) * 4; return true; } @@ -697,7 +704,10 @@ void CBatchDrawer_Ribbon_CPUBB::_IssueDrawCall_Ribbon(const SUERenderContext &re vsUniforms.DynamicParameterMask = matDesc.m_DynamicParameterMask; vsUniformsbillboard.RendererType = static_cast(PopcornFX::Renderer_Ribbon); + vsUniformsbillboard.TotalParticleCount = desc.m_TotalParticleCount; vsUniformsbillboard.CapsulesOffset = 0; + vsUniformsbillboard.TubesPlanesOffset = m_VPP > 0 ? 0 : vsUniformsbillboard.TotalParticleCount; // For now, no batching of tube/multiplane ribbons with quad bb modes + vsUniformsbillboard.VPP = m_VPP; vsUniformsbillboard.InColorsOffset = m_AdditionalStreamOffsets[StreamOffset_Colors].OffsetForShaderConstant(); vsUniformsbillboard.InEmissiveColorsOffset = m_AdditionalStreamOffsets[StreamOffset_EmissiveColors].OffsetForShaderConstant(); vsUniformsbillboard.InAlphaCursorsOffset = m_AdditionalStreamOffsets[StreamOffset_AlphaCursors].OffsetForShaderConstant(); @@ -746,11 +756,11 @@ void CBatchDrawer_Ribbon_CPUBB::_IssueDrawCall_Ribbon(const SUERenderContext &re meshElement.MaxVertexIndex = m_TotalVertexCount - 1; FDynamicPrimitiveUniformBuffer &dynamicPrimitiveUniformBuffer = collector->AllocateOneFrameResource(); -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) dynamicPrimitiveUniformBuffer.Set(localToWorld, previousLocalToWorld, bounds, localBounds, true, hasPrecomputedVolumetricLightmap, outputVelocity); #else dynamicPrimitiveUniformBuffer.Set(localToWorld, previousLocalToWorld, bounds, localBounds, true, hasPrecomputedVolumetricLightmap, drawsVelocity, outputVelocity); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) meshElement.PrimitiveUniformBuffer = dynamicPrimitiveUniformBuffer.UniformBuffer.GetUniformBufferRHI(); PK_ASSERT(meshElement.NumPrimitives > 0); diff --git a/Source/PopcornFX/Private/Render/BatchDrawer_Ribbon_CPU.h b/Source/PopcornFX/Private/Render/BatchDrawer_Ribbon_CPU.h index 71298ea..1ef1c5a 100644 --- a/Source/PopcornFX/Private/Render/BatchDrawer_Ribbon_CPU.h +++ b/Source/PopcornFX/Private/Render/BatchDrawer_Ribbon_CPU.h @@ -81,6 +81,8 @@ class CBatchDrawer_Ribbon_CPUBB : public PopcornFX::CRendererBatchJobs_Ribbon_CP u32 m_TotalIndexCount = 0; u32 m_RealViewCount = 0; + u8 m_VPP = 0; + ERHIFeatureLevel::Type m_FeatureLevel = ERHIFeatureLevel::Num; // UserData used to bind shader uniforms (Billboard & Ribbon) diff --git a/Source/PopcornFX/Private/Render/BatchDrawer_SkeletalMesh_CPU.cpp b/Source/PopcornFX/Private/Render/BatchDrawer_SkeletalMesh_CPU.cpp index 1a76ed3..738b021 100644 --- a/Source/PopcornFX/Private/Render/BatchDrawer_SkeletalMesh_CPU.cpp +++ b/Source/PopcornFX/Private/Render/BatchDrawer_SkeletalMesh_CPU.cpp @@ -10,6 +10,11 @@ #include "Rendering/SkeletalMeshRenderData.h" #include "Rendering/SkeletalMeshLODRenderData.h" #include "Engine/SkeletalMesh.h" +#include "Engine/Texture2D.h" +#if (ENGINE_MAJOR_VERSION == 5) +# include "Engine/SkinnedAssetCommon.h" +#endif +#include "RHIStaticStates.h" #include "Engine/Engine.h" #include "World/PopcornFXSceneProxy.h" @@ -960,21 +965,21 @@ void CBatchDrawer_SkeletalMesh_CPUBB::_IssueDrawCall_Mesh(const SUERenderContext if (m_MotionBlur) { TShaderMapRef< FPopcornFXComputeMBBoneTransformsCS > computeBoneTransformsCS(GetGlobalShaderMap(m_FeatureLevel)); -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) SetComputePipelineState(RHICmdList, computeBoneTransformsCS.GetComputeShader()); #else RHICmdList.SetComputeShader(computeBoneTransformsCS.GetComputeShader()); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) computeBoneTransformsCS->Dispatch(RHICmdList, params); } else { TShaderMapRef< FPopcornFXComputeBoneTransformsCS > computeBoneTransformsCS(GetGlobalShaderMap(m_FeatureLevel)); -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) SetComputePipelineState(RHICmdList, computeBoneTransformsCS.GetComputeShader()); #else RHICmdList.SetComputeShader(computeBoneTransformsCS.GetComputeShader()); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) computeBoneTransformsCS->Dispatch(RHICmdList, params); } } diff --git a/Source/PopcornFX/Private/Render/BatchDrawer_Triangle_CPU.cpp b/Source/PopcornFX/Private/Render/BatchDrawer_Triangle_CPU.cpp index c8138da..218b20c 100644 --- a/Source/PopcornFX/Private/Render/BatchDrawer_Triangle_CPU.cpp +++ b/Source/PopcornFX/Private/Render/BatchDrawer_Triangle_CPU.cpp @@ -7,6 +7,7 @@ #include "RenderBatchManager.h" #include "SceneManagement.h" #include "MaterialDesc.h" +#include "SceneInterface.h" #include "Engine/Engine.h" #include "World/PopcornFXSceneProxy.h" @@ -619,11 +620,11 @@ void CBatchDrawer_Triangle_CPUBB::_IssueDrawCall_Triangle(const SUERenderContext meshElement.MinVertexIndex = 0; meshElement.MaxVertexIndex = (m_TotalParticleCount * 3) - 1; FDynamicPrimitiveUniformBuffer &dynamicPrimitiveUniformBuffer = collector->AllocateOneFrameResource(); -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) dynamicPrimitiveUniformBuffer.Set(localToWorld, previousLocalToWorld, bounds, localBounds, true, hasPrecomputedVolumetricLightmap, outputVelocity); #else dynamicPrimitiveUniformBuffer.Set(localToWorld, previousLocalToWorld, bounds, localBounds, true, hasPrecomputedVolumetricLightmap, drawsVelocity, outputVelocity); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) meshElement.PrimitiveUniformBuffer = dynamicPrimitiveUniformBuffer.UniformBuffer.GetUniformBufferRHI(); PK_ASSERT(meshElement.NumPrimitives > 0); diff --git a/Source/PopcornFX/Private/Render/MaterialDesc.cpp b/Source/PopcornFX/Private/Render/MaterialDesc.cpp index 740ec39..5689d89 100644 --- a/Source/PopcornFX/Private/Render/MaterialDesc.cpp +++ b/Source/PopcornFX/Private/Render/MaterialDesc.cpp @@ -20,6 +20,10 @@ #include "Materials/Material.h" #include "Materials/MaterialInterface.h" #include "Materials/MaterialInstanceConstant.h" +#if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 2) +# include "Materials/MaterialRenderProxy.h" +# include "MaterialDomain.h" +#endif #include "MaterialShared.h" #include diff --git a/Source/PopcornFX/Private/Render/MaterialDesc.h b/Source/PopcornFX/Private/Render/MaterialDesc.h index f5c3fee..ab86cb4 100644 --- a/Source/PopcornFX/Private/Render/MaterialDesc.h +++ b/Source/PopcornFX/Private/Render/MaterialDesc.h @@ -16,6 +16,12 @@ #include "RenderTypesPolicies.h" +#if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 2) +# if RHI_RAYTRACING +# include "RayTracingGeometry.h" +# endif +#endif + //---------------------------------------------------------------------------- class UPopcornFXRendererMaterial; diff --git a/Source/PopcornFX/Private/Render/PopcornFXGPUVertexFactory.cpp b/Source/PopcornFX/Private/Render/PopcornFXGPUVertexFactory.cpp index ac727ae..7116aa4 100644 --- a/Source/PopcornFX/Private/Render/PopcornFXGPUVertexFactory.cpp +++ b/Source/PopcornFX/Private/Render/PopcornFXGPUVertexFactory.cpp @@ -16,6 +16,11 @@ #include "MaterialShared.h" #include "Materials/Material.h" #include "Materials/MaterialInterface.h" +#include "MeshDrawShaderBindings.h" +#if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 2) +# include "MaterialDomain.h" +# include "DataDrivenShaderPlatformInfo.h" +#endif IMPLEMENT_GLOBAL_SHADER_PARAMETER_STRUCT(FPopcornFXGPUBillboardVSUniforms, "PopcornFXGPUBillboardVSUniforms"); diff --git a/Source/PopcornFX/Private/Render/PopcornFXMeshVertexFactory.cpp b/Source/PopcornFX/Private/Render/PopcornFXMeshVertexFactory.cpp index e7a53c2..8886154 100644 --- a/Source/PopcornFX/Private/Render/PopcornFXMeshVertexFactory.cpp +++ b/Source/PopcornFX/Private/Render/PopcornFXMeshVertexFactory.cpp @@ -12,6 +12,10 @@ #include "MeshBatch.h" #include "Materials/MaterialInterface.h" #include "Materials/Material.h" +#if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 2) +# include "MaterialDomain.h" +# include "GlobalRenderResources.h" +#endif #include "MeshMaterialShader.h" #include "MeshDrawShaderBindings.h" diff --git a/Source/PopcornFX/Private/Render/PopcornFXSkeletalMeshVertexFactory.cpp b/Source/PopcornFX/Private/Render/PopcornFXSkeletalMeshVertexFactory.cpp index 88793f2..6fb79e6 100644 --- a/Source/PopcornFX/Private/Render/PopcornFXSkeletalMeshVertexFactory.cpp +++ b/Source/PopcornFX/Private/Render/PopcornFXSkeletalMeshVertexFactory.cpp @@ -12,6 +12,10 @@ #include "MeshBatch.h" #include "Materials/MaterialInterface.h" #include "Materials/Material.h" +#if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 2) +# include "MaterialDomain.h" +# include "GlobalRenderResources.h" +#endif #include "GPUSkinPublicDefs.h" diff --git a/Source/PopcornFX/Private/Render/PopcornFXVertexFactory.cpp b/Source/PopcornFX/Private/Render/PopcornFXVertexFactory.cpp index 02f05d6..6645ce2 100644 --- a/Source/PopcornFX/Private/Render/PopcornFXVertexFactory.cpp +++ b/Source/PopcornFX/Private/Render/PopcornFXVertexFactory.cpp @@ -12,6 +12,11 @@ #include "MaterialShared.h" #include "Materials/MaterialInterface.h" #include "Materials/Material.h" +#if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 2) +# include "MaterialDomain.h" +# include "DataDrivenShaderPlatformInfo.h" +# include "GlobalRenderResources.h" +#endif #include "MeshMaterialShader.h" diff --git a/Source/PopcornFX/Private/Render/PopcornFXVertexFactory.h b/Source/PopcornFX/Private/Render/PopcornFXVertexFactory.h index e04f28d..9206e8b 100644 --- a/Source/PopcornFX/Private/Render/PopcornFXVertexFactory.h +++ b/Source/PopcornFX/Private/Render/PopcornFXVertexFactory.h @@ -25,6 +25,8 @@ class UMaterialInterface; BEGIN_GLOBAL_SHADER_PARAMETER_STRUCT(FPopcornFXBillboardVSUniforms, POPCORNFX_API) SHADER_PARAMETER(uint32, RendererType) SHADER_PARAMETER(uint32, CapsulesOffset) + SHADER_PARAMETER(uint32, TubesPlanesOffset) + SHADER_PARAMETER(uint32, VPP) SHADER_PARAMETER(uint32, TotalParticleCount) //SHADER_PARAMETER(int, InTextureIDsOffset) SHADER_PARAMETER(int32, InColorsOffset) diff --git a/Source/PopcornFX/Private/Render/PopcornFXVertexFactoryShaderParameters.cpp b/Source/PopcornFX/Private/Render/PopcornFXVertexFactoryShaderParameters.cpp index 6ee53ed..e2bb77b 100644 --- a/Source/PopcornFX/Private/Render/PopcornFXVertexFactoryShaderParameters.cpp +++ b/Source/PopcornFX/Private/Render/PopcornFXVertexFactoryShaderParameters.cpp @@ -12,6 +12,7 @@ #include "ShaderParameterUtils.h" #include "MeshBatch.h" #include "MeshMaterialShader.h" +#include "MeshDrawShaderBindings.h" #include "PopcornFXSDK.h" diff --git a/Source/PopcornFX/Private/Render/RenderBatchManager.cpp b/Source/PopcornFX/Private/Render/RenderBatchManager.cpp index 9ebabbe..76fe00e 100644 --- a/Source/PopcornFX/Private/Render/RenderBatchManager.cpp +++ b/Source/PopcornFX/Private/Render/RenderBatchManager.cpp @@ -29,9 +29,14 @@ #include "Assets/PopcornFXRendererMaterial.h" #include "PopcornFXStats.h" +#include "Engine/World.h" + #include "Materials/Material.h" #include "Materials/MaterialInterface.h" #include "Materials/MaterialInstanceConstant.h" +#if (ENGINE_MAJOR_VERSION == 5) && (ENGINE_MINOR_VERSION >= 2) +# include "MaterialDomain.h" +#endif #if POPCORNFX_RENDER_DEBUG # include "PopcornFXSceneComponent.h" diff --git a/Source/PopcornFX/Private/World/PopcornFXSceneComponent.cpp b/Source/PopcornFX/Private/World/PopcornFXSceneComponent.cpp index 90bb489..021d789 100644 --- a/Source/PopcornFX/Private/World/PopcornFXSceneComponent.cpp +++ b/Source/PopcornFX/Private/World/PopcornFXSceneComponent.cpp @@ -14,6 +14,8 @@ #include "PopcornFXStats.h" #include "Assets/PopcornFXEffectPriv.h" +#include "Engine/World.h" + #include "Engine/CollisionProfile.h" #include "PopcornFXSDK.h" diff --git a/Source/PopcornFX/Public/PopcornFXVersionGenerated.h b/Source/PopcornFX/Public/PopcornFXVersionGenerated.h index 7481016..a977c2c 100644 --- a/Source/PopcornFX/Public/PopcornFXVersionGenerated.h +++ b/Source/PopcornFX/Public/PopcornFXVersionGenerated.h @@ -6,6 +6,6 @@ #pragma once #define POPCORNFX_PLUGIN_VERSION_MAJOR 2 -#define POPCORNFX_PLUGIN_VERSION_MINOR 17 -#define POPCORNFX_PLUGIN_VERSION_PATCH 4 +#define POPCORNFX_PLUGIN_VERSION_MINOR 18 +#define POPCORNFX_PLUGIN_VERSION_PATCH 0 #define POPCORNFX_PLUGIN_VERSION_TAG "" diff --git a/Source/PopcornFXEditor/Private/Nodes/PopcornFXNode_DynamicField.cpp b/Source/PopcornFXEditor/Private/Nodes/PopcornFXNode_DynamicField.cpp index f778329..8aea05f 100644 --- a/Source/PopcornFXEditor/Private/Nodes/PopcornFXNode_DynamicField.cpp +++ b/Source/PopcornFXEditor/Private/Nodes/PopcornFXNode_DynamicField.cpp @@ -135,13 +135,13 @@ namespace PopcornFXPinDataType // Removes leading "EPopcornFXPinFieldType::" if nessecary for Pin value FString GetPinValueName(EPopcornFXPinDataType::Type value) { -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) static const TCHAR kEnumName[] = TEXT("/Script/PopcornFX.EPopcornFXPinDataType"); UEnum *pinTypeEnum = FindObject(null, kEnumName, true); #else static const TCHAR kEnumName[] = TEXT("EPopcornFXPinDataType"); UEnum *pinTypeEnum = FindObject(ANY_PACKAGE, kEnumName, true); -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) check(pinTypeEnum); FString name = pinTypeEnum->GetNameByValue(value).ToString(); static const TCHAR kEnumNameDoubleColon[] = TEXT("EPopcornFXPinDataType::"); diff --git a/Source/PopcornFXEditor/Private/PopcornFXEmitterFactory.cpp b/Source/PopcornFXEditor/Private/PopcornFXEmitterFactory.cpp index b72cec6..79c4e34 100644 --- a/Source/PopcornFXEditor/Private/PopcornFXEmitterFactory.cpp +++ b/Source/PopcornFXEditor/Private/PopcornFXEmitterFactory.cpp @@ -6,11 +6,11 @@ #include "PopcornFXEmitterFactory.h" #include "Runtime/Launch/Resources/Version.h" -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) # include "AssetRegistry/AssetData.h" #else # include "AssetData.h" -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) #include "Assets/PopcornFXEffect.h" #include "PopcornFXEmitter.h" diff --git a/Source/PopcornFXEditor/Private/PopcornFXFileFactory.cpp b/Source/PopcornFXEditor/Private/PopcornFXFileFactory.cpp index 5988a48..cdee633 100644 --- a/Source/PopcornFXEditor/Private/PopcornFXFileFactory.cpp +++ b/Source/PopcornFXEditor/Private/PopcornFXFileFactory.cpp @@ -16,11 +16,11 @@ #include "ObjectTools.h" #include "PackageTools.h" #include "AssetToolsModule.h" -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) # include "AssetRegistry/AssetRegistryModule.h" #else # include "AssetRegistryModule.h" -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) #include "EditorFramework/AssetImportData.h" #include "Editor.h" diff --git a/Source/PopcornFXEditor/Private/PopcornFXFileReimportFactory.cpp b/Source/PopcornFXEditor/Private/PopcornFXFileReimportFactory.cpp index 1778dc5..2f98e8e 100644 --- a/Source/PopcornFXEditor/Private/PopcornFXFileReimportFactory.cpp +++ b/Source/PopcornFXEditor/Private/PopcornFXFileReimportFactory.cpp @@ -10,11 +10,11 @@ #include "Runtime/Launch/Resources/Version.h" #include "EditorReimportHandler.h" -#if (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#if (ENGINE_MAJOR_VERSION == 5) # include "AssetRegistry/AssetRegistryModule.h" #else # include "AssetRegistryModule.h" -#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1) +#endif // (ENGINE_MAJOR_VERSION == 5) #include "EditorFramework/AssetImportData.h" #include "UObject/UnrealType.h"