PDA

View Full Version : Calculate? - RAM needed by image maps?



Johnny
03-14-2005, 11:13 AM
Is it possible to know how much RAM per node an animation will require based upon the total sizes of all the image maps used in that scene?

Is it linear..say you have maps of 4MB, 50MB, 20MB, 12MB..is the RAM requirement for that scene increased by 86MB over what that scene would require minus those maps?

If your render machines have X-amount of RAM, how can you figure out how many or how large you maps can be without exceeding the RAM in those machines?

Hope this question makes sense..thanks

J

robewil
03-14-2005, 12:12 PM
To calculate RAM usage by an image:

(Horizontal Resolution X Vertical Resolution X Number of bits in image) / 8 = number of bytes

So a 24 bit 1024X768 image will use:

(1024 X 768 X 24)/8 = 2,359,296 or approximately 2.3 MB.

BeeVee
03-15-2005, 03:57 AM
That's only partially true. If the image is mip-mapped it will use more and if it has an in-built alpha channel it will use more, but if it's 8-bit greyscale, it will use less and so on. It's a tricky question with plenty of variables, sorry.

B

mkiii
03-15-2005, 06:46 AM
In addition.

AFAIK. LW also creates on the fly textures for OGL display based on the settings you give it in the options panel... ie 128x128 -> 1024x1024 etc. These also take up RAM. Don't be fooled by the size of an images file.

In layout, press w to get a figure for total memory usage, and look at the top of the image editor panel for a total figure for the loaded textures.

JML
03-15-2005, 07:18 AM
(in the image editor, when you click on an image it tells you how much memory it use)

try to use 8 bit textures or less, especialy when working on big projects..

robewil
03-16-2005, 12:07 PM
That's only partially true. If the image is mip-mapped it will use more and if it has an in-built alpha channel it will use more, but if it's 8-bit greyscale, it will use less and so on. It's a tricky question with plenty of variables, sorry.

BI assume you mean "bit-mapped". All images types used as textures in Lightwave (bmp, png, jpg, tif, etc.) are bit-mapped. In my equation, I do state "Number of bits in image" which means if your image has an alpha channel, use 32 in the equation. If it's an 8-bit greyscale image, use 8. I believe my equation is completely correct. Note that this is referring to system RAM usage, not graphic card memory or hard drive storage of an image. That's where it gets trickier and has more variables.

Lightwolf
03-16-2005, 12:21 PM
I assume you mean "bit-mapped".
Actually, he does mean mip-mapped :)
Mipmaps are generated by Lightwave for texture filtering (you have a high and low setting included in 8.01 onwards I think).
Basically LW stores scaled down versions of the texture so it doesn't have to look up as many pixels when the image is far away in the distance or small in the final image.
You can add another 50% of the raw image size if you use mip-maps (the manual states the memory usage of images too btw).
So, basically the formula is:

memory used = (width * height * bits_per_channel) / 8
+
mip-map memory = memory used
=
total memory used by image in bytes (divide by 1024 for Kb, by 1024 again for Mb).

Now, bits per channel can be:
HDR:
32 * 4 - floating point RGBA
32 * 3 - floating point RGB
32 * 1 - floating point Luminance (greyscales)
LDR:
8 * 4 - normal RGBA
8 * 3 - normal RGB
8 * 1 - normal Luminance
8 * 1 - image with a 256 colour palette (I think iff is the only format that supports this) (1) (2)
1 * 1 - black & white bitmap (3)

Notes:
(1) the mip-map will used the equivalent memory of a 8*3 RGB image.
(1) It could be that LW also support other bit per channel palettized modes (i.e. 4 bit = 16 colours), I haven't checked that in ages. The mip-map will always be full colour 8*3 though.
(3) the mip-map will used the equivalent memory of a 8*1 Luminance image.

Unfortunately LW doesn't support 16bit textures.

I hope that helps (and I hope I got all the numbers right ;) ).

Cheers,
Mike

robewil
03-16-2005, 01:31 PM
Thanks Mike. My lesson for the day. :)

Lightwolf
03-17-2005, 01:26 AM
Thanks Mike. My lesson for the day. :)
Lol... I hope it didn't come across as too smart-arsey ;)

Cheers,
Mike

Johnny
03-17-2005, 07:00 AM
aaaaaaaaaaaaaaaaaaaaaaaaah?

JML
03-17-2005, 07:06 AM
Unfortunately LW doesn't support 16bit textures.

question,
when I load a 2000*2000px jpeg (so 24bit) in LW,
in the image editor, it tells me it's using 11.4 Mb,
the same image converted in 8bit is using 3.8Mb.

so do you mean that LW doesn't support 16,24bit imagery ?
is the 24bit texture just wasting memory ? and it will render exactly the same as a 8bit texture would ?
in other words, when you hit render, does LW convert all texture to 8 bits?

BeeVee
03-17-2005, 07:23 AM
What LightWolf meant was sixteen bits per channel in the phrase you quoted. It get's confusing because a 24-bit image is only 8-bits per channel (8 red, 8 green, 8 blue = 24), whereas an 8-bit image (like a GIF) uses a total of 256 colours and the 8-bit here refers to 8^8... :)

The only place where LightWave will use all the colour in an image is a colour map (or a reflection map, or basically anything that needs to show red, green and blue in a final render). If you are using colour images for bump maps, or specularity maps, for instance, then yes, you are wasting memory since they only need to be 8-bit greyscale images (8-bit remember is 256 levels of grey).

B

JML
03-17-2005, 09:07 AM
thank you beevee

tischbein3
03-18-2005, 03:42 AM
jpeg is a ram killer, don't use it. Convert it into tga or tiff, or even iff.

Lightwolf
03-18-2005, 03:44 AM
jpeg is a ram killer, don't use it. Convert it into tga or tiff, or even iff.
It shouldn't make a difference in RAM, since they all get uncompressed anyhow...

The only reason not to use JPEgs are the compression artifacts.

Cheers,
Mike

tischbein3
03-18-2005, 03:52 AM
It shouldn't make a difference in RAM, since they all get uncompressed anyhow...


I don't know why it is, but you give a possible explaination yourself.
Try it, I was surprised myself. Since then I ever check out if a jpeg has found its way into the image panel, to replace it with a tga version




The only reason not to use JPEgs are the compression artifacts.

Cheers,
Mike


this is of course another reason.

skol
chris

BeeVee
03-18-2005, 04:28 AM
I think the problem you're talking about is that although a JPEG seems small on the disk, it uses lots of memory in LightWave? That's completely normal because the size on disk has nothing to do with the size in memory because the different image formats use various compression techniques for keeping filesize down. However, once they are brought into LightWave they need to be uncompressed into their constituent pixels, so although you might think you are saving *memory* by using Jpeg, PNG, LZW Tiff, etc. all you are doing is saving *disk space*.

B

tischbein3
03-18-2005, 04:54 AM
no, I'm really talking about jpeg needing more memory, but it seems I'm wrong.
I just try to recreate it, but it does not function. Same memory size. Either tga or jpeg.
The weird thing is, I DO know that I've saved some memory in some scenes by using tga instead of jpeg before. Maybe those tga were 16 bit only, (which would be more than enough for most of the color textures), Give me some seconds I will just try something....

tischbein3
03-18-2005, 05:28 AM
I've just rechecked a scene were I did know It had some impact, nada
Then I looked if its perhaps something like the exif info or so...also nada
Also no difference by using different paint programs.

I know its perhaps to much to ask for, but could someone try to use a tga instead of an jpg on a pre-XP system ?


No I'm really flabbergasted.....