I am trying to get fonts rendered with different colors, but bgl.glColor4f (or any other variant of glColor) doesn't apply the color that I set with it. Please see https://github.com/eugenschindler/blender-examples/tree/master/HUDText for a reproduction of the problem (Blend file, Python script, and font). According to other resources I found online, this example code should work, but I can't get it to work. I've used Blender 2.73 and 2.75 and in both it doesn't work. Does anybody have an idea what's going wrong?
$\begingroup$
$\endgroup$
7
-
$\begingroup$ I tried to open your .blend, nothing was there. Can you re-upload it on something else? $\endgroup$– Luka ashAug 27, 2015 at 20:21
-
$\begingroup$ You have to switch to blender game engine and then press p to play it, then you'll see the text. $\endgroup$– Eugen SchindlerAug 28, 2015 at 20:29
-
$\begingroup$ Oh, well now that you fixed it all i can say is you should vote your answer as the working answer. $\endgroup$– Luka ashAug 28, 2015 at 20:43
-
$\begingroup$ It says that you can't vote for your own post. I guess I have to wait some time. $\endgroup$– Eugen SchindlerAug 30, 2015 at 4:44
-
$\begingroup$ Odd, i've seen people vote their own before. Another one of them permission things again i guess. $\endgroup$– Luka ashAug 31, 2015 at 11:41
|
Show 2 more comments
1 Answer
$\begingroup$
$\endgroup$
The problem was lying in the Shading settings of Blender. By default, the shading is set to Multitexture, which makes the blf text be only black. If you set the shader to GLSL (see picture below), the colors behave exactly as you would expect them according to the python script that is in my example.