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 

2D/3D Graphics Speed

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



Joined: 27 Jul 2005
Posts: 46

PostPosted: Sat Oct 22, 2005 5:33 am    Post subject: 2D/3D Graphics Speed Reply with quote

I have run into a wall using SDL for graphics development. Currently, I setup my video mode to use 16 bits per pixel, and double buffering. I convert all of my input images to the display format to speed things up. Using Hardware or software memory for my video mode does not seem to make a difference in performance. Psp SDL does not seem to support creating SDL_Surfaces in video memory, so that is a moot point. Point being, I think I have the images and video mode setup such that it is rending things as fast as SDL will allow.

I draw my complete background to the screen each loop though. Then I draw my sprites atop it. So when I draw 1.25 or so full screen per loop, the game speed is great. When I draw 1.5 to 2 full screens of graphics per loop, the game speed decreases noticeably. My question is as follows:

Will I get a speed increase in blitting images to the screen if I use pspGL or even the sce GU functions to render my graphics? I have done some research, and it seems possible to apply your image data to a polygon as a texture, thus allowing you to draw 2D images using the GU functions. Would this be faster?

Bear in mind all I am doing right now is basically calling the SDL_BlitImage function. I pass it the image I want to draw, and the pointer to my display. Nothing fancy or overly tricky, but I figure the PSP should be able to handle at least 2 full frames of data being copied to the video buffer in 1 loop without slowing down. Would using 3D representations of my graphics and the GU help me accomplish this speed?

I assume I would just create the 3D representations of my graphics, and blit them to the video buffer using the SCE GU function. I am not currently doing rotations, scaling, or alpha blending. I do a little blitting with some images that use a transparent pixel color, but I don’t think that is really what’s slowing things down so much. Mostly I just do basic blitting to the back buffer. What do you think? Will I get a speed increase given this scenario?

Garak
Back to top
View user's profile Send private message Send e-mail AIM Address
Brunni



Joined: 08 Oct 2005
Posts: 186

PostPosted: Sat Oct 22, 2005 6:11 am    Post subject: Reply with quote

The fact is - in my opinion - SDL is really far from the way any system handles graphics. Then it's normal, optimizations are really hard to do.
In my opinion, if you really have speed problems, you should give up SDL or anything non-native (except if really optimized) and work directly with PSP hardware (what it's done for), or write yourself SDL-like functions that wraps to the PSP hardware, so that the transition is smooth. With a native interface, you will effectively gain a lot speed, especially in 2D.
I don't know what kind of gfx your game consists of, anyways, drawing a tilemap or a large sprite list with SDL is the best thing to kill completely your app speed.
And as you said, always use the same bit-depth for any image and the backbuffer. SDL implicitly does color conversion, which is already slow on a 3 GHz Pentium IV-based computer, so don't expect much of your 222 MHz PSP ^^ (however if you write yourself optimized color conversion, like 8-bit to 16-bit, it will run sweet).
_________________
Sorry for my bad english
Oldschool library for PSP - PC version released
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 -> PSP 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