PopcornFX / O3DEPopcornFXPlugin

PopcornFX plugin for O3DE
https://www.popcornfx.com/
Other
13 stars 12 forks source link

Problems with the O3DE Plugin v2.16.3/2.16.4 functionality in an O3DE v23.05 clone project. #57

Closed Aleks-Starykh closed 1 year ago

Aleks-Starykh commented 1 year ago

Hi, this is my 1st post on an issue here, so please excuse me for any inconviniences.

Originally started in O3DE Discord, then switched to PopcornFX Discord.

I have problems to get PopcornFX O3DE Plugin v.2.16,3 2.16.4 functionality in a cloned O3DE v23.05 project.

Problems started with a compilation error (with MS VS 2022 Comm, in the <an_o3de_project>/Gems/PopcornFX/Code/Source/PreviewerPopcornFXEffectPreviewerFactory.cpp:L:34 : AZStd::to_lower() undefined. With a trivial fix (adding #include <AzCore/std/string/conversions.h>), problems continued with invalid GEM registation (not compiled into the AssetBuilder, etc.).

~~After cherry-picking and applying hot-fixes to CMakeLists.txt of the O3DE 23.05 clone (https://github.com/o3de/o3de/pull/15933) and the https://github.com/PopcornFX/O3DEPopcornFXPlugin/releases/tag/v2.16.3 clone (https://github.com/PopcornFX/O3DEPopcornFXPlugin/pull/49), GEM registration in project succeeded, but problems continued with crashes on using null pointers because PopcprnFX passes' descriptions were not found in cache in code-expected paths.~~

This verison sucessfully registered / baked into AssetBuilder / AssetProcessor and Editor with the following steps:

~~Cannot be sure that my problems did not arise because I've added / upacked the Plugin sources into <an_o3de_project>/Gems/PopcornFX folder instead of proposed <a_current_User_data>\O3DE\Gems\PopcornFX, and then added in the <an_o3de_project>/project.json as shown above. but this does not seem likely, yes?~~

With the help of @geds-dm [Amazon] added "ProjectRelativeGemsScanFolderPriority": "higher", statement at the beginning of Settings: {} list in the <project>/Registry/assetprocessor_settings.setreg file to solve problems with PKFX critical assets lookup in /cache due to the GEM source placed inside the project.

I've put the Plugin sources into a project, so that PopcornFX code can be changed and stored in a repo, firstly because had to fix a compilation error (see above).

So, the problems I've encounter after successfully registering and compiling the Plugin into an O3DE project, in brief, are:

~~* baked resources (passes, shaders, streaming images, etc.) are put by AssetProcessor / AssetBuilder in <an_o3de_project>/Cache/pc/gems/popcornfx/assets/passes, <an_o3de_project>/Cache/pc/gems/popcornfx/assets/shaders, etc.

After changing code (adding attempts to load missing resources from <an_o3de_project>/Cache/pc/gems/popcornfx/assets/...),~~

I've managed to get some particles rendering, but I'm still stuck on the null value for the SDrawCall::AZ::Data::Instance<AZ::RPI::ShaderResourceGroup> m_ObjectSrg;

The missing SRG problem is reported as:

> System: Trace::Assert
> <an_o3de_fork>\Gems\Atom\RHI\DX12\Code\Source\RHI/CommandList.h(440): (21316) 'bool cdecl AZ::DX12::CommandList::CommitShaderResources<AZ::RHI::PipelineStateType::Draw,struct AZ::RHI::DrawItem>(const struct AZ::RHI::DrawItem &)'
> (System) - Trace::Assert
> <an_o3de_fork>\Gems\Atom\RHI\DX12\Code\Source\RHI/CommandList.h(440): (21316) 'bool cdecl AZ::DX12::CommandList::CommitShaderResources<AZ::RHI::PipelineStateType::Draw,struct AZ::RHI::DrawItem>(const struct AZ::RHI::DrawItem &)'
> 
> System: The DrawItem being submitted doesn't provide an SRG for slot '1', which the shader is expecting. If this slot is for a Pass, View or Scene SRG, this likely means the pass didn't collect it (for the view SRG, check if your pass provides a PipelineViewTag). The SRGs currently provided by the DrawItem are: Slot #0 = 'BillboardDistortion_RendererSrg', Slot #2 = 'BillboardDistortion_MaterialSrg', Slot #4 = 'ForwardPassSrg_PassSrg', Slot #5 = 'SceneAndViewSrgs_ViewSrg', Slot #6 = 'SceneAndViewSrgs_SceneSrg'
> 

So actually billboards are missing in render in Editor. I do see lighting, distortion and some sparkles, but no flame / smoke (using Explosions free library (c) Persistant Studios).

I suspect that I'm missing something very simple, which would make PopcornFX functional, but I'm unaware of.

Thanks. Aleks

Aleks-Starykh commented 1 year ago

Suggestion from @HugoPKFX

... can you try uncommenting set(PK_O3DE_ENGINE_VERSION "2305.0") from the CMakeLists.txt file ? https://github.com/PopcornFX/O3DEPopcornFXPlugin/blob/main/CMakeLists.txt This might be because the O3DE engine version is incorrectly detected

recompiling...

No luck, still rendering only light, distortion and some sparles, no sprites (smoke / flames). Screenshot for `Explosions/explosion_fueltank`

As this time I decided to run Debug AssetProcessor (and then Editor), I've got new Asserts from the AssetBuilder on files from the standard free Explosions package,

Details in the next comment.

Aleks-Starykh commented 1 year ago

Several Assertswere reported by AssetProcessor in <an_o3de-project>\user\log\JobLogs\dlc\PopcornFX logs:

Noted that one log also contained errors like Failed loading image resource "<an_o3de-project>/dlc/PopcornFX/Content/Explosions/Textures/Explosion/C4Explosion02_Emissive.tga" although source textures are valid and cache got updated with Cache\pc\dlc\popcornfx\content\explosions\textures\explosion\c4explosion02_emissive.tga.1002.imagemipchain . . . Cache\pc\dlc\popcornfx\content\explosions\textures\explosion\c4explosion02_emissive.tga.1006.imagemipchain

A couple of Aserts I've failed to find in logs, so here are screenshots:

Shot1

Shot2

OBWANDO commented 1 year ago

@HugoPKFX @tdesveauxPKFX This might be something you may be able to help with.

HugoPKFX commented 1 year ago

Hi @Aleks-Starykh ,

The asserts seem to be caused by rendering features not supported by the O3DE plugin. The O3DE plugin does not implement all rendering capabilities supported by other plugins or PK-Editor (some of these limitations are listed in the github's issue page: https://github.com/PopcornFX/O3DEPopcornFXPlugin/issues) but it is not an exhaustive list.

I'll take a look and let you know

Aleks-Starykh commented 1 year ago

Updated the issue description:

With the help of @geds-dm [Amazon] added "ProjectRelativeGemsScanFolderPriority": "higher", statemnentat the beginning of Setttings: {} list in the <project>/Registry/assetprocessor_settings.setreg file to solve problems with PKFX critical assets lookup in /cache due to the GEM source placed inside the project.

and Stroked-through obsolete statements.

Aleks-Starykh commented 1 year ago

Update: https://discord.com/channels/802107847278067732/1113419252658098197/1116032406097494067

Aleks-Starykh commented 1 year ago

Most issues have been reolved. Yet I still do not see the Expolsions pack rendered as designed