🔒 Locked
Bitmaping problems
Advertisement
Original Post
I''m finally getting better at this whole Open GL thing, I have a few problems but this is the most crucial for what I''m toying with right now ,
Why can''t I use any bitmaps bigger than what is used as the crate in lesson 7. the bmp file is the same compression infact its exactly 3x the original size of the crate , is there a different way then that used in lesson 7? Thanks
If this helps the I put the image up on this server
http://www.geocities.com/timessquare/9435/programming/mountain.bmp
download it if you think you could help me Thanks
its a 24 bit RGB file (for those who know that stuff)
Thanks a bunch
Alex Finlayson
http://www.geocities.com/timessquare/9435/programming/mountain.bmp
download it if you think you could help me Thanks
its a 24 bit RGB file (for those who know that stuff)
Thanks a bunch
Alex Finlayson
> Why can't I use any bitmaps bigger than what is used as the
> crate in lesson 7. the bmp file is the same compression infact > its exactly 3x the original size of the crate ,
You CAN use any bitmap, but its' sizes must be a power of 2. Your picture (mountain.bmp) is 640/640, so you'll see only empty polygon
. Try to resize it to 512/512 or any other 2^n/2^m combination. I hope it'll help.
> is there a different way then that used in lesson 7? Thanks
Different way of what exactly do you mean? (Lesson 7 is very big
)
Alex
Edited by - Alex Bijamov on January 14, 2002 7:13:13 AM
> crate in lesson 7. the bmp file is the same compression infact > its exactly 3x the original size of the crate ,
You CAN use any bitmap, but its' sizes must be a power of 2. Your picture (mountain.bmp) is 640/640, so you'll see only empty polygon
> is there a different way then that used in lesson 7? Thanks
Different way of what exactly do you mean? (Lesson 7 is very big
Alex
Edited by - Alex Bijamov on January 14, 2002 7:13:13 AM
quote:
is there a different way then that used in lesson 7?
Alex B: I think he wonder if there exists another way of using bitmaps, like there exists different ways of coloring objects (using glColor without lights, or using lights with color materials, or texturing, ...).
Alex F: Unless you look for drawing bitmaps in front of the screen, somewhat 2D rendering, there's no way you can define textures. You gotta resize the picture. Though, I recommend to resize the image file instead of resizing the picture on-the-fly, unless the image may exceed the gfx capabilities.
Edited by - vincoof on January 14, 2002 7:14:11 AM
well no one has posted this yet.
instead of resizing the image, you can (a waste of space though in this case) place the 640x640 image onto a 1024x1024 image.
when you render the image, you use to use the co-ordinates
1,0 1,1
0,0 0,1
instead of this you would use
ratio=640x1024 (=0.625)
0.625,0.000 0.625,0.625
0.000,0.000 0.000,0.625
this will texture it to that part of the image only.
Hope this helps you out.
Beer - the love catalyst
good ol'' homepage
instead of resizing the image, you can (a waste of space though in this case) place the 640x640 image onto a 1024x1024 image.
when you render the image, you use to use the co-ordinates
1,0 1,1
0,0 0,1
instead of this you would use
ratio=640x1024 (=0.625)
0.625,0.000 0.625,0.625
0.000,0.000 0.000,0.625
this will texture it to that part of the image only.
Hope this helps you out.
Beer - the love catalyst
good ol'' homepage
Yeah this solution works too. It has the great advantage of not stretching the image.
Good point.
Also, I''d like to add that it only works for non-tiled textures.
If the texture repeats, then we''ll see the texture "empty" part.
Also (2), it can be easier to set texture coordinates using the texture transformation with texture matrix.
After that, you can just set, as usual, your texture coordinates from (0,0) to (1,1) with functions like glTexCoord, and the texture transformation will automatically compute ''real'' texture coordinates from (0,0) to (0.625,0.625).
Good point.
Also, I''d like to add that it only works for non-tiled textures.
If the texture repeats, then we''ll see the texture "empty" part.
Also (2), it can be easier to set texture coordinates using the texture transformation with texture matrix.
|
After that, you can just set, as usual, your texture coordinates from (0,0) to (1,1) with functions like glTexCoord, and the texture transformation will automatically compute ''real'' texture coordinates from (0,0) to (0.625,0.625).
Sorry mate, but you''re wrong.
YOU CAN NOT SET A NON POWER-OF-TWO SIZED TEXTURE IN OPENGL, BY ANY MEAN.
you hear me ?
OpenGL specifications clearly says that.
IMO, if your 64x43 texture works, this is because you''re using mipmaps which, using the glu, automatically resizes the image to its better size.
Also, the texture size is not limited to 2048x2048. It depends on your graphics card.
OpenGL specifications (again those specifications...) do not ensure that a texture greater than 64x64 can be used. Eh eh, hopefully most of the graphics cards support more than that
If you don''t want to overload the texture memory, you gotta ask the graphics card (using OpenGL) which texture size can be set while you''re setting it on the card.
Also, you may not use static limits (like 2048x2048) because (i) this limit varies depending on the graphics card, and (ii) you may not have enough memory for storing the texture if too many textures were loaded before.
YOU CAN NOT SET A NON POWER-OF-TWO SIZED TEXTURE IN OPENGL, BY ANY MEAN.
you hear me ?
OpenGL specifications clearly says that.
IMO, if your 64x43 texture works, this is because you''re using mipmaps which, using the glu, automatically resizes the image to its better size.
Also, the texture size is not limited to 2048x2048. It depends on your graphics card.
OpenGL specifications (again those specifications...) do not ensure that a texture greater than 64x64 can be used. Eh eh, hopefully most of the graphics cards support more than that
If you don''t want to overload the texture memory, you gotta ask the graphics card (using OpenGL) which texture size can be set while you''re setting it on the card.
Also, you may not use static limits (like 2048x2048) because (i) this limit varies depending on the graphics card, and (ii) you may not have enough memory for storing the texture if too many textures were loaded before.
The limits of Size are quite clear to me,
but I wonder which colorDepth the bitmap has to have??
Does the Colordepth have to be the same as the screens one?
bppBitmap = bppScreen (device context)
or does it have to be lower or equal to that of the screen?
bppBitmap <= bppScreen
(this is what I would think)
or can it be any colordepth?
e.g: bppBitmap = 32, bppScreen = 8
waiting for a life after death
but I wonder which colorDepth the bitmap has to have??
Does the Colordepth have to be the same as the screens one?
bppBitmap = bppScreen (device context)
or does it have to be lower or equal to that of the screen?
bppBitmap <= bppScreen
(this is what I would think)
or can it be any colordepth?
e.g: bppBitmap = 32, bppScreen = 8
waiting for a life after death
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement