Effects (brightness and stuff) and performance ?

Get help using Construct 2

Post » Tue Feb 17, 2015 11:47 pm

Hi.

I have about 100 moving sprites on my project. I had some performance problems that bothered me and I figured out it was the brightess effect I added on them that was slowing down my game.

While trying to fix that I learned that a brightness effect with the default value of 100, which make no visual change, uses a lot of CPU too, which is kind of surprising but whatever.

So I was wondering how I can know how much CPU intensive are the different effects ? And is it possible to achieve an effect similar to brightness, but with better performances ?
B
12
S
7
G
7
Posts: 448
Reputation: 4,272

Post » Wed Feb 18, 2015 1:04 am

Two things:

1. Effects tax the GPU, not the CPU, and most effects will give you the same performance regardless of parameter values.

2. The only way to know how an effect will perform is to test it -- there really aren't any shortcuts.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,096

Post » Wed Feb 18, 2015 1:06 am

A shame that a modern GPU won't be able to brighten 100 two dimensional sprites while it runs smoothly games with 3D graphics. :o
B
12
S
7
G
7
Posts: 448
Reputation: 4,272

Post » Wed Feb 18, 2015 1:59 am

I actually had this problem as well at some point, which also killed one of my games. However you can add the effect to the layer instead of the objects. That will improve performance by a lot.
B
44
S
11
G
2
Posts: 1,181
Reputation: 6,816

Post » Wed Feb 18, 2015 2:04 am

Coin-coin le Canapin wrote:A shame that a modern GPU won't be able to brighten 100 two dimensional sprites while it runs smoothly games with 3D graphics. :o

It really depends on the GPU. My desktop can handle a couple thousand sprites with the brightness effect before performance begins to drop. Mobile GPUs, on the other hand, are notoriously under powered in comparison.
Moderator
B
113
S
41
G
20
Posts: 1,586
Reputation: 19,096

Post » Wed Feb 18, 2015 9:36 am

@Nimos : thank you for this workaround, I'll try this :)
@linkman2004 : I have a geforce GTX 560M. It can run Skyrim, but not too much brightness in Construct 2. Meh.
Last edited by Coin-coin le Canapin on Wed Feb 18, 2015 2:05 pm, edited 1 time in total.
B
12
S
7
G
7
Posts: 448
Reputation: 4,272

Post » Wed Feb 18, 2015 10:32 am

It may depend a good deal on the sequencing - i.e. stacking order of the sprites with effects. Also how often the effect itself changes. In my testing I could have, for example. 5000 sprites with a Shader on them at ~30fps, but it gets cut in half if the parameters change every tick.

You basically need to experiment.

As was said you could try and use layers - for example have a layer that always has a max brightness effect and move the sprites to the layer on hit, then move them back.

Basically what Ashley always says applies - test it to see if it's fast or slow, when it gets quick you have the right approach.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646


Return to How do I....?

Who is online

Users browsing this forum: AkbarAsgharMG, ColombageEnPLS, Pulstar and 12 guests