Additive blend mode layers will occationally skip frames?

0 favourites
  • 11 posts
From the Asset Store
Selection frame like in RTS games, works both on mobile and desktop devices.
  • While I know that using lots of WebGL effects on mobile's a bad idea, there is one issue I just can't wrap my head around. I have 2-3 layers with additive blend mode in KlangM, however I often find them to skip frames, which makes the game uncomfortable to look at (The normal layers works just fine). This only happens with the additive blend mode on. Is this a sign that the GPUs struggling, or is this a bug within construct's renderer? This only happens on mobile.

  • I would guess you are close to the capacity of the GPU, and additive layers take marginally more processing power.

  • Ashley Yes one would think so, but I find it a bit strange that the framerate isn't struggling more. If I was overloading it I would see regular spikes down to the sub 30 range right? I also don't have a way to measure the GPU usage in C2? I can't open my project in C3 due to some missing plugins. Is there some checks or some ways to force a draw even at the cost of framerate? It's a shame I can't record or document this issue so easily.

  • Speaking of force a draw, if you have layers with "force own texture" set to yes, that can add to processing.

  • You could try and increase GPU use on purpose by adding a ton of more additive layers and see if that makes the problem worse.

    If it doesn't then you'll know if the GPU is bottlenecking.

  • Ashley Yes one would think so, but I find it a bit strange that the framerate isn't struggling more. If I was overloading it I would see regular spikes down to the sub 30 range right? I also don't have a way to measure the GPU usage in C2? I can't open my project in C3 due to some missing plugins. Is there some checks or some ways to force a draw even at the cost of framerate? It's a shame I can't record or document this issue so easily.

    I've had the same issue occur on intel embedded GPUs when using C2/3. It seems to be an issue with the native Additive shader on lower-end/mobile GPUs. You could try using one of the third-party effects shaders which may not have the same issues. Generally speaking, there are a number of fairly significant performance issues w/ the native Construct shaders that affect blending mode.

  • Additive blend simply comes down to gl.blendFunc(gl.ONE, gl.ONE). The results of this are implemented by the native GPU driver. This call does not involve a shader, and has much less overhead than a shader. Third-party shaders will almost certainly be less efficient. My best guess is some GPUs are optimised for alpha blending, and using additive blend uses a less-optimised path (perhaps because it has to clip the output - you can add pixels which go beyond the pixel value range, whereas you can't with alpha blending, so additive blending probably involves an extra clamp operation).

  • Ashley That makes sense. Does this mean that I might see more consistent results if I ensure the additive color never go above 255 in any color channel?

  • Additive blend simply comes down to gl.blendFunc(gl.ONE, gl.ONE). The results of this are implemented by the native GPU driver. This call does not involve a shader, and has much less overhead than a shader. Third-party shaders will almost certainly be less efficient. My best guess is some GPUs are optimised for alpha blending, and using additive blend uses a less-optimised path (perhaps because it has to clip the output - you can add pixels which go beyond the pixel value range, whereas you can't with alpha blending, so additive blending probably involves an extra clamp operation).

    I've reached out to a contact on Intel's embedded gpu team to get more info on this. What you've posted above definitely shouldn't cause what I'm seeing on every Intel chip I've tested on (and it only happens in C2/3), but I've also seen the same performance and graphical issues on a Shield TV/Tegra, so it's probably not GPU-specific. Based on the way C2's renderer works, should this work the same whether or not the blend is applied to a layer vs. a sprite, assuming both are set to have no opacity and backgrounds are solid 0,0,0 black?

  • For Ashley and anyone else who's interested, here's a document from Intel on how they handle additive & alpha blending and potential rendering pipeline quirks than can cause visual corruption and potential performance issues:

    https://www.dropbox.com/s/rkjolm5bpc3s1 ... .docx?dl=0

    Still waiting to hear back from nVidia & Qualcomm to see if they have any quirks that could affect performance or rendering on mobile GPU devices.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • That doesn't look relevant. It says: "The purpose of this paper is to highlight a very specific 3D scenario that can cause corruption of pixel alpha values on Cherry Trail and Braswell platforms." Doesn't sound like anything to do with additive blending performance.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)