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 

pspGL questions (Clipping/Render to Texture)

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



Joined: 26 Jun 2006
Posts: 275

PostPosted: Sun Jul 23, 2006 1:54 am    Post subject: pspGL questions (Clipping/Render to Texture) Reply with quote

Hi,

What's the fastest method of rendering in pspgl? I've not browsed through the source yet, but I'm assuming vertex arrays? Or does it feature an implentation of vertexbuffer objects? (And if so, are they emulated?)

Reason I ask is cos atm I'm using the highest level rendering possible, tris within glBegin/GlEnd and even on a pretty small model that flies on my pc engine (Whcih is 95% identical code ) crawls the psp.

My main question is though, is it better in the long run to write my rendering code using direct gu? I.e are there much fatest ways of rendering not possible with pspgl? (I'm going to assume yes unless told otherwise, given the great look of some psp games)


Last edited by Kojima on Sun Jul 23, 2006 9:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
Kojima



Joined: 26 Jun 2006
Posts: 275

PostPosted: Sun Jul 23, 2006 3:28 am    Post subject: Reply with quote

Ah it's not quite as slow as first expected, I had debug output going to a file every frame, removing that speed it up to a reasonable level, but there's another problem now, clipping. It's a simple room made in Maplet, so I have no control over tri distribution so I'm just wondering if there's anyway of disabling automatic tri clipping/culling etc? Or do I have to subdivide my mesh?
Atm whole areas of the room are culled when the vertices of a tri go off-screen.
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Sun Jul 23, 2006 8:54 am    Post subject: Reply with quote

Subdivision is the only way mate, without disabling the clipping.
Back to top
View user's profile Send private message
Kojima



Joined: 26 Jun 2006
Posts: 275

PostPosted: Sun Jul 23, 2006 9:30 pm    Post subject: Reply with quote

How would I go about disabling clipping? I'll be using my own frustrum culling on dynamic entities so it's not very important, it may even slow things down depending on how the clipping is done(I.e software or hardware) since it's done on every vertex.

Would it be the GL equilivent of disabling clipping(Not even sure if there is one, never had this problem on a pc)? or do I disable culling with glDisable(GL_CULL_FACE)?
Back to top
View user's profile Send private message
Kojima



Joined: 26 Jun 2006
Posts: 275

PostPosted: Sun Jul 23, 2006 9:40 pm    Post subject: Reply with quote

Was also wondering, since it's possible to render directly to a texture using gu (So I read from a thread. Not sure if he was using some code to manually copy a framebuffer render to a texture or not) is it possible in PspGL? I've skimmed through the functions and never saw anything specific to pspgl, but I'd imagine if it's possible in gu, and since pspgl just calls gu funcs anyway, I could add the functionality to pspgl myself? If so, anyone know of a good render to texture example using gu?
Thanks.
Back to top
View user's profile Send private message
Kojima



Joined: 26 Jun 2006
Posts: 275

PostPosted: Sun Jul 23, 2006 11:30 pm    Post subject: Reply with quote

I had a look through the gu header and found the only thing related to clipping state was GU_CLIPPING_PLANES
but when I added,

sceGuDisable( GU_CLIP_PLANES );

to my code right before the main loop, it crashed. Any ideas why?
Back to top
View user's profile Send private message
Raphael



Joined: 17 Jan 2006
Posts: 646
Location: Germany

PostPosted: Sun Jul 23, 2006 11:50 pm    Post subject: Reply with quote

Kojima wrote:
Was also wondering, since it's possible to render directly to a texture using gu (So I read from a thread. Not sure if he was using some code to manually copy a framebuffer render to a texture or not)

I suppose you refer to my latest thread where I wanted to render to a 512x512 texture.
Well, it's pretty easy on GU. Just call sceGuSetDrawBufferList with the address of your offscreen texture and you're ready.
About PSPGL I can't tell you, but I suppose it should work if you just insert that one gu function. You need to call the function again and set it to your framebuffer if you want to render to screen again.

Kojima wrote:
I had a look through the gu header and found the only thing related to clipping state was GU_CLIPPING_PLANES
but when I added,

sceGuDisable( GU_CLIP_PLANES );

to my code right before the main loop, it crashed. Any ideas why?

I think it crashes because your code turns up to draw outside the screen then. Have you enabled scissoring? Probably you need to turn up with your own frustum-clipping code.
Back to top
View user's profile Send private message Visit poster's website
Kojima



Joined: 26 Jun 2006
Posts: 275

PostPosted: Mon Jul 24, 2006 3:11 am    Post subject: Reply with quote

Ah so with clipping disabled you have to do your own to prevent it crashing?
Isn't there no way of just rendering off screen or is it a physical limitation of the hardware/gpu?
Frustrum culling can easily be added but I don't like the idea of having to manually clip everything.

Shouldn't be a problem for the game we're doing though, so may not come up.
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