Solid color rendering issue in GL

BlitzMax Forums/BlitzMax Programming/Solid color rendering issue in GL

sswift(Posted 2008) [#1]



I posted this code here a while back, but I've just noticed an issue when rendering the effect in OpenGL.

In the above code, whatever image you select should fade to a green siloughette, then return to normal. Every pixel should turn the same shade of green. If you can see any details, other than the siloughette formed by the transparent pixels, then it's wrong. It should also be a dark shade of green.

If you comment out the first line, you should see what I've described above. If you leav it as is however, then you may see white pixels remain white instead of fading to green.

I have also found that if I set the color to have any red in it at all, then the result looks even less like the desired result.

Changing that one line to read SolidColorOn(1, 127, 0) for example, results in the image brightening up as if add blending has been enabled.

In short, something is seriously wrong with the OpenGL code to enable this effect, and I could have sworn that it used to work just fine.

I posted these functions here a while back, and my sprite system uses them. So has anyone encountered this issue when using this code and found a fix for it?


plash(Posted 2008) [#2]
I notice huge changes when I add a tiny number to the other color values, I don't see any white pixels when the image is in full-alpha, but instead black pixels never change color.

This method almost seems to just be negating the color spectrum of the texture (which would explain the black pixels, but not the white).