Questions about in-engine preformance and issues with particles spawing

0 like 0 dislike


I have 2 main areas I need to ask about;

1) I'm having some issues with particles spawning regardless of the frame rate, I.e. when I am using a Scene Capture 2D Component. The frame rate doesn't seem change when using this component however, the particles seem to not spawn or when they do they behave in unintended ways. Once I take this component out the particle seem to work again but I don't know why.

2) We have tried creating LODs of particles in the game and this has led us to try multiple ways. Now I know that in popcorn there are View functions, however, how do we tell what the camera ID is for each camera when in a scene with multiple cameras in it. We have also tried creating our own system in UE4 to manage the particles emitters but this also contained issues. Trying to find the best way to do loding has proven difficult and help to find the best approach would be useful. 

All in all, I know these questions aren't the most descriptive, therefore, I'd like to have these questions answered in more detail then what can be provided here, over email if possible. 

asked Mar 23 by Jamesking96 (860 points)

1 Answer

2 like 0 dislike
Best answer
Hi James,

1) Do you have a specific effect that could reproduce this issue or does this happen with any effect ? Isn't this related to settings on the SceneCapture2D component directly ? Like capture rate or something ? The pkfx update should happen every frame (and view independent) so this is probably related to a rendering issue

2) Just as a quick answer, this page describes how "view ids" are created in the UE4 plugin. Any feedback is appreciated.

Please feel free to reach us on usual support mails ( or

answered Mar 27 by HugoPKFX (15,500 points)
Hi Hugo,

The issue with the particles not emitting seems to happen on all particles, having them behave in a way that makes them seem as though they are on a delay of sorts. Specifically, the issue appears only when we include a SceneCapture2DComponent into the scene the number of these makes no difference and when we remove all SceneCapture2DComponents from the scene the particles work as intended once more. Another thing to note is that the frame rate is also consistent in both instances of the scene, achieving fps around the high 60s to low 70s at all times.  

As for the view ids to help with loding, the issue we have been facing when using this and its functions have primarily come from us not being able to identify which camera is the correct camera. For example, if our scene contains 10 cameras and only one of them is being used by the player. How do we identify the id of that camera for popcorn to react correctly and what is the best way to do this loding system? From a performance point of view that is? As currently, we do a check for the distance between each emitter and the active camera, if this distance is greater than x value we change the emitter to a lodded down version. The link you provide for the view ids though useful in proving it works sadly does not provide much information in general. For example, answering the questions above. I’m happy to email the link you’ve provided explaining in more detail about this, as the scenario we are currently in will see the number of cameras in any given scene be a large number though not all active at the same time.

If you need any examples of anything I’m talking about today I’m happy to email you and provide what you need on request.

Thanks again for the help.

Hi James,

I will try asap the SceneCapture2D issue and let you know

You can view the way we provide PopcornFX SDK with UE4 views in ParticleScene.cpp in the plugin (CParticleScene::Views_PreUpdate). In the link I provided is described how views are constructed when in Play mode: There will be one camera created per ULocalPlayer.
So you should be able to do view.viewPosition() which will return the first view's position. Here, the single ULocalPlayer UE4 will register if your game is single player.
Now if you switch from one camera to another (as we are using UE4's methods) it should use the active view.
Thanks Hugo,

Looks forward to hearing from you about the SceneCapture2D stuff but my feeling is that is a combination between popcornfx and UE4 its self as when testing with it some more the issue seems to really only affect the GPU.

As for loding using the view.position function, it seems to work currently. Example of code being ran;  

    float tempX = view.position().x - Position.x;
    float tempY = view.position().y - Position.y;
    float tempZ = view.position().z - Position.z;
    float dis = sqrt(float(tempX*tempX + tempY*tempY + tempZ*tempZ));
    Color = iif (dis <= 50, 1,float4(1,0,0,1));

This is the result;

I am assuming this is the correct way to so this please inform me if this is not the case. Now the only aspects of this I'm worried about is that:

1) The game is planned to have multiplayer, however, this will only be done online. not locally i.e. no split-screen gameplay.

2) We are also planning on switching the active camera around for replays at different angles.

Will any of these be an issue with this approach?

Thanks, James.