Sign in to follow this  
UnIXbLueStar

Bitmap and callList

Recommended Posts

Hi 3d masters. Im trying to store bitmap characters into a callList so i can show text on screen. One problem : those bitmap are called very often so it HAS to be in a calllist. Since the callList is unmodifiable, is there any way as good as the callList that will let me change the color of the characters. I mean they arent going to be always white. Should i store the bitmap in the calllist for every color ill use ? Prolly like 5-10 colors that ill use. Second problem : If i draw something from a callList or something in the glu library, i have to translate it to position it. But the light still show on the object like if it was still at 0,0,0 after the translation. (and no i dont translate the light by mistake with it.)

Share this post


Link to post
Share on other sites
The standard method is to have our entire text in a texture and render a quad or have the characters in a texture and render each char as a quad.
It should be fast enough.
Dont use unusual things like glBitmap. GPUs dont support bits.

To position a light, sice it is effected by the modelview

glloadidentity
glLight(GL_POSITION, xyzw)

glloadmatrix
DrawObject

Share this post


Link to post
Share on other sites
Quote:
Original post by V-man
The standard method is to have our entire text in a texture and render a quad or have the characters in a texture and render each char as a quad.
It should be fast enough.
Dont use unusual things like glBitmap. GPUs dont support bits.

To position a light, sice it is effected by the modelview

glloadidentity
glLight(GL_POSITION, xyzw)

glloadmatrix
DrawObject


isnt BindTexture expencive for the CPU ?
wouldnt i also have to use blend so it doesnt show the rest of the quad ?

i saw glPolygonStipple which work same way as glBitmap but for polygons. Would it do the job ?

And i dont see what u mean by GPUs dont support bits. Is there really some implentation of opengl that doesnt support simples and basics bitmap ??
How can they support textures if they doesnt even support basic stuff like that?

Share this post


Link to post
Share on other sites
Yes glBindTexture can be expensive. All your characters should be in the same texture for that reason.

glPolygonStipple is one of those features that aren't supported by common GPUs.
There are quite a few functions that should not be used in GL.

Quote:
And i dont see what u mean by GPUs dont support bits. Is there really some implentation of opengl that doesnt support simples and basics bitmap ??
How can they support textures if they doesnt even support basic stuff like that?


Most common GPUs don't support glBitmap. It converts, makes a texture, then renders a quad with the texture.
That's why in the next version of GL (GL 3.0), they have declared such features as deprecated.

Share this post


Link to post
Share on other sites
Quote:
Original post by V-man
Yes glBindTexture can be expensive. All your characters should be in the same texture for that reason.

glPolygonStipple is one of those features that aren't supported by common GPUs.
There are quite a few functions that should not be used in GL.

Quote:
And i dont see what u mean by GPUs dont support bits. Is there really some implentation of opengl that doesnt support simples and basics bitmap ??
How can they support textures if they doesnt even support basic stuff like that?


Most common GPUs don't support glBitmap. It converts, makes a texture, then renders a quad with the texture.
That's why in the next version of GL (GL 3.0), they have declared such features as deprecated.


thanks. that answered my question ^^

EDIT: no wait, for the characters color will i have to store each char for each color in a call list or theres better ? btw i cant use any c++ lib for that since im in java

Share this post


Link to post
Share on other sites
Make your text white and to color them you can call glColor before you render.
The env mode must be glTexEnvi(...., GL_MODULATE) so that it multiplies the color with the texel colors.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this