TEXTURE BORDER
I need make a texture with a white border.
I tried:
glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE,
0, 0, x+2, y+2, 1);
but it was too slow during rendering, 514x514 texture.
The texture i create must contain a white border and the texture is created ''ON THE FLY''.
You can''t create a 514x514 texture, it''s not a power of two. Use a 510x510 texture, and add a border making it 512x512.
Alternatively, you can use hardware texture borders, but only if your hardware supports it (GF3+).
/ Yann
Alternatively, you can use hardware texture borders, but only if your hardware supports it (GF3+).
/ Yann
it says 2 power + 2 * border size. and it runs but very slowly.
Maybe, another way.
I render a view , copy it to a texture, then use it later.
somewhere and somehow , i need to add a white border TO THE TEXTURE.
Maybe, another way.
I render a view , copy it to a texture, then use it later.
somewhere and somehow , i need to add a white border TO THE TEXTURE.
quote:
it says 2 power + 2 * border size. and it runs but very slowly.
That's for hardware texture borders. Your hardware needs to support texture borders in order to get acceleration on a 514x514 texture. That's from GF3+ on upwards (and all ATi Radeon, iirc). What 3D card do you have ?
But the whole OpenGL texture border concept is awkward. Just create a standard 512² texture without border. Fill it with 510x510 valid texels of image data. And draw a white border around it (copy white pixels into the texture image).
/ Yann
[edited by - Yann L on July 23, 2002 5:21:15 PM]
My solution. i tried glOrtho then glineloop the border. finally, copy the texture for later use.
It works but I found that without glCopyTexImage2D. It runs alot faster. 100fps on a GeForce256. (and with) it runs 26fps.
Hmmm. just like boiling peanuts.
It works but I found that without glCopyTexImage2D. It runs alot faster. 100fps on a GeForce256. (and with) it runs 26fps.
Hmmm. just like boiling peanuts.
(Aside: You CAN create a 514x514 texture if it has a border...)
If you''re only using a solid color (like white) though, you could try TexParameterfv(TEXTURE_BORDER_COLOR, ...). I''m not sure if this will be any faster, but I''m guessing you''ll have better luck with it than you will with a texture with a border. Try it out and let us know what happens.
-- sec
If you''re only using a solid color (like white) though, you could try TexParameterfv(TEXTURE_BORDER_COLOR, ...). I''m not sure if this will be any faster, but I''m guessing you''ll have better luck with it than you will with a texture with a border. Try it out and let us know what happens.
-- sec
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement