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 

Vertex and Texture data through I/O?

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



Joined: 02 Sep 2005
Posts: 29

PostPosted: Tue Oct 04, 2005 5:20 am    Post subject: Vertex and Texture data through I/O? Reply with quote

Hi,

I'm sorry if you read those questions for like the 1000st time but I'm trying to get into PSP dev and couldn't find anything new concerning these:

I've got a compiler toolchain, the PSPSDK and the VS.Net integration running but after looking through some of the examples in the SDK I saw, that there (still) seems to be no way to actually load vertex and texture data from a file or archive and after that swizzle and upload them into VRAM.
So can I forget about loading for example vertex data from a .3DS file or a texture from a .PNG file?
I understand that this is due to the native 16-byte aligned format that is required by the (pspgl in particular) calls to work on full speed. Isn't there a way to load the data from a file and then dynamically align them during runtime. Of course you'd have a slight performance drop but you can do the alignment during load-time (when loading a level or menu), can't you?

Thanks in advance,
ZMaster
Back to top
View user's profile Send private message
ashleydb



Joined: 03 Oct 2005
Posts: 26
Location: USA

PostPosted: Tue Oct 04, 2005 5:23 am    Post subject: Reply with quote

There is nothing to stop you doing that except writing the loaders for those file types. You wouldn't use 3DS... you'd export something from Max, but images could be anything if you write to correct loader.
_________________
www.PSP-Files.com - PSP News, Hacks etc.

www.HiAsh.com - My work and stuff
Back to top
View user's profile Send private message Visit poster's website
ZMaster



Joined: 02 Sep 2005
Posts: 29

PostPosted: Tue Oct 04, 2005 5:36 am    Post subject: Reply with quote

Thank you. I have loaders for those filetypes written for the PC development and would just need to port them over to the PSP.
But what about 16-byte alignment?

Could I just do something like this:
- Allocate an array of vertices: Vector3 *vData = new Vector3[nVertexCnt];
- Fill the array with the items from the file.
- glVertexPointer(3, GL_FLOAT, 0, &(vData.x));
- glDrawArrays(...);

If I had to reformat/realign the data, how'd you do that?
Back to top
View user's profile Send private message
ashleydb



Joined: 03 Oct 2005
Posts: 26
Location: USA

PostPosted: Tue Oct 04, 2005 5:44 am    Post subject: Reply with quote

A quick search of the forum brings up this:

http://forums.ps2dev.org/viewtopic.php?t=3424&highlight=memalign

http://forums.ps2dev.org/viewtopic.php?t=2714&highlight=memalign

This may also be of use (saving and loading PNGs):

http://svn.ps2dev.org/filedetails.php?repname=psp&path=/trunk/libpng/screenshot/main.c&rev=0&sc=0
_________________
www.PSP-Files.com - PSP News, Hacks etc.

www.HiAsh.com - My work and stuff
Back to top
View user's profile Send private message Visit poster's website
ZMaster



Joined: 02 Sep 2005
Posts: 29

PostPosted: Tue Oct 04, 2005 5:57 am    Post subject: Reply with quote

Thanks, you are my God :-)
Back to top
View user's profile Send private message
ashleydb



Joined: 03 Oct 2005
Posts: 26
Location: USA

PostPosted: Tue Oct 04, 2005 6:20 am    Post subject: Reply with quote

Hey, no problem. I'm just starting off coding for PSP myself. I made a Maya -> OpenGL model exporter and loader, so I want to port that to PSP. I'm having texture problems right now, but good luck with yours.
_________________
www.PSP-Files.com - PSP News, Hacks etc.

www.HiAsh.com - My work and stuff
Back to top
View user's profile Send private message Visit poster's website
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