aframe icon indicating copy to clipboard operation
aframe copied to clipboard

Sudden increase in GPU load when using postprocessing

Open IntraNoctem opened this issue 1 year ago • 3 comments
trafficstars

Description:

When using postprocessing, high GPU load and thus FPS drops occur at intervals. Sometimes it occurs shortly after initializing the scene, sometimes it takes 1-2 minutes. This is apparently dependent on the effects used. (4 effects in the examples)

GPU

This behaviour does not occur in a performance test example with 16 effects.

Has anyone experienced the same and has an idea how to solve this?

Example causing FPS drops: https://jsfiddle.net/bz5cdhat/3/ Example without FPS drops: https://jsfiddle.net/9rv6nmLg/ Performance test: https://pmndrs.github.io/postprocessing/public/demo/#performance

A-Frame Version: 1.5.0 Postprocessing library: https://github.com/pmndrs/postprocessing

IntraNoctem avatar Mar 08 '24 09:03 IntraNoctem

What's that graph you shared? How did you determine is the GPU? Postprocessing can be expensive. Depending on the effects you're using as you mentioned. Needs understanding on how the shader on each pass works.

This probably a general question you should ask on StackOverflow or Discord. Not sure if there's anything actionable on A-Frame core.

dmarcos avatar Mar 09 '24 03:03 dmarcos

The Graph is the GPU usage graph of the windows task manager. It's showing these waves when opening the given example.

Yes, you're right, the question is quite general. I was just wondering if I made a mistake or maybe there is a connection with A-Frame, since the behaviour does not occur in the pure THREEJS performance test example.

IntraNoctem avatar Mar 11 '24 14:03 IntraNoctem

Would add complexity little by little and measure: First without post-processing and then add effects and see if there's any of them in particular that increases gpu load. Weird you see spikes. Loaded the examples and all run 60fps on my M1 Macbook Air + Chrome. If you don't see any perf issues without post that narrows down the root cause

dmarcos avatar Mar 12 '24 01:03 dmarcos