Page 1 of 1

Loading resources..

PostPosted: Sep 18, 2009 @ 7:05pm
by RapchikProgrammer
Hey, i am trying to load resources using edgelib and all in game and menu resources are working fine.. but before the menu, im loading up some really heavy images of a full screen animation with each frame 320x240 or 640x480 according to the mobile res.. firslty is there any better way to load such animations then an animation strip using edgelib? secondly, when loading these animations the progress bar loads up like 5 of the 6 images and the load function of my game is then exited and restarted after which it continues and loads fully.. i think its getting out of space first and then falling back to some other method.. can you tell what this other method is so that i can set it from the beginning and avoid the user from having to wait for two load ups..

PostPosted: Sep 24, 2009 @ 10:06am
by edge
Hi,

For a fullscreen animation with seperate images (video?) I recommend a different approach:
- Store your images seperately, each screen is a seperate image (for example, frame000.png, frame001.png, etc.)
- Save a list of images in a package, use PackContainFiles to determine how many frames you have
- Use streaming, keep only one image in memory. Load the image matching the current frame (don't load it when it's already loaded)
- To increase package access speed, use PackBuildIndex

PostPosted: Sep 24, 2009 @ 7:08pm
by RapchikProgrammer
I tried using videos, but our project is cross platform so it very hardwork to play the videos on all platforsm.. secondly videos degrade the quality a lot and take a lot of space if you try to keep quality..

i tried using packs.. our game is also on htc touch diamond, and as a stress test i tried it there first at the 640x480 res.. but the animation is very slow.. its really jaggy, as after rendering one frame it goes off to take another which takes up a lot of time.. and i am using a build index..

PostPosted: Sep 28, 2009 @ 8:16am
by edge
Hi,

Please try to store the images as loose files as well, do you notice a speed difference between using packages and loose files?

The bottleneck could either be the surface loading or file reading. In some cases, storing less bytes on disk and using more processor power (for example, to decompress) can be faster.

Can you tell me if you're loading your images from an SD card (those are generally slower)?

PostPosted: Sep 28, 2009 @ 7:54pm
by RapchikProgrammer
I tried loose files at first but then it stuck after each frame, to load the next one.. very inefficient.. its better than that but still very jerky.. i am using htc touch diamonds device storage which should be faster.. and i am using jpegs, suggest any other format? but space is an issue as well so pngs just dont cut it for full res frames..

PostPosted: Sep 30, 2009 @ 11:07am
by edge
Hi,

JPEG files can take time to decode. If space wasn't an issue I would suggest using PNG's or BMP's compressed in a package file. Perhaps you could disable compression when adding the JPEG files to the package (if you haven't done so already)?

Alternatively you may want to create a file format yourself by saving just the raw data in the right colordepth. For Windows Mobile you could store each pixel as 2 bytes and directly load it into a surface (by locking surface data and reading file data to it).

If you're targetting OpenGL ES, perhaps you can use compressed textures (PVRTC), these are only supported on PowerVR hardware.

PostPosted: Oct 1, 2009 @ 6:06am
by RapchikProgrammer
I tried pngs too, they also become time consuming and are impractical because one animation of 43 frames of 640x480 goes to round 12.8mb.. and i am not using opengl.. i had to remove all full screen animations and go with static images for my current project due to time constraints, if u have a better way of loading full screen animation please let me know here or mail me at:

umar.nizamani <at> hotmail <dot> com

PostPosted: Dec 16, 2009 @ 3:54pm
by Namal
Hi,

I dig up this subject to get some information on PVRTC textures which you advice on using here (wherever those are supported, eg on iPhone OS if I am not wrong).

How do you use those in EdgeLib ? I think one needs to register the Loader in edgemain.h, since it's described as disabled in the ChangeLog, but whet's next ?

Also, I read somewhere that we should prefer using 1024x1024 patchworks of textures and blit from them than (for example) 4 textures of 512x512, is that right in your experience ?

Thanks,

Philippe

PostPosted: Dec 21, 2009 @ 1:25pm
by edge
Hi Namal,

Registering the loader should be enough, the CreateSurface function will pick up this file format automatically (like it does for PNG for example). After the surface has been created, upload it to OpenGL afterwards.

The big difference between PVRTC and normal surfaces is that you can't access pixel data of PVRTC surfaces directly.

PostPosted: Jan 12, 2010 @ 10:30am
by Namal

PostPosted: Jan 12, 2010 @ 4:40pm
by edge
Hi Namal,

Hmm, that's not right. Can you tell me which EDGELIB release and platform (library) you're using?

PostPosted: Jan 12, 2010 @ 4:47pm
by Namal
Hey,
Thanks for the quick answer.

Edge is 3.97 (we will licence in a few weeks and be able get 3.98).
I tried to build for iphone-Simulator Debug and iphone Release with same error.

Best,

PostPosted: Jan 21, 2010 @ 1:22pm
by edge
Hi,

Thanks for testing, we will fix this issue in the upcoming EDGELIB release.

PostPosted: Jan 21, 2010 @ 1:25pm
by Namal
Hi,

Any hint on when will this release be coming, we are a bit tight on schedule, and would like to either be able to decide on waiting or taking counter-measures. Is this already fixed in the 3.98 ?

Best,

PostPosted: Jan 21, 2010 @ 3:48pm
by edge
Hi Namal,

A new hotfix will be created very soon, unfortunately it's not in version 3.98 yet.