ID:2715720
 
Descriptive Problem Summary:

It's not exactly specific. In fact, this post is half a bug report, half a cry for help.

Detailed description of the problem:

Our project uses a lighting system consisting of a few, relatively big atoms made of several overlays. We then apply a blur filter to them.

To give an order of magnitude, the atoms are usually 320x320, made of typically 20 to 30 overlays assembled together using KEEP_TOGETHER. A typical scene has 5 of them.

We then apply a blur filter of size 2 to them.

I tried several optimisation to make it as light-weight as possible, using render_source, render_target, not blurring the whole 320x320 sprites, but rather individual sections of it, etc.

To no avail. The filters perform especially badly for most users, including ones with good GPUs. Disabling filters solves performance for most people, however, some users still have issues with simply rendering the large icons.

If they move to an area without the atoms, they perform a lot better.

Why I think it's a problem:

I don't believe rendering a bunch of 320x320 icons and applying a filter to them should be that heavy on people's GPUs, especially GPUs that can otherwise

Performance is much better locally than on a distributed server for some reason.

It's also really strange how it seems connected to the players' cache. Clearing their cache improves their performance in most cases ; sometimes, rejoining after they downloaded it for the first time is enough.

Finally, but it's anecdotal evidence, someone mentioned re-installing BYOND improving their performance.

I believe there is something worst investigating here. If asked, I can give a minimal working example of just my lighting engine to see if there's a weird behaviour (or if it's simply user error).

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

Users report the best performance in 1566.



It's allegedly much worse on AMD GPUs, for the record.
Blur has been acknowledged to cause lag if you apply it on individual atoms. They should be applied to planes iirc.
Moved to Developer Help. As you said, this is not really a bug report. I have nothing to investigate, not even sample code.

One thing you never mentioned is the blur size. That's hugely relevant to all of this.

Each blur is a two-pass filter: one horizontal blur and one vertical. The maximum size you can get out of two passes is 6. At higher blurs more passes are needed, and past a certain point the rendering engine will take shortcuts to reduce the number of passes at the expense of quality.

What you're probably seeing in your project is a combination of too many filter passes coupled with the way the temporary surfaces are reused. The latter will probably be fixed whenever I'm able to overhaul the renderer. The former can only be solved by fewer passes. As NSBR mentioned, doing as many of your blurs on an entire plane as possible is better.

Either way I need something to look at.
In response to Lummox JR
He did mention the blur size. It's 2.
In response to Exxion
Ah, you're right. I missed that part.

But I thought this was actually settled in id:2714024. He said the issue turned out to be that too many filters were stacking up and it was actually a code problem.

Login to reply.