Author Topic: Is PNG 32 bit used for all graphics/uvmapping?  (Read 5058 times)

Xordan

  • Crystal Space Developer
  • Forum Addict
  • *
  • Posts: 3845
  • For God and the Empire
    • View Profile
Re: Is PNG files used for all graphics/uvmapping?
« Reply #15 on: May 14, 2006, 09:10:10 pm »
Well feel free to convert the maps/models/objects/gui how you think and upload them somewhere, and I'll try them out.

Wired_Crawler

  • Hydlaa Citizen
  • *
  • Posts: 429
    • View Profile
Re: Is PNG files used for all graphics/uvmapping?
« Reply #16 on: May 14, 2006, 11:31:57 pm »
Wired how do you like your humble pie?

Err... Do You mean -> this humble pie or -> that Humble Pie ? In either case I don't know, what You are talking about... :P
Never mind.

BTW can you do me a favour and tell my of a game that is using 100% 32 textures, you see im certain allmost 99% use 8bit and things like colour ramping, bumpmaping, vert painting, etc etc are rendered at 32bit using 8bit textures.

You are right. Not 100% are 32bit textures (and I never used "100%" in my replies). Example? I would like to check textures of "Myst V", which is closer to that what I consider as "beautiful recentd 3d games", but they are not so easy to extract and I'm not sure if I have enough free space on disk. Let's try something easier: Doom 3 (which is not a newest game). All textures which are not in DDS format, are stored in TGA files using greyscale, 24- or 32-bit color. Around 30% of those TGAs have less than 256 colors in use, so 70% of images need more than 8-bit for color information. Do You think that creators of Doom 3 made a mistake and they should reduce number of colors in more textures (~40 % use 1k-10k different colors) ?
Unfortunately, I can't check all recent 3d games, I have no money for them. :P

BTW: It looks like Doom 3 has DDS and TGA versions of the same textures, DDS version occupy around 4x less space on disk, so it is good solution for sure.
"Close the world, txEn eht nepO."

jorrit

  • Developers
  • Hydlaa Citizen
  • *
  • Posts: 497
    • View Profile
Re: Is PNG files used for all graphics/uvmapping?
« Reply #17 on: May 15, 2006, 12:58:34 pm »
Xordan they will load faster on hands down on linux or mac because windows is bloat ware. Linux and Mac are much more optimized at a lower level ( mac also being from hardware up ). Its great your looking into DDS and i think this could be a solution, but  i didn't want to say it before but thats not going to solve any gameplay  or any memory issues. Unless the devs make some of these bit 8bit that should be 8 bit. Yes in some cases you may have to remap but why not.

Where you lose quality in Textures by using 256 color textures is by the amount you scale it when setting the mapping on the mesh. From my Exp your better off to use larger Textures at 8 bit when your scaling the texture to much. This will give you a sweet result and you do not have to worry about taking up to much more memory. i have noticed where texture mapping scaling is an issue in PS.

this is below is sorta what im talking about.

Expample: you could have 1 1024x1024 8bit textures for the cost of 1 32 bit 512x512

Which has more pixels? Which file could hold more detail?

Internally in Crystal Space and on the card textures are ALWAYS stored as 32-bit. So it doesn't help to convert them to 8-bit. You will not gain any memory by doing that.

Greetings,
Project Manager of Crystal Space, CEL, CrystalBlend and Crystal Core. Please support Crystal Space with a donation.

res

  • Crystal Space Developer
  • Traveller
  • *
  • Posts: 30
    • View Profile
    • Crystal Space
Re: Is PNG files used for all graphics/uvmapping?
« Reply #18 on: May 15, 2006, 04:09:49 pm »
Internally in Crystal Space and on the card textures are ALWAYS stored as 32-bit. So it doesn't help to convert them to 8-bit. You will not gain any memory by doing that.

That's not technically 100% correct either. The textures might get stored on the card compressed (ie DXT), which amounts to 4bpp to 8bpp per pixel - however this is not a *paletted* image. The quality is somewhat worse than a full 32bit image, but with a typical game texture the difference is hard to see, and it beats paletted images.

DDS images can store textures in a number of formats, but notably they support the abovementioned DXT. Together with the support for storing mipmaps in DDSes, this removes the need to do any processing of the image after loading; hence the significant speed boost.
A Crystal Space developer

Yaskina

  • Guest
Re: Is PNG files used for all graphics/uvmapping?
« Reply #19 on: May 15, 2006, 11:11:46 pm »
Interesting last 2 posts :detective: Well i have converted quite a few to 8 bit png and im really getting mixed results. Part of my problem is where i load into the game as the game uses many textures over and over on the different zones ( which is great), but not having converted the entire game its causing naming issues etc.

But yes it seems every single file in the game is 32-bit except for a small few that i found as gif maybe 10 so far.

 I have  tried animated gif and it did not work (stayed on first frame), however i am thinking it might be possible if i add a few lines of code to the cal3d file. If anyone has a cal3d file that uses a animated gif please post a snippet of the code text. The animated gif i made was just of the rat blinking his eye 4 frames 10 sec delay on open.

Im now going to run some probes to check memory and vram. I wana see what or what not is being dumped.

The other thing im wondering if the zip packs where 2/3 smaller cause they had optimized files in them. Why not change the zip format from Deflate (high compress) to store ( no compress ). This should speed up loading of the files if they are not packed all up. ( go ahead tell me im wrong LOL ). If anyone knows of a batch converter for mac that can do this please let me know. I would want to do every single zip pack in the ps folder in one pass and in place no mucking around.

I have also been messing around with the particle emitters. I changed the particles from 50 to 10 and size from .025 or .25 (not-sure) to .075 Seems to look almost as good as 50. In fact you probably would not even notice the difference other than it fills out a little more on the torch in the sewers. 50 increased in size a smaller amount than i did would probably look best, but why emit 50 when you can do it in 10. Now i have to get after the smoke stacks and the other fire pits. Only things is i just really really wanna so bad wana hit the delete on all them tiny little steps adding hundreds and hundreds of verts where there should be a 4 vert plane ramp! In fact my guess is there is more power being used to render stairs and steps then anything. Again go ahead and tell me im wrong ! Why make like 40 odd tiny tiny steps when a nicely textured ramp would do. And to boot there is like 7 of these in the court Thats a hell of alot of verts for little or no gain in beauty. Heck why not add on sub surf procedure lol sorry im ranting now. Time to go

Karyuu

  • Forum Legend
  • *
  • Posts: 9341
    • View Profile
Re: Is PNG files used for all graphics/uvmapping?
« Reply #20 on: May 15, 2006, 11:16:24 pm »
Er... is it even possible to use animated .gifs? We certainly don't use any right now, so you won't find any such code from the PS project.

What other games use animated .gifs?
Judge: Are you trying to show contempt for this court, Mr Smith?
Smith: No, My Lord. I am attempting to conceal it.

Yaskina

  • Guest
Re: Is PNG files used for all graphics/uvmapping?
« Reply #21 on: May 15, 2006, 11:50:14 pm »
I do not know of any off hand that are new that use animated gif per say, but I'm positive that there is a way to perhaps swap numbered textures or possibly even use animated gifs. This may or may not be possible with this engine I don't know a single thing about it, other than what i have learned from reading the world and cal files. I should say i do understand programming some what as i have used real basic, visual basic and done some html and java. Having done some work with 3D going all the way back to the first gens i am able to read threw most of these files and make some understanding of what is what. My guess is a few lines of code in that cal3d file will allow it to appear animated, which could be really sweet if npc's and pc's eyes blinked. But I'm only guessing!!

*edit*

Well i ran some 8 bit vs 32bit too see what was happening with the ram. I ran some controlled tests with a probe running. I ran this test a few times to insure that nothing elese was affecting it, and i will run it a few more to insure results. I stood in same place with out moving just loaded into world ( sewer ) and no npc or pc s were visable ( LOS anyways ) with 8 bit textures in the sewers it was about 1.5 megs less in system memory. Which is about what i expected from one single point of view.

 As i run around the map it appears to collect what it needs and add to memory, as every time there is a hickup in framerate my memory usage for the psclient JUMPS a few meg.

Jorrit i know it says your a developer and all but i think you might wana double check on that 8 bit uped to 32bit store reply because i just ran some more tests up against a fresh install and my optimized copy of ps and it is using 22 megs less than the Orginal copy. And thats only scratching the surface, as i have only touched 6 of the zips there is 48 in my build. Maybe it cause im on a mac! but i doubt it very much

On my mac i hit low 300 Plus usage in ram at times


« Last Edit: May 16, 2006, 09:04:21 am by Yaskina »

Wired_Crawler

  • Hydlaa Citizen
  • *
  • Posts: 429
    • View Profile
Re: Is PNG files used for all graphics/uvmapping?
« Reply #22 on: May 16, 2006, 10:21:35 am »
Er... is it even possible to use animated .gifs? We certainly don't use any right now, so you won't find any such code from the PS project.

You can't use animated GIFs in CS. -> About animated images in CS

What other games use animated .gifs?

I'm not sure if they were animated GIFs, but games like Doom, Doom 2, Heretic, Hexen and other 10-15 years old 3d games were using similar techniques. It was at times, when computers had 2-4 MB of RAM and ~200MB hard disks, so 16 color images were commonly used.

Jorrit i know it says your a developer and all but i think you might wana double check on that 8 bit uped to 32bit store reply because...

Jorrit is creator and leading programmer of Crystal Space. Why are You questioning his competences, and at the same time You are getting mad, when someone is questioning Yours ?
"Close the world, txEn eht nepO."

jorrit

  • Developers
  • Hydlaa Citizen
  • *
  • Posts: 497
    • View Profile
Re: Is PNG files used for all graphics/uvmapping?
« Reply #23 on: May 16, 2006, 02:36:46 pm »
Er... is it even possible to use animated .gifs? We certainly don't use any right now, so you won't find any such code from the PS project.

What other games use animated .gifs?

Animated gifs are not supported by CS but CS does support animated images in MNG format. I even believe PS uses a few of those in the death realm.

Greetings,
Project Manager of Crystal Space, CEL, CrystalBlend and Crystal Core. Please support Crystal Space with a donation.

jorrit

  • Developers
  • Hydlaa Citizen
  • *
  • Posts: 497
    • View Profile
Re: Is PNG files used for all graphics/uvmapping?
« Reply #24 on: May 16, 2006, 02:39:55 pm »

Jorrit i know it says your a developer and all but i think you might wana double check on that 8 bit uped to 32bit store reply because i just ran some more tests up against a fresh install and my optimized copy of ps and it is using 22 megs less than the Orginal copy. And thats only scratching the surface, as i have only touched 6 of the zips there is 48 in my build. Maybe it cause im on a mac! but i doubt it very much

How do you measure how much ram is being used on the VIDEO card? You were probably measuring RAM on the computer and that is not relevant in this discussion. As to it needing less memory it is very hard to measure memory usage effectively. You could be right that loading an 8-bit image makes PS use less memory during load time but at runtime it will be the same.

Greetings,
Project Manager of Crystal Space, CEL, CrystalBlend and Crystal Core. Please support Crystal Space with a donation.

jorrit

  • Developers
  • Hydlaa Citizen
  • *
  • Posts: 497
    • View Profile
Re: Is PNG files used for all graphics/uvmapping?
« Reply #25 on: May 16, 2006, 02:41:25 pm »
Er... is it even possible to use animated .gifs? We certainly don't use any right now, so you won't find any such code from the PS project.

You can't use animated GIFs in CS. -> About animated images in CS

But you can use animated MNG's in CS.

Quote
Jorrit is creator and leading programmer of Crystal Space. Why are You questioning his competences, and at the same time You are getting mad, when someone is questioning Yours ?

Well I *do* make mistakes too :-)

Greetings,
Project Manager of Crystal Space, CEL, CrystalBlend and Crystal Core. Please support Crystal Space with a donation.

Yaskina

  • Guest
Re: Is PNG files used for all graphics/uvmapping?
« Reply #26 on: May 16, 2006, 07:23:23 pm »
Wired i can assure you of one thing almost all 3D games, apps, movies etc old and brand new have used animated textures of some sort format does not really matter here. Wired it is very clear to me that your just typing words for the hell of it, My posts are based and research, years of experience and nuts and bolts hands on testing. What are you going to attack next my spelling and grammar. If you don't have anything positive to add like.. here try this..... or i tried that and it did not work.... put the keyboard down!!

This clearly is a development board. You have typed nothing to aid what so ever or add any correct information that could be used to improve the game or my ventures to help. nuff said

Jorrit thanks for the reply kinda stuff I m looking for. Which reminds me i did see 1 mng file in one of the zips. So i will now have some more testing to do thanks a lot!!! lol just joking. I was watching ram, cpu, and system in real time well playing in window mode. Jorrit I am currently under the understanding that textures are loading into ram in the format that they will be transfered to the video card. That said i can tell you that copy of PS that has optimized files used less ram while playing the game, and looked just as good and with a few things cause of my tweaking the image ( via contrast saturation ) even better. I would be more than willing to send you some of the files for the sewer and gui. Send my a pm with your email and i shall email them to you so you can see first hand. I can also send some to Xordan aslo same way :sorcerer: \\o// \\o// \\o// \\o//

Karyuu

  • Forum Legend
  • *
  • Posts: 9341
    • View Profile
Re: Is PNG files used for all graphics/uvmapping?
« Reply #27 on: May 16, 2006, 07:26:06 pm »
Yaskina, can you please post some screenshots here?
« Last Edit: May 16, 2006, 11:28:55 pm by Karyuu »
Judge: Are you trying to show contempt for this court, Mr Smith?
Smith: No, My Lord. I am attempting to conceal it.

Xordan

  • Crystal Space Developer
  • Forum Addict
  • *
  • Posts: 3845
  • For God and the Empire
    • View Profile
Re: Is PNG files used for all graphics/uvmapping?
« Reply #28 on: May 17, 2006, 12:25:39 am »
Ok, did some testing! Everything is the same in each file except for the textures. (Got Yakinas' zips forwarded to me):

As we have now:

Screenshot + memory usage:
http://curry.cirtexhosting.com/~thekcab/normal.JPG

Load times and zip size:
sewers: 3794ms, 8982kb
hysewers: 142ms, 3362kb

Yaskinas':
Screenshot + memory usage:
http://curry.cirtexhosting.com/~thekcab/yask.JPG

Load times and zip size:
sewers: 3837ms, 3963kb
hysewers: 123ms, 1523kb

DDS:
Screenshot + memory usage:
http://curry.cirtexhosting.com/~thekcab/dds.JPG

Load times and zip size:
sewers: 2427ms, 3756kb
hysewers: 120ms, 1363kb

Yaskina

  • Guest
Re: Is PNG files used for all graphics/uvmapping?
« Reply #29 on: May 17, 2006, 02:40:31 am »
Looks good. So are the DDS files 8bit or 32bit
Could you send me a copy of the DDS files for the sewer. I have been trying to get them to work with no luck, but only have one app which has limited support for them. feel free to email me them Id really like to check them out for sure. And its possible i dont have something just right.

I m also wondering if you have the setting load all maps on. Reason i ask is when i load into the sewer my mem sits at 108 8bit and 134 32 bit. i guess im just checking i assume thats they your ram was at almost 350
« Last Edit: May 17, 2006, 02:55:11 am by Yaskina »