forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

VRAM and Textures

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
radad



Joined: 19 May 2004
Posts: 246
Location: Melbourne, Australia

PostPosted: Thu May 10, 2007 11:08 am    Post subject: VRAM and Textures Reply with quote

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?
Back to top
View user's profile Send private message
ps2devman



Joined: 09 Oct 2006
Posts: 265

PostPosted: Thu May 10, 2007 7:37 pm    Post subject: Reply with quote

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).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group