Bloomshader and mouse cursor issue

Greetings blenderheads. :slight_smile:

I’d like to know if anyone can help me with regards to the bloom shader as well as the mouse cursor.

I’ve been using a bloom shader as well as a custom cursor script for the game. At the main menu I added the cursor as an overlay scene, now when I enter the actual game, the cursor still stays visible. Anyone maybe now how I can force him to hide it until I go back to the main menu?

Bloom Shader

Now In-game I have a bloom shader active, now the problem is, the moment the shader is active, it looks as if this shader is stacking on himself, because when I switch back to my main menu, the bloom is applied to the scene I switched to and it becomes so bad that I can’t see the menu properly.

Here is a screenshot of what happens with the bloom shader, as well as the custom mouse cursor.

Is there a way to fix this problem?

Blender 2.49b is the build I’m currently using…
Xelus

Attachments


Yeah, I’m not sure, but from your ‘stacking’ explanation, it would appear that you are somehow triggering the bloom filter more than once - is it triggered on the Main Menu screen? I would recommend making a GUI scene, triggering the bloom script from there, and adding the GUI scene if it doesn’t already exist (if you don’t check, Blender will throw a warning, but it won’t crash or anything).

yo i kno how to fix this bro

when you go back into the menu create a logic setup that removes the 2d filter when it goes into the new scene.
I had this problem once before.

hope this works.

@ Solarlune

Well the bloom shader is only active in-game, not on the mainmenu system, I don’t have an idea why he is doing this, but I’m looking for alternatives to solving it, I’m looking at ways for enabling it and disabling it in the settings menu if that is even possible to do.

I’ll try both you guys’s methods and give feedback on it, thank you for the help. :slight_smile:

I agree with sollar lune, for 2d filters the best is to let a control panel running the scripts on each scene that you enter, with the 2.5x your ll not have this problem.
Xelus if nothing work try out this one:

                                        ............................................Bloom

uniform sampler2D bgl_RenderedTexture;
const float BRIGHT_PASS_THRESHOLD = 0.65;
const float BRIGHT_PASS_OFFSET = 0.4;
#define blurclamp 0.005
#define bias 0.8
#define KERNEL_SIZE 2.0
vec2 texcoord = vec2(gl_TexCoord[0]).st;
vec4 bright(vec2 coo)
{
vec4 color = texture2D(bgl_RenderedTexture, coo);

color = max(color - BRIGHT_PASS_THRESHOLD, 0.05);

return color / (color + BRIGHT_PASS_OFFSET);
}

or this

Retinex

uniform sampler2D bgl_RenderedTexture;
uniform float retinex = -0.600;
vec4 sample( in vec2 coord )
{
return texture2D(bgl_RenderedTexture, coord )0.5texture2D(bgl_RenderedTexture, coord )*0.5;
}

void main(void)
{
vec4 bloom = vec4(0);

int j;
int i;
for( i= -5 ;i < 5; i++)
{
for (j = -5; j < 5; j++)
{
bloom += sample (gl_TexCoord[0].st + vec2(j, i)*0.002) * 0.06;
}
}

vec4 value = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st);
vec4 pow_value = pow(value,(bloom*retinex));

gl_FragColor = pow_value*value;
}

all this filters where created by martinsh. in order to achive better resultos for your scene change the offset and thereshold values.

Ah hah, thank you guys, well I got it working perfectly thanks to all you blenderhead’s help. I greatly appreciate your help.

Now does anyone know how I can get the custom cursor to be hidden when I enter the game?

And if it is possible to get the bloom shader to be settable? In the settings menu being able to disable or enable the bloom?

@BigmanJoe

Your solution to the bloom problem helped, I wasn’t aware that the shaders can be removed in a scene which doesn’t have the filter connected to it. So thank you, I could disable it in the main menu. :smiley:

@ Leonn

I’ve noticed the bloom shader you have just provided works a bit differently to the on that I have currently, it looks quite a bit better as well as my framerates are a bit higher. I’ll be experimenting with the one you provided, thank you Leonn. :slight_smile: