From 4212d65f94e4dcc5223326e0b9d4116177552044 Mon Sep 17 00:00:00 2001 From: PopcornFX Bot Date: Thu, 28 Mar 2024 18:49:08 +0100 Subject: [PATCH] PopcornFX Gem 2.19.0 --- .../Default/BillboardDistortion.azsl | 4 - .../Billboard/Legacy/BillboardLit_Legacy.azsl | 14 --- .../Billboard/Legacy/Billboard_Legacy.azsl | 4 - Assets/shaders/Common/LightingHelper.azsli | 26 ----- Assets/shaders/Common/PopcornOptions.azsli | 2 - .../shaders/Mesh/Legacy/MeshLit_Legacy.azsl | 13 --- Assets/shaders/Mesh/Legacy/Mesh_Legacy.azsl | 4 - .../Ribbon/Default/RibbonDistortion.azsl | 4 - .../Ribbon/Legacy/RibbonLit_Legacy.azsl | 39 ------- .../shaders/Ribbon/Legacy/Ribbon_Legacy.azsl | 4 - CMakeLists.txt | 107 +++--------------- Code/CMakeLists.txt | 19 ++-- Code/Include/PopcornFX/PopcornFXBus.h | 6 - Code/Platform/Linux/PAL_linux.cmake | 8 +- Code/Platform/Mac/PAL_mac.cmake | 4 +- Code/Platform/Windows/PAL_windows.cmake | 4 +- .../Samplers/PopcornFXSamplerImage.cpp | 6 +- .../Integration/Editor/BakerManager.cpp | 2 +- .../Integration/Managers/StatsManager.cpp | 4 - .../PopcornFXFeatureProcessor.cpp | 36 +----- .../PopcornFXFeatureProcessor.h | 5 - .../ResourceHandlers/ImageResourceHandler.cpp | 4 - .../ResourceHandlers/MeshResourceHandler.cpp | 9 -- .../Integration/Startup/PopcornFxPlugins.cpp | 16 +-- .../Integration/Startup/PopcornFxPlugins.h | 46 ++++---- Code/popcornfx_autogen_files.cmake | 4 +- README.md | 2 +- gem.json | 6 +- 28 files changed, 75 insertions(+), 327 deletions(-) diff --git a/Assets/shaders/Billboard/Default/BillboardDistortion.azsl b/Assets/shaders/Billboard/Default/BillboardDistortion.azsl index 3cdc7af..5ec395e 100644 --- a/Assets/shaders/Billboard/Default/BillboardDistortion.azsl +++ b/Assets/shaders/Billboard/Default/BillboardDistortion.azsl @@ -7,11 +7,7 @@ #include #include "../../Common/PopcornOptions.azsli" -#if PK_O3DE_NEW_PBR #include -#else -#include -#endif #include "../../Common/MaterialSrg.azsli" diff --git a/Assets/shaders/Billboard/Legacy/BillboardLit_Legacy.azsl b/Assets/shaders/Billboard/Legacy/BillboardLit_Legacy.azsl index 9905bbc..bcb19a7 100644 --- a/Assets/shaders/Billboard/Legacy/BillboardLit_Legacy.azsl +++ b/Assets/shaders/Billboard/Legacy/BillboardLit_Legacy.azsl @@ -37,9 +37,6 @@ struct VSOutput float3 m_emissiveColor : COLOR1; float m_alphaCursor : UV4; float4 m_clipPosition : UV5; -#if !PK_O3DE_NEW_LIT - float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV6; -#endif }; VSOutput BillboardVS(VertexInput input) @@ -57,14 +54,6 @@ VSOutput BillboardVS(VertexInput input) ComputeBillboardVertex(particleIdx, input.m_uv, vtxWorldPos, vtxNormal, vtxTangent, vtxUV0, vtxUV1, vtxTexFrameLerp); -#if !PK_O3DE_NEW_LIT - // directional light shadow - const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; - if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount) - DirectionalLightShadow::GetShadowCoords(shadowIndex, vtxWorldPos, vtxNormal, output.m_shadowCoords); -#endif - - // TBN: float3 vtxBitangent = cross(vtxNormal, vtxTangent.xyz) * vtxTangent.w; @@ -162,9 +151,6 @@ ForwardPassOutput BillboardFS(VSOutput input, bool isFrontFace : SV_IsFrontFace) // Compute lighting: return ComputeParticleLighting( input.m_worldPosition, input.m_position, -#if !PK_O3DE_NEW_LIT - input.m_shadowCoords, -#endif vertexNormal, normal, tangent, diff --git a/Assets/shaders/Billboard/Legacy/Billboard_Legacy.azsl b/Assets/shaders/Billboard/Legacy/Billboard_Legacy.azsl index b1f021c..c8bf8fb 100644 --- a/Assets/shaders/Billboard/Legacy/Billboard_Legacy.azsl +++ b/Assets/shaders/Billboard/Legacy/Billboard_Legacy.azsl @@ -7,11 +7,7 @@ #include #include "../../Common/PopcornOptions.azsli" -#if PK_O3DE_NEW_PBR #include -#else -#include -#endif #include "../../Common/MaterialSrg.azsli" diff --git a/Assets/shaders/Common/LightingHelper.azsli b/Assets/shaders/Common/LightingHelper.azsli index 8983954..5784d96 100644 --- a/Assets/shaders/Common/LightingHelper.azsli +++ b/Assets/shaders/Common/LightingHelper.azsli @@ -7,11 +7,7 @@ #include "PopcornOptions.azsli" -#if PK_O3DE_NEW_PBR #include -#else -#include -#endif #include #include @@ -22,25 +18,16 @@ #include #include -#if PK_O3DE_NEW_PBR #include -#else -#include -#endif #include -#if PK_O3DE_NEW_PBR #include -#endif #include #include // Helper function to compute forward lighting output for particles: ForwardPassOutput ComputeParticleLighting(float3 worldPosition, float4 position, -#if !PK_O3DE_NEW_LIT - float3 shadowCoords[ViewSrg::MaxCascadeCount], -#endif float3 vertexNormal, float3 normal, float3 tangent, @@ -104,11 +91,6 @@ ForwardPassOutput ComputeParticleLighting(float3 worldPosition, lightingData.Init(surface.position, surface.normal, surface.roughnessLinear); #endif -#if !PK_O3DE_NEW_LIT - // Directional light shadow coordinates - lightingData.shadowCoords = shadowCoords; -#endif - // ------- Emissive ------- lightingData.emissiveLighting = emissive; @@ -138,18 +120,10 @@ ForwardPassOutput ComputeParticleLighting(float3 worldPosition, ApplyDecals(lightingData.tileIterator, surface); // Apply Direct Lighting -#if PK_O3DE_NEW_LIT ApplyDirectLighting(surface, lightingData, position); -#else - ApplyDirectLighting(surface, lightingData); -#endif // Apply Image Based Lighting (IBL) -#if PK_O3DE_NEW_PBR ApplyIblForward(surface, lightingData); -#else - ApplyIBL(surface, lightingData); -#endif // Finalize Lighting lightingData.FinalizeLighting(); diff --git a/Assets/shaders/Common/PopcornOptions.azsli b/Assets/shaders/Common/PopcornOptions.azsli index aafadf0..9b82ddf 100644 --- a/Assets/shaders/Common/PopcornOptions.azsli +++ b/Assets/shaders/Common/PopcornOptions.azsli @@ -5,7 +5,5 @@ #pragma once -#define PK_O3DE_NEW_LIT 1 -#define PK_O3DE_NEW_PBR 1 #define PK_O3DE_LIT_MULTI_VIEW 0 diff --git a/Assets/shaders/Mesh/Legacy/MeshLit_Legacy.azsl b/Assets/shaders/Mesh/Legacy/MeshLit_Legacy.azsl index ca54812..e760ab3 100644 --- a/Assets/shaders/Mesh/Legacy/MeshLit_Legacy.azsl +++ b/Assets/shaders/Mesh/Legacy/MeshLit_Legacy.azsl @@ -45,9 +45,6 @@ struct VertexOutput float2 m_texCoord0 : UV1; float m_alphaCursor : UV2; float4 m_clipPosition : UV3; -#if !PK_O3DE_NEW_LIT - float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV4; -#endif }; VertexOutput MeshVS(VertexInput input) @@ -60,13 +57,6 @@ VertexOutput MeshVS(VertexInput input) float4 vtxWorldPos = mul(mat, float4(input.m_position.xyz, 1)); float3 vtxNormal = mul(mat, input.m_normal.xyz); -#if !PK_O3DE_NEW_LIT - // directional light shadow - const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; - if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount) - DirectionalLightShadow::GetShadowCoords(shadowIndex, vtxWorldPos, vtxNormal, output.m_shadowCoords); -#endif - // TBN: float3 vtxTangent = mul(mat, input.m_tangent.xyz); float3 vtxBitangent = mul(mat, cross(input.m_normal, input.m_tangent.xyz) * -input.m_tangent.w); @@ -133,9 +123,6 @@ ForwardPassOutput MeshFS(VertexOutput input, bool isFrontFace : SV_IsFrontFace) // Compute lighting: return ComputeParticleLighting( input.m_worldPosition, input.m_position, -#if !PK_O3DE_NEW_LIT - input.m_shadowCoords, -#endif vertexNormal, normal, tangent, diff --git a/Assets/shaders/Mesh/Legacy/Mesh_Legacy.azsl b/Assets/shaders/Mesh/Legacy/Mesh_Legacy.azsl index 9055036..ba6411f 100644 --- a/Assets/shaders/Mesh/Legacy/Mesh_Legacy.azsl +++ b/Assets/shaders/Mesh/Legacy/Mesh_Legacy.azsl @@ -7,11 +7,7 @@ #include #include "../../Common/PopcornOptions.azsli" -#if PK_O3DE_NEW_PBR #include -#else -#include -#endif #include "../../Common/MaterialSrg.azsli" // Renderer: diff --git a/Assets/shaders/Ribbon/Default/RibbonDistortion.azsl b/Assets/shaders/Ribbon/Default/RibbonDistortion.azsl index 6990a29..9fdb6ef 100644 --- a/Assets/shaders/Ribbon/Default/RibbonDistortion.azsl +++ b/Assets/shaders/Ribbon/Default/RibbonDistortion.azsl @@ -7,11 +7,7 @@ #include #include "../../Common/PopcornOptions.azsli" -#if PK_O3DE_NEW_PBR #include -#else -#include -#endif #include "../../Common/MaterialSrg.azsli" #include "../../Common/RibbonSrg.azsli" diff --git a/Assets/shaders/Ribbon/Legacy/RibbonLit_Legacy.azsl b/Assets/shaders/Ribbon/Legacy/RibbonLit_Legacy.azsl index 95e99cf..a09f482 100644 --- a/Assets/shaders/Ribbon/Legacy/RibbonLit_Legacy.azsl +++ b/Assets/shaders/Ribbon/Legacy/RibbonLit_Legacy.azsl @@ -58,9 +58,6 @@ struct VertexOutput float3 m_emissiveColor : COLOR1; float m_alphaCursor : UV2; float4 m_clipPosition : UV3; -#if !PK_O3DE_NEW_LIT - float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV4; -#endif }; struct VertexOutputAtlasBlend @@ -78,9 +75,6 @@ struct VertexOutputAtlasBlend float3 m_emissiveColor : COLOR1; float m_alphaCursor : UV4; float4 m_clipPosition : UV5; -#if !PK_O3DE_NEW_LIT - float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV6; -#endif }; struct VertexOutputCorrectDeformation @@ -98,9 +92,6 @@ struct VertexOutputCorrectDeformation float3 m_emissiveColor : COLOR1; float m_alphaCursor : UV4; float4 m_clipPosition : UV5; -#if !PK_O3DE_NEW_LIT - float3 m_shadowCoords[ViewSrg::MaxCascadeCount] : UV6; -#endif }; VertexOutput RibbonVS(VertexInput input) @@ -132,13 +123,6 @@ VertexOutput RibbonVS(VertexInput input) output.m_bitangent = cross(input.m_tangent.xyz, input.m_normal) * input.m_tangent.w; output.m_worldPosition = input.m_position.xyz; -#if !PK_O3DE_NEW_LIT - // directional light shadow - const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; - if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount) - DirectionalLightShadow::GetShadowCoords(shadowIndex, input.m_position.xyz, input.m_normal, output.m_shadowCoords); -#endif - return output; } @@ -174,13 +158,6 @@ VertexOutputAtlasBlend RibbonVS_AtlasBlend(VertexInputAtlasBlend input) output.m_bitangent = cross(input.m_normal, input.m_tangent.xyz) * input.m_tangent.w; output.m_worldPosition = input.m_position.xyz; -#if !PK_O3DE_NEW_LIT - // directional light shadow - const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; - if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount) - DirectionalLightShadow::GetShadowCoords(shadowIndex, input.m_position.xyz, input.m_normal, output.m_shadowCoords); -#endif - return output; } @@ -216,13 +193,6 @@ VertexOutputCorrectDeformation RibbonVS_CorrectDeformation(VertexInputCorrectDef output.m_bitangent = cross(input.m_normal, input.m_tangent.xyz) * input.m_tangent.w; output.m_worldPosition = input.m_position.xyz; -#if !PK_O3DE_NEW_LIT - // directional light shadow - const uint shadowIndex = ViewSrg::m_shadowIndexDirectionalLight; - if (o_enableShadows && shadowIndex < SceneSrg::m_directionalLightCount) - DirectionalLightShadow::GetShadowCoords(shadowIndex, input.m_position.xyz, input.m_normal, output.m_shadowCoords); -#endif - return output; } @@ -267,9 +237,6 @@ ForwardPassOutput RibbonFS(VertexOutput input, bool isFrontFace : SV_IsFrontFace // Compute lighting: return ComputeParticleLighting( input.m_worldPosition, input.m_position, -#if !PK_O3DE_NEW_LIT - input.m_shadowCoords, -#endif vertexNormal, normal, tangent, @@ -327,9 +294,6 @@ ForwardPassOutput RibbonFS_AtlasBlend(VertexOutputAtlasBlend input, bool isFront // Compute lighting: return ComputeParticleLighting( input.m_worldPosition, input.m_position, -#if !PK_O3DE_NEW_LIT - input.m_shadowCoords, -#endif vertexNormal, normal, tangent, @@ -378,9 +342,6 @@ ForwardPassOutput RibbonFS_CorrectDeformation(VertexOutputCorrectDeformation inp // Compute lighting: return ComputeParticleLighting( input.m_worldPosition, input.m_position, -#if !PK_O3DE_NEW_LIT - input.m_shadowCoords, -#endif vertexNormal, normal, tangent, diff --git a/Assets/shaders/Ribbon/Legacy/Ribbon_Legacy.azsl b/Assets/shaders/Ribbon/Legacy/Ribbon_Legacy.azsl index 3bbc333..1afa873 100644 --- a/Assets/shaders/Ribbon/Legacy/Ribbon_Legacy.azsl +++ b/Assets/shaders/Ribbon/Legacy/Ribbon_Legacy.azsl @@ -7,11 +7,7 @@ #include #include "../../Common/PopcornOptions.azsli" -#if PK_O3DE_NEW_PBR #include -#else -#include -#endif #include "../../Common/MaterialSrg.azsli" #include "../../Common/RibbonSrg.azsli" diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b6822c..38ca9b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,82 +3,26 @@ # https://www.popcornfx.com/terms-and-conditions/ #---------------------------------------------------------------------------- -#List of supported O3DE versions, uncomment one of the line to force the version -#set(PK_O3DE_ENGINE_VERSION "2305.0") -#set(PK_O3DE_ENGINE_VERSION "2210.0") -#set(PK_O3DE_ENGINE_VERSION "2205.0") -#set(PK_O3DE_ENGINE_VERSION "2111.2") -#set(PK_O3DE_ENGINE_VERSION "2111.1") - -#Latest supported O3DE version -set(PK_O3DE_ENGINE_VERSION_LATEST "2305.0") - -if (${PK_O3DE_ENGINE_VERSION}) - set(o3de_build_number ${PK_O3DE_ENGINE_VERSION}) -else() - ly_file_read(${LY_ROOT_FOLDER}/engine.json manifest_json_data) - - # Use the engine.json file version to determine the version and build fields - string(JSON file_version ERROR_VARIABLE manifest_json_error GET ${manifest_json_data} "file_version") - if(file_version GREATER_EQUAL 2) - set(o3de_build_number_key "build") - set(o3de_display_version_key "display_version") - set(o3de_version_key "version") - else() - set(o3de_build_number_key "O3DEBuildNumber") - set(o3de_display_version_key "O3DEVersion") - set(o3de_version_key "O3DEVersion") - endif() - - string(JSON o3de_display_version ERROR_VARIABLE manifest_json_error GET ${manifest_json_data} ${o3de_display_version_key}) - - # During development the engine display version is not used - if (o3de_display_version STREQUAL "00.00" OR o3de_display_version STREQUAL "0.1.0.0") - set(PK_O3DE_DEVELOPMENT ON) - set(o3de_build_number ${PK_O3DE_ENGINE_VERSION_LATEST}) - else () - string(JSON o3de_build_number ERROR_VARIABLE manifest_json_error GET ${manifest_json_data} ${o3de_build_number_key}) - if (manifest_json_error OR o3de_build_number STREQUAL "" OR o3de_build_number STREQUAL "0") - message(FATAL_ERROR "Invalid ${o3de_build_number_key} or ${o3de_display_version_key} in 'engine.json'. Please set PK_O3DE_ENGINE_VERSION in the PopcornFX CMakeLists.txt.") - endif() - endif() -endif() - # O3DE version 1.2.0 (23.05.0) and higher provide version major/minor/patch global properties get_property(O3DE_VERSION_MAJOR GLOBAL PROPERTY O3DE_VERSION_MAJOR) get_property(O3DE_VERSION_MINOR GLOBAL PROPERTY O3DE_VERSION_MINOR) get_property(O3DE_VERSION_PATCH GLOBAL PROPERTY O3DE_VERSION_PATCH) -# Note: converting a float to string may result in a bad conversion -# e.g. 2111.2 becomes the string 2111.1999999999998 -string(REPLACE "." ";" o3de_version_list ${o3de_build_number}) -list(GET o3de_version_list 0 PK_O3DE_MAJOR_VERSION) -list(GET o3de_version_list 1 PK_O3DE_PATCH_VERSION) - -if (${PK_O3DE_DEVELOPMENT}) - MATH(EXPR PK_O3DE_MAJOR_VERSION "${PK_O3DE_MAJOR_VERSION}+1") -endif() - set(gem_path ${CMAKE_CURRENT_LIST_DIR}) set(gem_json ${gem_path}/gem.json) o3de_restricted_path(${gem_json} gem_restricted_path gem_parent_relative_path) -if (PK_O3DE_MAJOR_VERSION GREATER_EQUAL 2205) - o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_parent_relative_path}") -else () - o3de_read_json_key(gem_name ${gem_json} "gem_name") - ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" ${gem_path} ${gem_name}) -endif () +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_parent_relative_path}") # Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the # project cmake for this platform. include(${pal_dir}/${PAL_PLATFORM_NAME_LOWERCASE}_gem.cmake) function(pk_patch_file old_string new_string path) - unset(shader_content) - ly_file_read(${path} shader_content) - string(REPLACE ${old_string} ${new_string} shader_content "${shader_content}") - file(WRITE ${path} "${shader_content}") + unset(file_content) + ly_file_read(${path} file_content) + string(REPLACE ${old_string} ${new_string} file_content "${file_content}") + file(WRITE ${path} "${file_content}") endfunction() if(DEFINED O3DE_VERSION_MAJOR) @@ -89,40 +33,21 @@ if(DEFINED O3DE_VERSION_MAJOR) if((O3DE_VERSION_MAJOR EQUAL 23 AND O3DE_VERSION_MINOR EQUAL 05 AND O3DE_VERSION_PATCH EQUAL 0) OR (O3DE_VERSION_MAJOR EQUAL 1 AND O3DE_VERSION_MINOR GREATER_EQUAL 2) OR (O3DE_VERSION_MAJOR EQUAL 2 AND O3DE_VERSION_MINOR LESS_EQUAL 1)) - message(VERBOSE "Activating PopcornFX gem for O3DE ${PK_O3DE_MAJOR_VERSION}") + message(VERBOSE "Activating PopcornFX gem for O3DE ${O3DE_VERSION_MAJOR}.${O3DE_VERSION_MINOR}.${O3DE_VERSION_PATCH}") ly_enable_gems(GEMS PopcornFX) endif() - # 23.05 had the display version in version property - if(NOT (O3DE_VERSION_MAJOR EQUAL 23 AND O3DE_VERSION_MINOR EQUAL 05)) - # Apply patches here IFN - if(O3DE_VERSION_MAJOR GREATER_EQUAL 4) - pk_patch_file("PK_O3DE_LIT_MULTI_VIEW 0" "PK_O3DE_LIT_MULTI_VIEW 1" ${gem_path}/Assets/shaders/Common/PopcornOptions.azsli) - endif() + # Special case to handle bug where SDK 23.05.0 engine version was set to the display version + if(O3DE_VERSION_MAJOR EQUAL 23 AND O3DE_VERSION_MINOR EQUAL 05) + set(O3DE_VERSION_MAJOR 1) + set(O3DE_VERSION_MINOR 2) endif() -endif() -if (PK_O3DE_MAJOR_VERSION GREATER 2210) - pk_patch_file("\"BlendState\"" "\"GlobalTargetBlendState\"" ${gem_path}/Assets/shaders/Billboard/Default/Billboard.shader) - pk_patch_file("\"BlendState\"" "\"GlobalTargetBlendState\"" ${gem_path}/Assets/shaders/Billboard/Default/BillboardDistortion.shader) - pk_patch_file("\"BlendState\"" "\"GlobalTargetBlendState\"" ${gem_path}/Assets/shaders/Ribbon/Default/RibbonDistortion.shader) - pk_patch_file("\"BlendState\"" "\"GlobalTargetBlendState\"" ${gem_path}/Assets/shaders/PostProcess/DistortionPostProcess.shader) - pk_patch_file("PK_O3DE_NEW_LIT 0" "PK_O3DE_NEW_LIT 1" ${gem_path}/Assets/shaders/Common/PopcornOptions.azsli) - pk_patch_file("PK_O3DE_NEW_PBR 0" "PK_O3DE_NEW_PBR 1" ${gem_path}/Assets/shaders/Common/PopcornOptions.azsli) -elseif (PK_O3DE_MAJOR_VERSION EQUAL 2210) - pk_patch_file("\"BlendState\"" "\"GlobalTargetBlendState\"" ${gem_path}/Assets/shaders/Billboard/Default/Billboard.shader) - pk_patch_file("\"BlendState\"" "\"GlobalTargetBlendState\"" ${gem_path}/Assets/shaders/Billboard/Default/BillboardDistortion.shader) - pk_patch_file("\"BlendState\"" "\"GlobalTargetBlendState\"" ${gem_path}/Assets/shaders/Ribbon/Default/RibbonDistortion.shader) - pk_patch_file("\"BlendState\"" "\"GlobalTargetBlendState\"" ${gem_path}/Assets/shaders/PostProcess/DistortionPostProcess.shader) - pk_patch_file("PK_O3DE_NEW_LIT 0" "PK_O3DE_NEW_LIT 1" ${gem_path}/Assets/shaders/Common/PopcornOptions.azsli) - pk_patch_file("PK_O3DE_NEW_PBR 1" "PK_O3DE_NEW_PBR 0" ${gem_path}/Assets/shaders/Common/PopcornOptions.azsli) -else () - pk_patch_file("\"GlobalTargetBlendState\"" "\"BlendState\"" ${gem_path}/Assets/shaders/Billboard/Default/Billboard.shader) - pk_patch_file("\"GlobalTargetBlendState\"" "\"BlendState\"" ${gem_path}/Assets/shaders/Billboard/Default/BillboardDistortion.shader) - pk_patch_file("\"GlobalTargetBlendState\"" "\"BlendState\"" ${gem_path}/Assets/shaders/Ribbon/Default/RibbonDistortion.shader) - pk_patch_file("\"GlobalTargetBlendState\"" "\"BlendState\"" ${gem_path}/Assets/shaders/PostProcess/DistortionPostProcess.shader) - pk_patch_file("PK_O3DE_NEW_LIT 1" "PK_O3DE_NEW_LIT 0" ${gem_path}/Assets/shaders/Common/PopcornOptions.azsli) - pk_patch_file("PK_O3DE_NEW_PBR 1" "PK_O3DE_NEW_PBR 0" ${gem_path}/Assets/shaders/Common/PopcornOptions.azsli) -endif () + # Apply patches here IFN + if(O3DE_VERSION_MAJOR GREATER_EQUAL 4) + # See: https://github.com/o3de/o3de/commit/c1019253252cf475131151149b8b865815d75fb0 + pk_patch_file("PK_O3DE_LIT_MULTI_VIEW 0" "PK_O3DE_LIT_MULTI_VIEW 1" ${gem_path}/Assets/shaders/Common/PopcornOptions.azsli) + endif() +endif() add_subdirectory(Code) diff --git a/Code/CMakeLists.txt b/Code/CMakeLists.txt index ea171ef..d5cd022 100644 --- a/Code/CMakeLists.txt +++ b/Code/CMakeLists.txt @@ -3,14 +3,10 @@ # https://www.popcornfx.com/terms-and-conditions/ #---------------------------------------------------------------------------- -set(POPCORNFX_VERSION 2.18.6) +set(POPCORNFX_VERSION 2.19.0) set(POPCORNFX_LICENSE O3DE) -if (PK_O3DE_MAJOR_VERSION GREATER_EQUAL 2205) - o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_name}") -else() - ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} ${gem_restricted_path} ${gem_path} ${gem_name}) -endif() +o3de_pal_dir(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME} "${gem_restricted_path}" "${gem_path}" "${gem_name}") include(${CMAKE_CURRENT_LIST_DIR}/Platform/PopcornFXPackages.cmake) include(${pal_dir}/PAL_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) #for PAL_TRAIT_POPCORNFX_SUPPORTED Traits @@ -19,8 +15,11 @@ if(NOT PAL_TRAIT_POPCORNFX_SUPPORTED) return() endif() -add_compile_definitions(PK_O3DE_MAJOR_VERSION=${PK_O3DE_MAJOR_VERSION}) -add_compile_definitions(PK_O3DE_PATCH_VERSION=${PK_O3DE_PATCH_VERSION}) +if(DEFINED O3DE_VERSION_MAJOR) + add_compile_definitions(O3DE_VERSION_MAJOR=${O3DE_VERSION_MAJOR}) + add_compile_definitions(O3DE_VERSION_MINOR=${O3DE_VERSION_MINOR}) + add_compile_definitions(O3DE_VERSION_PATCH=${O3DE_VERSION_PATCH}) +endif() # The PopcornFX.API target declares the common interface that users of this gem can depend on in their targets without requiring linking. ly_add_target( @@ -41,9 +40,7 @@ set(PK_OPTIONAL_REGISTER_NODEABLE_DEFINES PK_REGISTER_NODEABLE) if(DEFINED O3DE_VERSION_MAJOR) # O3DE 3.x.x and higher no longer need the autogen nodeable registry source files - # Also include special case to handle bug where SDK 23.05.0 engine version was set to the display version - if(O3DE_VERSION_MAJOR GREATER_EQUAL 3 AND - NOT (O3DE_VERSION_MAJOR EQUAL 23 AND O3DE_VERSION_MINOR EQUAL 05 AND O3DE_VERSION_PATCH EQUAL 0)) + if(O3DE_VERSION_MAJOR GREATER_EQUAL 3) unset(PK_OPTIONAL_REGISTER_NODEABLE_FILES) unset(PK_OPTIONAL_REGISTER_NODEABLE_DEFINES) endif() diff --git a/Code/Include/PopcornFX/PopcornFXBus.h b/Code/Include/PopcornFX/PopcornFXBus.h index 797aaff..23fc01f 100644 --- a/Code/Include/PopcornFX/PopcornFXBus.h +++ b/Code/Include/PopcornFX/PopcornFXBus.h @@ -24,15 +24,9 @@ namespace PopcornFX namespace PopcornFX { -#if PK_O3DE_MAJOR_VERSION > 2210 static constexpr AZ::Uuid EmitterComponentTypeId = AZ::Uuid("{515957e3-8354-4048-8d6c-98628ef21804}"); static constexpr AZ::Uuid EditorEmitterComponentTypeId = AZ::Uuid("{B62ED02E-731B-4ACD-BCA1-78EF92528228}"); static constexpr AZ::Uuid AssetTypeId = AZ::Uuid("{45047C35-64F7-43BA-B463-000081B587C3}"); -#else - static const AZ::Uuid EmitterComponentTypeId = AZ::Uuid("{515957e3-8354-4048-8d6c-98628ef21804}"); - static const AZ::Uuid EditorEmitterComponentTypeId = AZ::Uuid("{B62ED02E-731B-4ACD-BCA1-78EF92528228}"); - static const AZ::Uuid AssetTypeId = AZ::Uuid("{45047C35-64F7-43BA-B463-000081B587C3}"); -#endif class PopcornFXEmitterRuntime; diff --git a/Code/Platform/Linux/PAL_linux.cmake b/Code/Platform/Linux/PAL_linux.cmake index fcc2611..73857c1 100644 --- a/Code/Platform/Linux/PAL_linux.cmake +++ b/Code/Platform/Linux/PAL_linux.cmake @@ -6,12 +6,12 @@ set(LY_PACKAGE_SERVER_URLS ${LY_PACKAGE_SERVER_URLS} "https://downloads.popcornfx.com/o3de-packages") if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") set(package_name PopcornFX-${POPCORNFX_VERSION}-${POPCORNFX_LICENSE}-linux) - set(pk_package_hash b0295eca1edeb01eeff59697b317946f98b992c3d040e0343c24feeb7d7ad1f6) - set(pk_package_id ydXuX23Oq5b82XC2) + set(pk_package_hash e7f078351f2dccee12d3cac90c75d1141a32f47dfe3c7e7b705282984d519a69) + set(pk_package_id VbdAxlBoOSrTU6bQ) elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") set(package_name PopcornFX-${POPCORNFX_VERSION}-${POPCORNFX_LICENSE}-linux-aarch64) - set(pk_package_hash b0295eca1edeb01eeff59697b317946f98b992c3d040e0343c24feeb7d7ad1f6_ARM64) - set(pk_package_id ydXuX23Oq5b82XC2_ARM64) + set(pk_package_hash e7f078351f2dccee12d3cac90c75d1141a32f47dfe3c7e7b705282984d519a69_ARM64) + set(pk_package_id VbdAxlBoOSrTU6bQ_ARM64) else() message(FATAL_ERROR "Unsupported linux architecture ${CMAKE_SYSTEM_PROCESSOR}") endif() diff --git a/Code/Platform/Mac/PAL_mac.cmake b/Code/Platform/Mac/PAL_mac.cmake index dd9b106..3255eaa 100644 --- a/Code/Platform/Mac/PAL_mac.cmake +++ b/Code/Platform/Mac/PAL_mac.cmake @@ -5,8 +5,8 @@ set(LY_PACKAGE_SERVER_URLS ${LY_PACKAGE_SERVER_URLS} "https://downloads.popcornfx.com/o3de-packages") set(package_name PopcornFX-${POPCORNFX_VERSION}-${POPCORNFX_LICENSE}-mac) -set(pk_package_hash 9513d1d0ac3b6c2c6468d16540189a773ebebf370c5b55c74a6cfb63ab1814ad) -set(pk_package_id 524rU2tRcNpTPvss) +set(pk_package_hash c0ce1e2697a8a04ede33e61be2248fec5ee3961859fe89059246f08481215cc2) +set(pk_package_id ev2LZdxqEOqQWELc) ly_associate_package(PACKAGE_NAME ${package_name} TARGETS PopcornFX PACKAGE_HASH ${pk_package_hash}) pk_download_package_ifn(${package_name} ${pk_package_id}) diff --git a/Code/Platform/Windows/PAL_windows.cmake b/Code/Platform/Windows/PAL_windows.cmake index a56040f..b7abf5b 100644 --- a/Code/Platform/Windows/PAL_windows.cmake +++ b/Code/Platform/Windows/PAL_windows.cmake @@ -5,8 +5,8 @@ set(LY_PACKAGE_SERVER_URLS ${LY_PACKAGE_SERVER_URLS} "https://downloads.popcornfx.com/o3de-packages") set(package_name PopcornFX-${POPCORNFX_VERSION}-${POPCORNFX_LICENSE}-windows) -set(pk_package_hash 3cd0958bf36f4ada75cd46120be94f6a92ce7b8d0c7829919081107433df08cc) -set(pk_package_id LfE6ZMS827USLbCP) +set(pk_package_hash 703f4276dd65be2fb6fc2723344f4e380ccaf83ca60d25d0ca6cef9887c906e8) +set(pk_package_id I4ZSZ4vr4XHJpJmg) ly_associate_package(PACKAGE_NAME ${package_name} TARGETS PopcornFX PACKAGE_HASH ${pk_package_hash}) pk_download_package_ifn(${package_name} ${pk_package_id}) diff --git a/Code/Source/Components/Samplers/PopcornFXSamplerImage.cpp b/Code/Source/Components/Samplers/PopcornFXSamplerImage.cpp index 8c0e3eb..4e395b2 100644 --- a/Code/Source/Components/Samplers/PopcornFXSamplerImage.cpp +++ b/Code/Source/Components/Samplers/PopcornFXSamplerImage.cpp @@ -133,11 +133,7 @@ namespace PopcornFX { if (!PK_VERIFY(m_ImageSampler != null)) return false; -#if PK_O3DE_MAJOR_VERSION >= 2205 - AZStd::span imgData = m_Texture->GetSubImageData(0, 0); -#else - const AZStd::array_view imgData = m_Texture->GetSubImageData(0, 0); -#endif + AZStd::span imgData = m_Texture->GetSubImageData(0, 0); const AZ::RHI::Format imgFormat = imgDesc.m_format; const AZ::RHI::Size imgSize = imgDesc.m_size; diff --git a/Code/Source/Integration/Editor/BakerManager.cpp b/Code/Source/Integration/Editor/BakerManager.cpp index f3627ce..f2820ee 100644 --- a/Code/Source/Integration/Editor/BakerManager.cpp +++ b/Code/Source/Integration/Editor/BakerManager.cpp @@ -177,7 +177,7 @@ bool CBakerManager::Activate() PK_VERIFY(extensionsRemap.PushBack(CString("tif=tif.streamingimage")).Valid()) && PK_VERIFY(extensionsRemap.PushBack(CString("tiff=tiff.streamingimage")).Valid()) && PK_VERIFY(extensionsRemap.PushBack(CString("dds=dds.streamingimage")).Valid()) && -#if PK_O3DE_MAJOR_VERSION > 2305 +#if O3DE_VERSION_MAJOR >= 2 // https://github.com/o3de/o3de/pull/16517 PK_VERIFY(extensionsRemap.PushBack(CString("fbx=fbx.azmodel")).Valid())) #else PK_VERIFY(extensionsRemap.PushBack(CString("fbx=azmodel")).Valid())) diff --git a/Code/Source/Integration/Managers/StatsManager.cpp b/Code/Source/Integration/Managers/StatsManager.cpp index a360ddb..80be910 100644 --- a/Code/Source/Integration/Managers/StatsManager.cpp +++ b/Code/Source/Integration/Managers/StatsManager.cpp @@ -10,11 +10,7 @@ #include -#if PK_O3DE_MAJOR_VERSION >= 2205 #include -#else -#include -#endif #include #include diff --git a/Code/Source/Integration/Render/AtomIntegration/PopcornFXFeatureProcessor.cpp b/Code/Source/Integration/Render/AtomIntegration/PopcornFXFeatureProcessor.cpp index 949ce8c..5a74b42 100644 --- a/Code/Source/Integration/Render/AtomIntegration/PopcornFXFeatureProcessor.cpp +++ b/Code/Source/Integration/Render/AtomIntegration/PopcornFXFeatureProcessor.cpp @@ -21,9 +21,6 @@ #include #include -#if PK_O3DE_MAJOR_VERSION == 2111 -#include -#endif #endif //O3DE_USE_PK @@ -148,13 +145,8 @@ const AZ::RHI::DrawPacket *CPopcornFXFeatureProcessor::BuildDrawPacket( const SA AZ::RHI::DrawPacketBuilder::DrawRequest materialDr; materialDr.m_listTag = pkfxDrawCall.m_MaterialDrawList; materialDr.m_pipelineState = pkfxDrawCall.m_MaterialPipelineState.get(); -#if PK_O3DE_MAJOR_VERSION >= 2205 materialDr.m_streamBufferViews = AZStd::span( pkfxDrawCall.m_VertexInputs.RawDataPointer(), pkfxDrawCall.m_VertexInputs.Count()); -#else - materialDr.m_streamBufferViews = AZStd::array_view( pkfxDrawCall.m_VertexInputs.RawDataPointer(), - pkfxDrawCall.m_VertexInputs.Count()); -#endif // TODO: set this depending on lit state. materialDr.m_stencilRef = (AZ::Render::StencilRefs::UseIBLSpecularPass | AZ::Render::StencilRefs::UseDiffuseGIPass); @@ -163,32 +155,18 @@ const AZ::RHI::DrawPacket *CPopcornFXFeatureProcessor::BuildDrawPacket( const SA dpBuilder.AddDrawItem(materialDr); } -#if PK_O3DE_MAJOR_VERSION >= 2205 AZStd::span depthVtxInput; -#else - AZStd::array_view depthVtxInput; -#endif if (pkfxDrawCall.m_RendererType == Renderer_Billboard || pkfxDrawCall.m_RendererType == Renderer_Mesh) { -#if PK_O3DE_MAJOR_VERSION >= 2205 depthVtxInput = AZStd::span( pkfxDrawCall.m_VertexInputs.RawDataPointer(), pkfxDrawCall.m_VertexInputs.Count()); -#else - depthVtxInput = AZStd::array_view( pkfxDrawCall.m_VertexInputs.RawDataPointer(), - pkfxDrawCall.m_VertexInputs.Count()); -#endif } else { -#if PK_O3DE_MAJOR_VERSION >= 2205 depthVtxInput = AZStd::span( pkfxDrawCall.m_VertexInputs.RawDataPointer(), 1); -#else - depthVtxInput = AZStd::array_view( pkfxDrawCall.m_VertexInputs.RawDataPointer(), - 1); -#endif } if (pkfxDrawCall.m_OpaqueDepthPipelineState != null) @@ -226,7 +204,7 @@ const AZ::RHI::DrawPacket *CPopcornFXFeatureProcessor::BuildDrawPacket( const SA AZ::RHI::ShaderInputConstantIndex useReflectionProbeConstantIndex = objectSrg->FindShaderInputConstantIndex(AZ::Name("m_reflectionProbeData.m_useReflectionProbe")); AZ_Error("MeshDataInstance", useReflectionProbeConstantIndex.IsValid(), "Failed to find ReflectionProbe constant index"); -#if PK_O3DE_MAJOR_VERSION == 2111 +#if 0 //PK_O3DE_MAJOR_VERSION == 2111 //See : https://github.com/o3de/o3de/pull/7189 and https://github.com/o3de/o3de/issues/7434 AZ::RHI::ShaderInputConstantIndex modelToWorldConstantIndex = objectSrg->FindShaderInputConstantIndex(AZ::Name("m_reflectionProbeData.m_modelToWorld")); AZ_Error("MeshDataInstance", modelToWorldConstantIndex.IsValid(), "Failed to find ReflectionProbe constant index"); @@ -283,7 +261,6 @@ const AZ::RHI::DrawPacket *CPopcornFXFeatureProcessor::BuildDrawPacket( const SA return dpBuilder.End(); } -#if PK_O3DE_MAJOR_VERSION > 2210 void CPopcornFXFeatureProcessor::OnRenderPipelineChanged( AZ::RPI::RenderPipeline *renderPipeline, AZ::RPI::SceneNotification::RenderPipelineChangeType changeType) { @@ -295,17 +272,6 @@ void CPopcornFXFeatureProcessor::AddRenderPasses(AZ::RPI::RenderPipeline *render { AddDistortionRenderPass(renderPipeline); } -#else -void CPopcornFXFeatureProcessor::OnRenderPipelinePassesChanged(AZ::RPI::RenderPipeline *renderPipeline) -{ - UpdateDistortionRenderPassBindings(renderPipeline); -} - -void CPopcornFXFeatureProcessor::OnRenderPipelineAdded(AZ::RPI::RenderPipelinePtr renderPipeline) -{ - AddDistortionRenderPass(renderPipeline.get()); -} -#endif void CPopcornFXFeatureProcessor::AddDistortionRenderPass(AZ::RPI::RenderPipeline *renderPipeline) { diff --git a/Code/Source/Integration/Render/AtomIntegration/PopcornFXFeatureProcessor.h b/Code/Source/Integration/Render/AtomIntegration/PopcornFXFeatureProcessor.h index ea71ef4..f76fb14 100644 --- a/Code/Source/Integration/Render/AtomIntegration/PopcornFXFeatureProcessor.h +++ b/Code/Source/Integration/Render/AtomIntegration/PopcornFXFeatureProcessor.h @@ -40,13 +40,8 @@ class CPopcornFXFeatureProcessor : public CPopcornFXFeatureProcessorInterface void Deactivate() override; void Simulate(const SimulatePacket &packet) override; void Render(const RenderPacket &packet) override; -#if PK_O3DE_MAJOR_VERSION > 2210 void OnRenderPipelineChanged(AZ::RPI::RenderPipeline *renderPipeline, AZ::RPI::SceneNotification::RenderPipelineChangeType changeType) override; void AddRenderPasses(AZ::RPI::RenderPipeline *renderPipeline) override; -#else - void OnRenderPipelinePassesChanged(AZ::RPI::RenderPipeline *renderPipeline) override; - void OnRenderPipelineAdded(AZ::RPI::RenderPipelinePtr renderPipeline) override; -#endif void AddDistortionRenderPass(AZ::RPI::RenderPipeline* renderPipeline); void UpdateDistortionRenderPassBindings(AZ::RPI::RenderPipeline* renderPipeline); diff --git a/Code/Source/Integration/ResourceHandlers/ImageResourceHandler.cpp b/Code/Source/Integration/ResourceHandlers/ImageResourceHandler.cpp index db76ea2..a5e755d 100644 --- a/Code/Source/Integration/ResourceHandlers/ImageResourceHandler.cpp +++ b/Code/Source/Integration/ResourceHandlers/ImageResourceHandler.cpp @@ -95,11 +95,7 @@ void *CImageResourceHandler::Load( const CResourceManager *resourceManager, return null; } -#if PK_O3DE_MAJOR_VERSION >= 2205 AZStd::span imgData = streamingImageAsset->GetSubImageData(0, 0); -#else - AZStd::array_view imgData = streamingImageAsset->GetSubImageData(0, 0); -#endif AZ::RHI::Format imgFormat = imgDesc.m_format; AZ::RHI::Size imgSize = imgDesc.m_size; diff --git a/Code/Source/Integration/ResourceHandlers/MeshResourceHandler.cpp b/Code/Source/Integration/ResourceHandlers/MeshResourceHandler.cpp index e0d18d3..308dfcb 100644 --- a/Code/Source/Integration/ResourceHandlers/MeshResourceHandler.cpp +++ b/Code/Source/Integration/ResourceHandlers/MeshResourceHandler.cpp @@ -98,21 +98,12 @@ void *CMeshResourceHandler::Load( const CResourceManager *resourceManager, return null; } -#if PK_O3DE_MAJOR_VERSION >= 2205 const AZStd::span srcIndices = mesh.GetIndexBufferTyped(); const AZStd::span srcPositions = mesh.GetSemanticBufferTyped(AZ::Name("POSITION")); const AZStd::span srcNormals = mesh.GetSemanticBufferTyped(AZ::Name("NORMAL")); const AZStd::span srcUvs = mesh.GetSemanticBufferTyped(AZ::Name("UV")); const AZStd::span srcTangents = mesh.GetSemanticBufferTyped(AZ::Name("TANGENT")); const AZStd::span srcColors = mesh.GetSemanticBufferTyped(AZ::Name("COLOR")); -#else - const AZStd::array_view srcIndices = mesh.GetIndexBufferTyped(); - const AZStd::array_view srcPositions = mesh.GetSemanticBufferTyped(AZ::Name("POSITION")); - const AZStd::array_view srcNormals = mesh.GetSemanticBufferTyped(AZ::Name("NORMAL")); - const AZStd::array_view srcUvs = mesh.GetSemanticBufferTyped(AZ::Name("UV")); - const AZStd::array_view srcTangents = mesh.GetSemanticBufferTyped(AZ::Name("TANGENT")); - const AZStd::array_view srcColors = mesh.GetSemanticBufferTyped(AZ::Name("COLOR")); -#endif if (srcIndices.empty() || srcPositions.empty()) { diff --git a/Code/Source/Integration/Startup/PopcornFxPlugins.cpp b/Code/Source/Integration/Startup/PopcornFxPlugins.cpp index c46b856..7f3f7c1 100644 --- a/Code/Source/Integration/Startup/PopcornFxPlugins.cpp +++ b/Code/Source/Integration/Startup/PopcornFxPlugins.cpp @@ -19,7 +19,7 @@ // //------------------------------------------------------------------------------ -#ifdef PK_PLUGINS_STATIC +#ifdef PK_PLUGINS_STATIC # if defined(USE_COMPILER_BACKEND) PK_PLUGIN_DECLARE(CCompilerBackendCPU_VM); # endif @@ -29,7 +29,7 @@ PK_PLUGIN_DECLARE(CCompilerBackendCPU_VM); # else # define PK_PLUGIN_POSTFIX_BUILD "" # endif -# if defined(PK_WINDOWS) || defined(PK_X360) +# if defined(PK_WINDOWS) # define PK_PLUGIN_POSTFIX_EXT ".dll" # else # define PK_PLUGIN_POSTFIX_EXT "" @@ -51,18 +51,18 @@ namespace PopcornFX { PK_ASSERT(g_LoadedPlugins == 0); bool success = true; -# ifndef PK_PLUGINS_STATIC +#ifndef PK_PLUGINS_STATIC // plugins are .dll PopcornFX::CPluginManager::RegisterDirectory("Plugins", false); -# else +#else // plugins are linked statically if (selected & EPlugin_CompilerBackendVM) { - const char *backendPath = "Plugins/CBCPU_VM_Win32" PK_PLUGIN_POSTFIX_BUILD PK_PLUGIN_POSTFIX_EXT; + const char *backendPath = "Plugins/CBCPU_VM_Win32" PK_PLUGIN_POSTFIX_BUILD PK_PLUGIN_POSTFIX_EXT; IPluginModule *backend = StartupPlugin_CCompilerBackendCPU_VM(); success &= (backend != null && PopcornFX::CPluginManager::PluginRegister(backend, true, backendPath)); } -# endif +#endif g_LoadedPlugins = selected; return success; @@ -77,14 +77,14 @@ namespace PopcornFX { void PopcornUnregisterPlugins() { // unregister plugins: -# ifdef PK_PLUGINS_STATIC +#ifdef PK_PLUGINS_STATIC if (g_LoadedPlugins & EPlugin_CompilerBackendVM) { IPluginModule *backend = GetPlugin_CCompilerBackendCPU_VM(); (backend != null && PopcornFX::CPluginManager::PluginRelease(backend)); ShutdownPlugin_CCompilerBackendCPU_VM(); } -# endif +#endif g_LoadedPlugins = 0; } diff --git a/Code/Source/Integration/Startup/PopcornFxPlugins.h b/Code/Source/Integration/Startup/PopcornFxPlugins.h index a676038..2e0865e 100644 --- a/Code/Source/Integration/Startup/PopcornFxPlugins.h +++ b/Code/Source/Integration/Startup/PopcornFxPlugins.h @@ -7,27 +7,35 @@ #if defined(O3DE_USE_PK) -namespace PopcornFX { +namespace PopcornFX +{ enum ERuntimePlugin { - EPlugin_CompilerBackendVM = 1 << 0, - EPlugin_ImageCodecDDS = 1 << 1, - EPlugin_ImageCodecPNG = 1 << 2, - EPlugin_ImageCodecJPG = 1 << 3, - EPlugin_ImageCodecTGA = 1 << 4, - EPlugin_ImageCodecTIFF = 1 << 5, - EPlugin_ImageCodecPKM = 1 << 6, - EPlugin_ImageCodecPVR = 1 << 7, - - EPlugin_MeshCodecFBX = 1 << 10, // ! not in EPlugin_All - - EPlugin_All = EPlugin_CompilerBackendVM | - EPlugin_ImageCodecDDS | - EPlugin_ImageCodecPNG | - EPlugin_ImageCodecJPG | - EPlugin_ImageCodecTGA - + EPlugin_ImageCodecDDS = 1 << 0, + EPlugin_ImageCodecPNG = 1 << 1, + EPlugin_ImageCodecJPG = 1 << 2, + EPlugin_ImageCodecTGA = 1 << 3, + EPlugin_ImageCodecTIFF = 1 << 4, + EPlugin_ImageCodecPKM = 1 << 5, + EPlugin_ImageCodecPVR = 1 << 6, + EPlugin_ImageCodecHDR = 1 << 7, + EPlugin_ImageCodecEXR = 1 << 8, + + EPlugin_MeshCodecFBX = 1 << 16, + EPlugin_MeshCodecGranny = 1 << 17, + + EPlugin_CompilerBackendVM = 1 << 20, + EPlugin_CompilerBackendISPC = 1 << 21, + EPlugin_CompilerBackendD3D = 1 << 22, + EPlugin_CompilerBackendPSSLC = 1 << 23, + + // All "base" plugins + EPlugin_Default = EPlugin_CompilerBackendVM | + EPlugin_ImageCodecDDS | + EPlugin_ImageCodecPNG | + EPlugin_ImageCodecJPG | + EPlugin_ImageCodecTGA, }; // loads selected plugins. set 'selected' to a bitwise combinations of the above plugin flags. must be matched by a call to 'UnregisterPlugins' @@ -36,6 +44,6 @@ namespace PopcornFX { // unloads all previously loaded plugins void PopcornUnregisterPlugins(); -} +} // namespace PopcornFX #endif //O3DE_USE_PK diff --git a/Code/popcornfx_autogen_files.cmake b/Code/popcornfx_autogen_files.cmake index 68eaa61..a9a70f7 100644 --- a/Code/popcornfx_autogen_files.cmake +++ b/Code/popcornfx_autogen_files.cmake @@ -12,9 +12,7 @@ set(PK_OPTIONAL_REGISTER_NODEABLE_FILES if(DEFINED O3DE_VERSION_MAJOR) # O3DE 3.x.x and higher no longer need the registry source files - # Also include special case to handle bug where SDK 23.05.0 engine version was set to the display version - if(O3DE_VERSION_MAJOR GREATER_EQUAL 3 AND - NOT (O3DE_VERSION_MAJOR EQUAL 23 AND O3DE_VERSION_MINOR EQUAL 05 AND O3DE_VERSION_PATCH EQUAL 0)) + if(O3DE_VERSION_MAJOR GREATER_EQUAL 3) unset(PK_OPTIONAL_REGISTER_NODEABLE_FILES) endif() endif() diff --git a/README.md b/README.md index 605d315..bf27886 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # O3DE PopcornFX Plugin Integrates the **PopcornFX Runtime SDK** into **O3DE** as a Gem. -* **Version:** `v2.18.6` +* **Version:** `v2.19.0` * **O3DE:** `23.05`, `23.10` * **Supported platforms:** `Windows`, `MacOS`, `Linux`, `iOS`, `Android` diff --git a/gem.json b/gem.json index bd137e4..ac9b62e 100644 --- a/gem.json +++ b/gem.json @@ -1,12 +1,12 @@ { "gem_name": "PopcornFX", - "display_name": "PopcornFX 2.18.6", + "display_name": "PopcornFX 2.19.0", "license": "Community", "license_url": "https://www.popcornfx.com/popcornfx-community-license", "origin": "Persistant Studios - popcornfx.com", "repo_uri": "https://downloads.popcornfx.com/o3de-repo", - "origin_uri": "https://downloads.popcornfx.com/o3de-repo/PopcornFX-2.18/O3DE_PopcornFXGem_v2.18.6_Win64_Linux64_LinuxARM64_Mac64.zip", - "version": "2.18.6", + "origin_uri": "https://downloads.popcornfx.com/o3de-repo/PopcornFX-2.19/O3DE_PopcornFXGem_v2.19.0_Win64_Linux64_LinuxARM64_Mac64.zip", + "version": "2.19.0", "last_updated": "2024-03-28", "type": "Code", "summary": "The PopcornFX Gem provides real-time FX solution for particle effects.",