0
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ I tried to open your .blend, nothing was there. Can you re-upload it on something else? $\endgroup$ – Luka ash Aug 27 '15 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 Schindler Aug 28 '15 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 ash Aug 28 '15 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 Schindler Aug 30 '15 at 4:44
  • $\begingroup$ Odd, i've seen people vote their own before. Another one of them permission things again i guess. $\endgroup$ – Luka ash Aug 31 '15 at 11:41
0
$\begingroup$

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.

Blender Shader settings

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.