Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Background.. how?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
29 replies to this topic

#21 Morgan   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 April 2000 - 05:39 AM

Want a quick fix for loading odd shaped textures? load them with MIPMAP filtering! It uses more memory, but it''s the easiest solution, that way you don''t have to break it up or resize it oddly.

Morgan

Sponsor:

#22 sc0rpy   Members   -  Reputation: 122

Like
Likes
Like

Posted 23 April 2000 - 05:34 PM

The keyword is filtering, I would prefer if no filtering was applied. It''s hard to ask a graphics artist to spend time making a nice background then explain to them why it looks like sh*t because it was filtered.

It''s not a big deal, there are always ways to draw a large background. I''m just surprised it''s so difficult to do it without massive FPS loss / image quality loss.

#23 gmcbay   Members   -  Reputation: 130

Like
Likes
Like

Posted 23 April 2000 - 07:47 PM

sc0rpy...to get the maximum texture size the current driver supports:

GLint maxTextureSize;

glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);


To reduce any filtering problems, when uploading the texture that you are going to display as a flat 2D graphic, make sure you switch filtering to nearest:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);


Edited by - gmcbay on 4/24/00 1:51:44 AM

#24 Demon Lord   Members   -  Reputation: 122

Like
Likes
Like

Posted 24 April 2000 - 08:25 AM

I''ve made, this weekend, a texture-based bitmap loader which works with bitmaps of any size. It still needs to be tested, though, so I won''t comment until it *really* is usable (works fine on my machine, but freezes my friend''s).

Eric Laberge

#25 Morgan   Members   -  Reputation: 122

Like
Likes
Like

Posted 24 April 2000 - 03:21 PM

Well you create a MIPMAP using gluBuild2DMipmaps() instead of glTexImage2D(). The filtering is up to you, pick the one you want, it doesn''t matter. But, mipmap is the only way I know of to load textures of unmatching side lengths.

Morgan

#26 a2k   Members   -  Reputation: 122

Like
Likes
Like

Posted 24 April 2000 - 04:18 PM

yeah, i just used the opengl superbible code, and i loaded up a 640x480 bitmap on a surface....

a2k

#27 sc0rpy   Members   -  Reputation: 122

Like
Likes
Like

Posted 25 April 2000 - 02:52 AM

To be honest I never tried mipmaps for the larger images, I suppose in my haste the ''filtering'' word caught my eye and so I avoided the topic.
I know what DemonLord is doing and it was what I was planning on doing except I got caught converting my .3ds code from d3d to ogl so I didn''t have much time to experiment with this topic further.

Obviously the topic is of interest to others explaining why this thread is getting so long.

#28 Demon Lord   Members   -  Reputation: 122

Like
Likes
Like

Posted 29 April 2000 - 01:28 PM

After some testing, my irregularly-shaped bitmap loader seems to be visually perfect. So far, it has been tested with bitmaps whose dimensions were multiples of four [252x60, by example], though I don''t see any reason why it wouldn''t work on anything else. It has been tested with 8-bit and 24-bit bitmaps, on 16 and 32 bit displays. I have to notice that framerate jumped to fill-rate limitation (140+FPS @1024x768x32) from about 10 FPS, so it is obviously performing great.

I still have some memory problem (hence my question on the board), so I''ll wait until it is finished and stable to post some code. Here how it basically works:

1) Decode the bitmap
2) Split the bitmap to optimize the memory usage.
3) Create textures
4) Create a display list and return the display list number

Examples of bitmap separations:
Bitmap size : 120x320
Texture sizes: 128x128
Number of textures: 1x3 (3)

Bitmap size : 640x480
Texture sizes: 256x256
Number of textures: 3x2 (6)

I will post, if anybody''s interrested.

Eric Laberge

#29 sc0rpy   Members   -  Reputation: 122

Like
Likes
Like

Posted 01 May 2000 - 10:51 AM

Sure, post it if you have time.

If you have webspace somewhere maybe post the EXE aswell so we can see it in action.. otherwise an overview of the code would be excellent.



#30 Demon Lord   Members   -  Reputation: 122

Like
Likes
Like

Posted 01 May 2000 - 01:27 PM

I''ll post next week-end or so (exams... lot of work).

Eric Laberge




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS