Click to See Complete Forum and Search --> : DX7 question
drewski
Jan 1st, 2001, 10:56 PM
okay i want to know what would be the bigest recomended picture you could hold in the backbuffer for a machine with 32 mb of ram. Im talking in megabytes. I'm not sure what would work and I dont want to try till I have some idea.
HarryW
Jan 2nd, 2001, 11:23 AM
I expect that depends largely on the operating system, since later OSes generally use more RAM. It could also depend on the amount of VRAM on the graphics card too, if you want your surface in VRAM if it will fit.
Just out of curiosity, why?
drewski
Jan 2nd, 2001, 07:13 PM
I was wondering because I'm making a game and I need to know how big I can make the maps. I'm using win98 but what is VRAM? Could it be Video RAM? My machine has 4mb but that's not the point. I want to keep the sys requirements down. I want it to work good on all computers not just mine.
I tried to make a picture the size I wanted with psp5 and the biggest it would go without freezing was about 20 mb. I was thinking though if you didnt have to actually make the picture (actually creating it would take up more resources I think)would virtual memory help take care of the large amout of data required or would that slow it down too much?
It's just a thought. If you dont know what would be best then I'll just have to experiment once I get my map editor running.
Drewski
drewski
Jan 4th, 2001, 07:55 PM
So I guess nobody knows anything more about this?
HarryW
Jan 4th, 2001, 09:06 PM
Well... I don't know what to say really. Virtual memory provides a seamless link between your DRAM and hard disk space, allowing you to store as much as you need in memory (virtual or not) until you run out of hard disk space. It will slow things down a lot though if you start making a lot of disk read/writes. I'd definitely aim to keep it all within the bounds of your RAM.
VRAM is indeed Video RAM, I think it's the same thing as SGRAM. It's the RAM on your video card which your primary surface resides on. I'm not sure, but I don't think you can have your primary surface anywhere else, as the image is rendered directly from VRAM to the screen. Copying memory from VRAM to VRAM is a lot faster than copying it from your main RAM to VRAM. Also, if you have a back buffer in VRAM, you can use page flipping to flip the secondary surface to the primary without the need to move the data; if your secondary surface is in main RAM then the data has to be moved to VRAM, which takes time.
Basically, you want to keep as many of your secondary surfaces in VRAM as possible, so bear this in mind when you are choosing the size of your images. Of course, using 8 bit colour instead of 16 or 32 bit colour will reduce the amount of space needed significantly.
drewski
Jan 9th, 2001, 12:45 AM
Okay, I got another questin. What's SGRAM?
drewski
HarryW
Jan 9th, 2001, 01:11 PM
Well, like I said I think it's the same thing as VRAM. It's like SDRAM, but faster and I think it's a fair bet that the G in SGRAM stands for 'graphics'. So it's a fast kind of RAM for graphics cards.
More than that I couldn't tell you without looking into it myself. It's not really important though from the point of view of the question, since using any kind of RAM locally on the graphics card will be faster for graphics stuff than using system RAM, but what you're interested in is the quantity of space available.
If you really want to keep the required machine specs down, then use 8-bit palettised colour (a limited selection of 256 different 32-bit colours). This way, each pixel you display will need only 1 byte of storage. At a resolution of 640x480, that's 307200 bytes, or 300k. If you were to display the same thing at 1024x768, it would be 786432 bytes, or 768k. In 32-bit colour, this would rise to 3 megabytes. So if you want to keep the specs down, use low colour depths and low resolutions.
Maybe you should just experiment with it a little like you said.
One thing to bear in mind might be that some older video cards don't support 24-bit colour, and need the 24-bit colour converted to 32-bit in order to work. Some also have odd ways to store 16-bit colour, usually it's in 565 format (5 bits red, 6 green, and 5 blue), but some use 555 (first bit is unused) which is also sometimes called 15-bit colour. I'm not sure if DirectX will sort this out for you in VB (I use it in C and you have to do it yourself) but you might want to avoid the hassle and just use either 32-bit or 8-bit colour.
To be honest, I don't really understand why PSP froze with large images. Perhaps it manages the image data in a way that's unlike the way you would use it. If you want to keep a 20 Mb map image in RAM then you will almost certainly end up with some of it in virtual memory, but I don't know how bad a performance hit that would be. I guess you'll have to try it.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.