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 

PSP GU <-> PC OpenGL advice

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



Joined: 08 Oct 2005
Posts: 186

PostPosted: Sun Mar 26, 2006 8:53 am    Post subject: PSP GU <-> PC OpenGL advice Reply with quote

Hello,

I'm trying to do a PC implementation of OSLib, but in fact I have to reimplement nearly completely the sceGu.
The problem is, with OpenGL, some things are missing or used differently. For example, color keying (GU_COLOR_TEST), stencil buffer, advanced blending or sceGuDrawBuffer.
Especially, I use stencil as a special mean of writing alpha to the drawbuffer. But I can't find any equivalent with OpenGL (stencil exists, but I think it's not written to the destbuffer alpha, but on the depthbuffer instead, and no way to read it).
I tried with software rendering, but it's really slow (I'm just drawing gouraud-shaded & textured polygons without any state for now and it's already slower than on PSP).

So, I would like some advice, if I should rather head for software or hardware acceleration, and if OpenGL problems & missing things can be corrected or replaced by something equivalent... the goal would mainly be accuracy for testing purposes, but at an acceptable framerate (like 5 fps) else it's unuseful for animation testing.

Thank you in advance ^^
_________________
Sorry for my bad english
Oldschool library for PSP - PC version released
Back to top
View user's profile Send private message
Raphael



Joined: 17 Jan 2006
Posts: 646
Location: Germany

PostPosted: Sun Mar 26, 2006 9:49 am    Post subject: Reply with quote

I don't think it's impossible to achieve what you want with OpenGL, but some things might be tricky to do. I couldn't give you straight solutions though, so some searching on the internet would be required.

Regarding the speed, there's no arguing on whether to use GL or software rendering, but if you really only aim for debugging purpose and even only 5fps is good enough, software rendering should suffice, yet would be more code to write. But that would be something where I could most likely greatly help you, since I wrote some software rendering engines already, which were all pretty fast for their caps (using bilinear filtering, perspective correction and alphablending) and garouded textured polys is something totally basic. If done properly, it should be able to run at 'playable' speed of > 25fps, depending on the complexity of your scenes.
Back to top
View user's profile Send private message Visit poster's website
memon



Joined: 03 Oct 2005
Posts: 63

PostPosted: Mon Mar 27, 2006 12:27 am    Post subject: Reply with quote

If you just want to render to destination alpha, and you are not really using any stencil ops, then you can use glColorMask to block writing to the color channels. I think the PSP equivalent ins sceGuPixelMask (which sounds like it is specific to the current display color mode).

Color keying is something you can easily do in a pixel shader. Since on PC you have the textures lookups to spare maybe a trivial way would be to have 3 1D texture lookups. Some of the other PSP tricks can propably also handled using pixel shaders.

The most annoying might be the color logical ops, opengl supports them only in indexed color mode. It can be done, but a simple thing suddenly gets overly complex :)

Maybe easier way would be to write a wrapper library instead and use only the features that are available on both platforms. You could easily bias the implementation to work optimal on PSP and still get the same performance on PC too.
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