Page 1 of 1

VRAM and Textures

Posted: Thu May 10, 2007 11:08 am
by radad
I am working on a 2d app with the basic setup having a backrgound image and a few icons and a font and I am quickly running out of VRAM. What are some useful strategies in dealing with this?

The most obvious one it to reduce the textures in size and colour depth but what would look acceptable on a TV.

Another idea is to load and unload the textures between VRAM and EE RAM as they are needed. Is it feasible to do this all within one frame?

Any other ideas?

Posted: Thu May 10, 2007 7:37 pm
by ps2devman
Yes you can rearrange vram within a single frame.
All you need is a way to survey the time you lose doing things, so you can define your own global strategy.

Personally, in "gsKit+vulib starter kit Initial Fantasy", I try to measure time very precisely and I display an horizontal bar on screen that represents the time interval assuming full width of screen is the total time of a frame at 60fps.

I guess you could draw colored segments in the horizontal bar representing the different parts of your process.

You also have to be carefull that your micro code using the texture starts when the VRAM updates are really finished.

In "gsKit starter Kit Q*Bert" I'm uploading again in VRAM the colored platforms (swapping colors to have them look rotating) and cubes (at beginning of new levels). I discovered that if a texture was displayed just before I attempted to update the texture it was using, the update didn't work (without error message or crash). So I just made sure to display another texture before trying to upload these ones again. My feeling is that there are some "lock" mecanisms a bit hidden or unknown... So, don't fall in that specific trap...

Also in Q*Bert textures are smaller in VRAM than on screen. I magnifiy them (x2) either strictly or with a filtering mode (game allows to toggle between these two modes). Note that you absolutely need to use Jbit's magical formula if you want a good result (offsets to add in position and size in the texture rendering call).