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 

Minimum Vertex size

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



Joined: 19 Sep 2005
Posts: 75

PostPosted: Tue Apr 11, 2006 9:09 am    Post subject: Minimum Vertex size Reply with quote

Has anyone noticed that there appears to be a minimum vertex size?

GU_TEXTURE_16BIT|GU_VERTEX_16BIT|GU_TRANSFORM_3D
Does not seem to work for me, but:

GU_TEXTURE_16BIT|GU_COLOR_5551|GU_VERTEX_16BIT|GU_TRANSFORM_3D
does work.

I have made sure my padding is correct for both cases. Has anyone else seen this or is it just me?
Back to top
View user's profile Send private message
white rabbit



Joined: 06 Jul 2005
Posts: 60

PostPosted: Tue Apr 11, 2006 6:00 pm    Post subject: Reply with quote

I thought the 'optimal' was 8-12 bytes (here : http://forums.ps2dev.org/viewtopic.php?t=3506 but I know you knew that already).

Not seen an issue with a minimum size though. I have had
Code:
GU_VERTEX_16BIT|GU_TRANSFORM_3D
work fine for me, and even
Code:
GU_VERTEX_8BIT|GU_TRANSFORM_3D


Perhaps it has something to do with the inclusion of the texture fields?
Back to top
View user's profile Send private message
memon



Joined: 03 Oct 2005
Posts: 63

PostPosted: Tue Apr 11, 2006 6:04 pm    Post subject: Reply with quote

I ran into the same problem too. I had to specify the color or otherwise there was nothing drawn at all. Maybe the GU_TRANSFORM_3D requires a normal or color set to work correctly? I think I did not try position only data. My SDK is quite old too, maybe something has changed.
Back to top
View user's profile Send private message
white rabbit



Joined: 06 Jul 2005
Posts: 60

PostPosted: Thu Apr 13, 2006 11:29 pm    Post subject: Reply with quote

Bumped...

Any joy fixing this?
Back to top
View user's profile Send private message
subbie



Joined: 05 May 2005
Posts: 122

PostPosted: Thu Apr 13, 2006 11:46 pm    Post subject: Reply with quote

Have you maybe tried specifiying a defualt color via sceGuColor( 32bit color ); ?
Back to top
View user's profile Send private message
starman2049



Joined: 19 Sep 2005
Posts: 75

PostPosted: Fri Apr 14, 2006 10:17 am    Post subject: Reply with quote

Yes, that is set in my loop. The problem is not that it draws it with the wrong color, but rather it just draws "all messed up" if I only send UV(16b), XYZ(16b). I am ok becasue I just send along color and it is just a little slower.

This may seem like a tiny detail, but I am fighting to get to 60 fps. Coming into the Game Developers Conference I was running at 32 fps, and since then I have been able to scratch and claw my way to 51 fps so every single bit and byte is important. Unfortuanty with vsync on 51 fps looks just like 30 fps :(

Thanks for the suggestion anyway
Back to top
View user's profile Send private message
zoret



Joined: 19 Mar 2006
Posts: 22

PostPosted: Sat Apr 15, 2006 8:30 am    Post subject: Reply with quote

hi starman

that's interesting the good fps you obtain
how many vertices can you display ?
are you using pre generetad command list ?

thanks
Back to top
View user's profile Send private message Send e-mail
starman2049



Joined: 19 Sep 2005
Posts: 75

PostPosted: Sat Apr 15, 2006 9:29 am    Post subject: Reply with quote

This is around 15k triangles and 20+ textures, plus a skin animated character that is around 2000 triangles. I export my geometry from 3DStudioMax as pre-formated vertex arrays so all I do is point to the list in memory and call drawArray().

I am using triangles, not triangle strips and I am starting to think that I will need to convert to triangle strips in order to get to the next level. It's not rocket science, but it sure is much easier to just emit a list of triangles :)
Back to top
View user's profile Send private message
zoret



Joined: 19 Mar 2006
Posts: 22

PostPosted: Sat Apr 15, 2006 10:02 am    Post subject: Reply with quote

excellent !
i'm very far of your perf ! but like you i read my own format directly pre formated from my maya tool importer

see my post where i try to optimise a very simple cube modified sample
http://forums.ps2dev.org/viewtopic.php?t=5469

do you see anything bad in this code ??

thanks in advance !!

[/url]
Back to top
View user's profile Send private message Send e-mail
white rabbit



Joined: 06 Jul 2005
Posts: 60

PostPosted: Mon Apr 17, 2006 2:01 am    Post subject: Reply with quote

starman2049 wrote:
This is around 15k triangles and 20+ textures, plus a skin animated character that is around 2000 triangles. I export my geometry from 3DStudioMax as pre-formated vertex arrays so all I do is point to the list in memory and call drawArray().

I am using triangles, not triangle strips and I am starting to think that I will need to convert to triangle strips in order to get to the next level. It's not rocket science, but it sure is much easier to just emit a list of triangles :)


Not sure if you do it already (I'm pretty sure you would have at least tried, so I'm not trying to teach you to suck eggs or anything), but have you tried using a verticies index array? That way the memory footprint can be much lower, but I'm not sure of the impact on the speed/fps. (If you have, I'd like to know what kind of effect it had).

Does your 3DSMax exporter allow for another array export for a verticies index array? At the moment I use code to import from the 3ds format, rather than using an exporter from 3DSMax... I will have to re-think that as your way sounds much better, even if I use a seperate off-line conversion step to just translate the files to reduce load time.

Good luck at GDC. Where will you be for the most time? I will hopefully be able to get a glance at your game (all depends on my house move if I get to go or not this year).

EDIT - Ah! I just realised you mean a different GDC to me. I go to one in Europe, not the US. As I re-read the thread I realsied you'd already been and got quite confused!


Last edited by white rabbit on Wed Apr 19, 2006 6:04 pm; edited 1 time in total
Back to top
View user's profile Send private message
starman2049



Joined: 19 Sep 2005
Posts: 75

PostPosted: Mon Apr 17, 2006 4:06 am    Post subject: Reply with quote

I haven't tried indexed vertex arrays. I didn't consider that, I remember reading somewhere on the forums (I think it was CHP) that this was slower.

Anyway I found a HUGE boost. I switched from 32bit draw/render/zbuffer to 16 bit and now I have a ton more memory so I can preload all my textures into VRAM at level init. Now I am running at 82 fps!! I was worried about the look with 16 bit rendering, but with a good dither matrix the smaller resolution on the PSP, and the LCD display I can barely tell a difference. Booyah!!

This may or may not work for you depending on your game, but in my game I make heavy use of organic textures and it seems to work nicely!!

BTW, my exporter chain exports direclty to binary vertex arrays that are loaded into memalign() memory and referenced directly with DrawArray() - all of my processing is off-line. Of course things like particle effetcs, skin animated characters, and HUD are done at runtime.
Back to top
View user's profile Send private message
white rabbit



Joined: 06 Jul 2005
Posts: 60

PostPosted: Tue Apr 18, 2006 9:06 pm    Post subject: Reply with quote

Wowzers! That's a big increase! I've genreally err'ed away from using the 16 bit buffers (except for z which I found is ok) for the quality I thought they would give.
Looks like I will have to re-think that if it makes that amount of difference.

What pixel-packing format do you use? I always find I have problems with 5650 / 5551 as I get confused over what I'm putting in - maybe I should just use a couple of macros to sort it out for me.

Glad you've got it running so fast!
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