Hi,
I am trying to write a blur effect in a pixel shader but they resulting image is too dark and very green. Can someone help me understand what is going on?
Btw, I took the code from a basic forum. I don't understand it well. Here is the link to the article:
http://www.blitzbasic.com/codearcs/code ... p?code=837
The bluring occurs, it just the darkness and greenish that bugs me.
I'd like to make a NEGATIVE and GRAYSCALE filter after that, if someone can help me on that, it would be really appreciated as well.
I am trying to write a blur effect in a pixel shader but they resulting image is too dark and very green. Can someone help me understand what is going on?
Btw, I took the code from a basic forum. I don't understand it well. Here is the link to the article:
http://www.blitzbasic.com/codearcs/code ... p?code=837
- Code:
int r = (s & Frog::RED_MASK) >> Frog::RED_SHIFT;
int g = (s & Frog::GREEN_MASK) >> Frog::GREEN_SHIFT;
int b = (s & Frog::BLUE_MASK) >> Frog::BLUE_SHIFT;
desr = r * (1-blurlevel) + desr * (blurlevel);
desg = g * (1-blurlevel) + desg * (blurlevel);
desb = b * (1-blurlevel) + desb * (blurlevel);
d = Frog::Color(desr, desg, desb);
The bluring occurs, it just the darkness and greenish that bugs me.
I'd like to make a NEGATIVE and GRAYSCALE filter after that, if someone can help me on that, it would be really appreciated as well.