Skip to content

Commit

Permalink
PopcornFX Plugin v2.18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PopcornFX Bot committed Sep 21, 2023
1 parent 608e19d commit 8feee7b
Show file tree
Hide file tree
Showing 52 changed files with 300 additions and 143 deletions.
3 changes: 3 additions & 0 deletions Content/Materials/M_PK_Default_Mesh_AlphaBlend.uasset
Git LFS file not shown
2 changes: 1 addition & 1 deletion Download_SDK_Desktop.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Download_SDK_Mobile.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions PopcornFX.uplugin
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
23 changes: 18 additions & 5 deletions Shaders/Private/PopcornFXVertexFactory.ush
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions Source/PopcornFX/Private/Assets/PopcornFXAssetDep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions Source/PopcornFX/Private/Assets/PopcornFXFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 6 additions & 2 deletions Source/PopcornFX/Private/Assets/PopcornFXRendererMaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <pk_base_object/include/hbo_handler.h>
Expand Down Expand Up @@ -86,15 +90,15 @@ namespace
for (int32 i = 0; i < params.StaticSwitchParameters.Num(); ++i)
{
FStaticSwitchParameter &param = 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 &param = params.EditorOnly.StaticSwitchParameters[i];
#else
for (int32 i = 0; i < params.StaticSwitchParameters.Num(); ++i)
{
FStaticSwitchParameter &param = params.StaticSwitchParameters[i];
#endif // (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1)
#endif

if (param.ParameterInfo.Name == name)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,11 +625,11 @@ namespace
{
const TArray<int32> &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<FSkelMeshRenderSection> &GetSections(const FSkeletalMeshLODRenderData *lodRenderData)
Expand Down Expand Up @@ -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<USkeletalMesh>(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;

Expand Down Expand Up @@ -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<USkeletalMesh>(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);
Expand Down Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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)));
}
Expand All @@ -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"))));

}
Expand Down
Loading

0 comments on commit 8feee7b

Please sign in to comment.