Programming with OpenGL #3

Posted by Mordi on April 21, 2012, 7:27 p.m.

The last two days I've spent trying to get font rendering to work. I chose FreeType.

It is almost satisfactory. There's an issue with the transparent pixels. They are always black.

I've also done some cleaning up in the code in general.

Comments

svf 12 years, 7 months ago

Ooh! Looks fun! Good luck to Programming OpenGL. It for certain is a challenge!

blackhole 12 years, 7 months ago

Be sure to turn on alpha blending. there are also some other things that can cause transparent pixels to ignore the alpha channel. Be sure you aren't rendering directly on to the backbuffer, because it doesn't understand alpha and this can cause blend issues. You might want to render a black rect on the background first to try and fix that.

colseed 12 years, 7 months ago

somehow I get the feeling we're going to be seeing lots of screenshots with hamsters duplicated across the screen repeatedly

Font 12 years, 7 months ago

Best of luck! Hope you have a more positive experience than I did with opengl and c++. Graphics is fun though.

Mordi 12 years, 7 months ago

I managed to fix it. I was using GL_RGBA as the format when creating the texture. I tried using GL_ALPHA instead, and now it looks much better. I guess it makes sense for it to work, as the texture itself only needs to be white, while the color comes in as I draw the quad.

Screenshot: http://i.snag.gy/wD5mE.jpg

Glen 12 years, 6 months ago

That hamster looks so trippy

JuurianChi 12 years, 6 months ago

Hampster centipede.