Bloom-shader looks weird after recompiling for latest MonoGame version


I recently upgraded to MonoGame 3.5 and hadn’t upgraded since 3.2 I believe.
When recompiling, the shaders make everything look extremely transparent and just weird.
It was not like this before, and I use the same settings.
Please compare these two screenshots, the first one from my game released back in June last year, and the screenshot after it when upgrading to 3.5 and recompiling bloom-shaders:
Screenshot 1
Screenshot 2

Many thanks in advance,

This is the shader code:

Please tell me if there’s anything more you need to look at, anything really.

fix link to first screenshot.

I’m sorry, I’ve edited it now.

Anyway, I expect this is your issue: How to achieve a bloom effect on 2D textures?

I would like to note this is 5th time I am linking to it to resolve same issue on exactly same shader.

And there will be a 6th, 7th, … because people don’t search for old fixes. Even if some people spend valuable time on documentation :(.
Anyway, thanks to you Ravendarke, I will also need the fix soon.

By the way there is other solution by using Macros for texture sampling added by monogame.

Maybe putting a sort of tag in the topic title to tell which version of monogame would help newcommers ? like [3.5], [ - dev branch]
Some solutions found on the forum may be not as up to date as expected between framework’s version.

Thank you, it works perfectly.
I’m terribly sorry that I didn’t find another thread about this.

Since you are working on app for low performance device don´t forget to cache your parameters later.

As such:
bloomBase = bloomCombineEffect.Parameters["BaseTexture"]; //somewhere in iniciliaziation of postprocess

Just a side question - why is this better?

It should be the same whether i do … fx.Parameters[“fooParam”].SetValue(vec3) or fooParam = vec3, no? I mean isn’t fooParam just a reference anyways? Can someone explain?

This way the method does not need to re traverse the array in order to find the parameter when you set it each frame. It know where it is as it is cached at initialization. And re traversing is also worse as keys are strings, not ints, the latter being faster :wink:

Just FYI I tried it out like this

if (GameSettings.test == 1)
                for (var i = 0; i < 10000; i++)
if (GameSettings.test == 2)
                for (var i = 0; i < 10000; i++)

and I get a 30 fps boost from the second one. Nice. Thanks :slight_smile: