[Solved] Colorizing a texture

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
dsn
Posts: 47
Joined: Wed Nov 09, 2005 11:48 am
Location: Indianapolis, Indiana, USA

[Solved] Colorizing a texture

Post by dsn »

I'm playing around with bitmap fonts. So far I'm using the traditional method: one big image with all of the characters, drawing one quad for each letter. This works fine.

The problem I have is that I want to be able to set the font color on the fly, but without using a different image. I've tried using sceGuPixelMask with white character images, and I've tried using sceGuTexEnvColor with GU_TFX_BLEND. Both of these methods produce the same result: the color of the characters is indeed changed, but it's blended with the color behind the characters, which I don't want. I've also tried changing the ambient color but it has no effect, and I've dabbled with lighting but I don't understand it well enough to make it work. I suspect that using ambient lighting will be the best way to do this, but if so, I'll need some guidance on how to make it work. Any ideas/suggestions?

[Edit]
Figured it out. Black character images, GU_TFX_ADD with vertex colors does the trick. I will now accept my thirty lashings for not looking at samples/gu/cube before posting. :-)
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

You could also use paletted texture and just change the palette. Would be even faster at rendering.
<Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki

Alexander Berl
Post Reply