POV-Ray : Newsgroups : povray.windows : Single BMP, perhaps you all misunderstood my question Server Time
28 Jul 2024 12:34:23 EDT (-0400)
  Single BMP, perhaps you all misunderstood my question (Message 11 to 20 of 28)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 8 Messages >>>
From: Nieminen Juha
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 7 Sep 1999 06:39:07
Message: <37d4eb4b@news.povray.org>
Remco de Korte <rem### [at] xs4allnl> wrote:
:> 2) BMP for a game? I'd really suggest trying to stay away from BMP if at
:> all possible. Store things as PNG and just convert to BITMAP as you read
:> in.

: Again: why? What would be the advantage of PNG over BMP? It loads much slower.

  Size. Why should you make a 10-Megs game when it could be a 1-Meg game?
  Disk space is cheap, but still limited.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Margus Ramst
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 7 Sep 1999 07:01:53
Message: <37D4F08E.FA71E9A5@peak.edu.ee>
Remco de Korte wrote:
> 
> Jon A. Cruz wrote:
> >
> >
> > 1) Make it 64x640. Tall, not wide. Then you have the benefit of having the
> > memory for the one frame structured almost as if it was an individual pic.
> > Makes it better for several other reasons also. Each frame can be
> > displayed/manipulated without having to know the total number of frames.
> > Etc, etc., etc. It also makes it much easier for me to write you a custom
> > concatenation program if you can't find anything else.
> 
> Could you please explain. I don't think I understand your reasoning here.
> 

The reasoning is that bitmaps are ordered in rows, not columns. When the
X by Y components are stacked vertically, each component is represented
by a single X by Y long byte stream. When they are stacked horisontally,
a component are sliced into Y separate pieces, each X bytes long. Not a
big problem, but why do it the harder way?

Margus


Post a reply to this message

From: Remco de Korte
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 7 Sep 1999 07:20:40
Message: <37D4F62C.DAB73FD2@xs4all.nl>
Nieminen Juha wrote:
> 
> Remco de Korte <rem### [at] xs4allnl> wrote:
> :> 2) BMP for a game? I'd really suggest trying to stay away from BMP if at
> :> all possible. Store things as PNG and just convert to BITMAP as you read
> :> in.
> 
> : Again: why? What would be the advantage of PNG over BMP? It loads much slower.
> 
>   Size. Why should you make a 10-Megs game when it could be a 1-Meg game?
>   Disk space is cheap, but still limited.
> 

Ehm, we're talking about a _game_ here. Like those things you can download 28Mb
demo's of. 
Would it really be such an advantage to use PNGs instead of BMPs? I think not.
As a matter of fact I think PNG are seldomly used for that. There are all sorts
of custom formats around where multiple images are stored in one big
blob-data-file but if you want to make it simple on your self in programming a
game on a windows platform BMP is not such a bad choice. If diskspace is a
consideration you might use RLE-compressed bitmaps (if you're colordepth allows
it).
From the games I've seen speed is much more an issue then diskspace. 
Diskspace was an issue when a game had to be crammed onto floppies. That's
(nearly ancient) history by now.
BTW: I'm not saying that I'm in favor of those huge games, there are some really
good games that may even look good (considering...) that take less then 100K.
But then we're not talking Windows games anymore.
I guess when you decide to make a Windows program you've already accepted the
fact that it takes up much more diskspace then really necessary.

Mazzel!

Remco


Post a reply to this message

From: Remco de Korte
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 7 Sep 1999 07:23:36
Message: <37D4F6DC.84401721@xs4all.nl>
Margus Ramst wrote:
> 
> Remco de Korte wrote:
> >
> > Jon A. Cruz wrote:
> > >
> > >
> > > 1) Make it 64x640. Tall, not wide. Then you have the benefit of having the
> > > memory for the one frame structured almost as if it was an individual pic.
> > > Makes it better for several other reasons also. Each frame can be
> > > displayed/manipulated without having to know the total number of frames.
> > > Etc, etc., etc. It also makes it much easier for me to write you a custom
> > > concatenation program if you can't find anything else.
> >
> > Could you please explain. I don't think I understand your reasoning here.
> >
> 
> The reasoning is that bitmaps are ordered in rows, not columns. When the
> X by Y components are stacked vertically, each component is represented
> by a single X by Y long byte stream. When they are stacked horisontally,
> a component are sliced into Y separate pieces, each X bytes long. Not a
> big problem, but why do it the harder way?
> 
> Margus

That is a reasonable explanation.
The way I think this will work the whole image will be loaded into memory with
one single statement and then it's not really relevant anymore though. Besides,
it may be easier in low level programming environments but on most programming
platforms it doesn't really make much difference.
But I see your point.

Ciao!

Remco


Post a reply to this message

From: Nieminen Juha
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 7 Sep 1999 10:06:14
Message: <37d51bd6@news.povray.org>
Remco de Korte <rem### [at] xs4allnl> wrote:
: Ehm, we're talking about a _game_ here. Like those things you can download 28Mb
: demo's of. 
: Would it really be such an advantage to use PNGs instead of BMPs? I think not.
: As a matter of fact I think PNG are seldomly used for that. There are all sorts
: of custom formats around where multiple images are stored in one big
: blob-data-file but if you want to make it simple on your self in programming a
: game on a windows platform BMP is not such a bad choice.

  I quote myself: "Disk space is cheap but still limited".
  This means that with current hard disks the size of one game doesn't matter
at all. It could be 10 kilobytes or 1 Gigabyte. Big deal.
  The problem is that you seldom play just one game and use just one program.
Usually you have many of them on your disk. If everyone of them took 1
Gigabyte, you will certainly complain. A 16 Gigabytes hard disk would be
full quite soon.
  It's good to think that your program is not the only program the end user
will be using. Saving storage space for the other programs is polite, IMHO.


: If diskspace is a
: consideration you might use RLE-compressed bitmaps

  RLE doesn't pack very well.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Lutz Kretzschmar
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 7 Sep 1999 10:17:24
Message: <37d51e8b.28741928@194.174.214.110>
Hi Remco de Korte, you recently wrote in povray.windows:

> That is a reasonable explanation.
> The way I think this will work the whole image will be loaded into memory with
> one single statement and then it's not really relevant anymore though. 
If the image is vertical, blitting from it will be better because the
bitmap is in contiguous memory, i.e. the CPU cache will do a much
better job of getting data, it could make it quite a good deal faster.

- Lutz
  email : lut### [at] stmuccom
  Web   : http://www.stmuc.com/moray


Post a reply to this message

From: Jon A  Cruz
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 7 Sep 1999 11:07:11
Message: <37D529F8.AF4DECDD@geocities.com>
Remco de Korte wrote:

> Jon A. Cruz wrote:
> >
> > 2) BMP for a game? I'd really suggest trying to stay away from BMP if at
> > all possible. Store things as PNG and just convert to BITMAP as you read
> > in.
>
> Again: why? What would be the advantage of PNG over BMP? It loads much slower.
> >

"It loads much slower". That sounds like a start at premature optimization, which
is the root of all evil. :-)

How much is "much slower". Tests should be made. I'm guessing on the order of
perhaps a second at the extreme. Depends on your system. Disk speed is going to be
a bottleneck anyway, and modern processors get quite fast. The main point would be
to test it in context and see how it works overall.

Another thing to consider is when will this apply?  Usually this slight slowdown
would occur once at the begining of the program or level. While a splash screen is
being displayed. Balance that with having the equivalent of keeping all your
images ZIPped on disk the entire time the user has the game installed but is not
playing it.

Also by taking that hit on speed at one point during startup you also buy the
addition of transparency by color or by alpha channel, etc.


Anothing thing that had been mentioned was RLE BMP files. Problem is that RLE
compression really sucks for most things (that's my professional opinion from
having worked with RLE a lot :-)  Also, using it will make the BMP's incompatible
with a lot of programs. But at least it's not quite as bad as "right-side-up"
BMP files.

--
"My new computer's got the clocks, it rocks
But it was obsolete before I opened the box" - W.A.Y.


Post a reply to this message

From: Ron Parker
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 7 Sep 1999 11:15:06
Message: <37d52bfa@news.povray.org>
On Tue, 07 Sep 1999 14:19:01 GMT, Lutz Kretzschmar wrote:
>Hi Remco de Korte, you recently wrote in povray.windows:
>
>> That is a reasonable explanation.
>> The way I think this will work the whole image will be loaded into memory with
>> one single statement and then it's not really relevant anymore though. 
>If the image is vertical, blitting from it will be better because the
>bitmap is in contiguous memory, i.e. the CPU cache will do a much
>better job of getting data, it could make it quite a good deal faster.

Though if you're lucky, the bitmap is located in an unused chunk of video 
memory and the CPU doesn't even have to get involved in the blitting 
operation.  Yes, I've been writing video device drivers lately, why do you
ask?  Is it the missing hair or the wild look in the eyes?


Post a reply to this message

From: Crunchy Frog
Subject: Gee guys!
Date: 7 Sep 1999 18:55:25
Message: <37D59872.22A4C470@montypython.co.uk>
All this talk over a simple question. And no one has posted an answer. I
know what I am doing. I know all about image format trade-offs, and load
times, and palettes, etc. I was just hoping for a pointer a nice little
app that solved my problem. Oh well, I'll write my own.

BTW: It doesn't matter if the images are stored vertically or
horizontally because the image must be moved to the video surface one
row at a time. The only time you can take advantage of contiguous memory
is when it exactly matches the pitch of the display surface, and when
your image is on a surface by itself. Neither of these will be the case
for me. In case anyone was wondering, the game is being written for
Windows 95/98/NT, DirectX 3+, and will most likely be 16-bit or greater
colors. But I want to allow for any depth BMP file to be loaded, so he
graphics will be potentially upgradable or user-swappable.


Post a reply to this message

From: Remco de Korte
Subject: Re: Single BMP, perhaps you all misunderstood my question
Date: 7 Sep 1999 19:46:19
Message: <37D5A4EC.539C4FA@xs4all.nl>
Nieminen Juha wrote:
> 
> Remco de Korte <rem### [at] xs4allnl> wrote:
> : Ehm, we're talking about a _game_ here. Like those things you can download 28Mb
> : demo's of.
> : Would it really be such an advantage to use PNGs instead of BMPs? I think not.
> : As a matter of fact I think PNG are seldomly used for that. There are all sorts
> : of custom formats around where multiple images are stored in one big
> : blob-data-file but if you want to make it simple on your self in programming a
> : game on a windows platform BMP is not such a bad choice.
> 
>   I quote myself: "Disk space is cheap but still limited".
>   This means that with current hard disks the size of one game doesn't matter
> at all. It could be 10 kilobytes or 1 Gigabyte. Big deal.
>   The problem is that you seldom play just one game and use just one program.
> Usually you have many of them on your disk. If everyone of them took 1
> Gigabyte, you will certainly complain. A 16 Gigabytes hard disk would be
> full quite soon.
>   It's good to think that your program is not the only program the end user
> will be using. Saving storage space for the other programs is polite, IMHO.
> 

We're talking about games, not politics.

> : If diskspace is a
> : consideration you might use RLE-compressed bitmaps
> 
>   RLE doesn't pack very well.
> 

Agreed. Same with PNG.

Cheers!

Remco


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 8 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.