Mason opened this issue on May 31, 2004 ยท 42 posts
Mason posted Mon, 31 May 2004 at 9:02 PM
I was working today on a scene and noticed that my Firefly renderer started doing the usual lock up when rendering. All I had was a bedroom, 1 vicky figure, some furniture and some clothes. I thought, "nah, couldn't be that intense" but looking at my poser 5 memory usage I was a 1.25 gigs! Yeoch. So I go through the textures for this scene, which I got from purchased packages and here's what I find. 1. Textures that describe the rail on the bed and the feet, mostly all white with just a little art in the upper part of the texture:2000x1380 YEOCH! 2. All textures using repeating tiles: 800x600 YEOCH! 3. A simple reflection map used for a lamp: 2500x3000 YYYEEEEOOOUUUUCCCHHHH!!! So I go through and reduce all textures to reasonable sizes and powers of 2 and voila, my scene renders just fine. So I want to post this to once more remind texture makers to be careful with their texture packs and sets. Let's go over a little math to help people understand how this can get crazy real quick. Texture size goes up exponentially, not linearly. That means doubling a texture does not double its memory space, IT GOES UP BY 4 TIMES! Here's a break down of texture sizes assuming Poser uses 32 bit (4 bytes per pixel) texture memory. 128x128 = 65,536 bytes 256x256 = 262,144 bytes 512x512 = 1,048,576 bytes 1024x1024 = 4,194,304 bytes 2048x2048 = 16,777,216 bytes 4096x4096 = 67,108,864 bytes and the mega 8192x8192 = 268,435,456 Now the assumption here (and based on my knowledge of rednering engines and graphic systems) is poser doesn't give a hoot you have that whoppong 4096x4096 all crunched down into a 128k jpg file. Poser will still expand that texture out to a block of 67 megs of ram to rasterize the texture (work across the texture to get the bits so it can display the texture on the polygon). So that means a 4096x4096 texture of solid black takes up as much room as a texture with a picture of France on it. Of course, I'm assuming they unpack textures in Firefly which is a pretty reasonable assumption. So what does this mean for texture makers? Well having a skin pack with a 4096x4096 skin texture and adding lipstick, eyeshadow etc packs at that same res. will blow out some poor saps poser memory worse than squeezing an elephant into a phone booth. Making the texture for wheels on a bed be 2000x2000 pretty much dooms that bed to a lock up once it tries to render. Lets add to that most rendering systems work in powers of 2 for texture sheet sizes. They do this since the math to rasterize the texture is far faster when the texture is a power of 2. So what does Poser do with a 1100x1100 texture? That's not a power of 2 (2,4,8,16,32,64,128,256,512,1024,2048 etc). Well if Fire Fly is like any other rendering engine it creates the next biggest sized texture sheet that IS a power of 2 and puts that 1100x1100 texture in the upper left corner and rasterizes that. That means that 1100x1100 texture turns into a 2048x2048 texure! YEEEOOOUUCH! All that wasted space, worse if that's just the wheels on a bed or lipstick on a person. I have no idea if poser fire fly has a sheet management system which might use the unused portions of that 2048x2048 sheet to put smaller textures on it but at the rate most texture makers are going, there AREN'T ANY small textures to go there! So not only is size important but keeping the size to a power of 2 is important. Now lets talk about another issue which is very important that appears to be missed namely texture resolution. If I render an 800x600 picture with a flat billboard with an 800x600 texture on it, unless the camera is set up in such a way as to see the whole billboard, I'm not going to do any better than 800x600 texture resolution. If I zoomed in on that billboard so the full screen is encompassed by half the billboard then having a higher res texture would give the render more resolution. But for the most part people don't render zoomed up on an object. They render several objects in a scene. So what does this mean? It means that having a 4096x4096 face texture does you no good if your final render is 800x600, especially if the face only encompasses 1/4 or less of the total area. The computer can still only render one pixel on a pixel spot. It can't subdivide pixels. So You could use an 800x600 (or a 1024x1024) skin texture in its place and see no real difference. Imagine a crowd scene rendered at 800x600. You see 12 people in the crowd. Now, if each person's face texture was 4096x4096, you wouldn't see anymore detail than if that face texture was at 1024x1024 or even 512x512. In other words a high res texture does you no good if the item rendered comes out less in size that the texture resolution. So to sum things up, here are some helpful tips in texture making that will guarentee less P5 fire fly crashes and lockups. 1. Keep textures small! I know you're proud of a texture but a 2000x2000 texture for a bed wheel is absurd. I have a standing rule no textuire can be over 1024x1024. 512x512 is the standard and most are in the 256x256 range. 2. High res textures do you no good when the item rendered is less than the resolution of the texture. A face rendered on a 800x600 sized picture won't benefit much, if at all, from a 4096x4096 skin texture. 3. Keep textures at powers of 2. (2,4,8,16,32 etc). Poser is more than likely stuffing your 1100x1100 texture on the next size up sheet that is a power of 2. That's a huge memory waste. Also try and keep textures rectangular. Some systems don't like non-square textures. 4. Disk usage is irrelevant. A 50k jpg of a solid black 4096x4096 texture will still take up 67 megs in ram. YEEOOOUCH! 5. If you're selling to P5 only users, try taking advantage of the P5 shader node abilities. That means insted of making a brick wall with a huge texture on it to get a detailed repeating wall texture, you can set up the shader node to repeat a much smaller wall texture for you. Also using procedurals and blender nodes can greatly reduce texture usage.