Vertex and Texture data through I/O?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
ZMaster
Posts: 29
Joined: Fri Sep 02, 2005 10:14 pm

Vertex and Texture data through I/O?

Post by ZMaster »

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
ashleydb
Posts: 26
Joined: Mon Oct 03, 2005 2:06 am
Location: USA
Contact:

Post by ashleydb »

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
ZMaster
Posts: 29
Joined: Fri Sep 02, 2005 10:14 pm

Post by ZMaster »

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?
ashleydb
Posts: 26
Joined: Mon Oct 03, 2005 2:06 am
Location: USA
Contact:

Post by ashleydb »

www.PSP-Files.com - PSP News, Hacks etc.

www.HiAsh.com - My work and stuff
ZMaster
Posts: 29
Joined: Fri Sep 02, 2005 10:14 pm

Post by ZMaster »

Thanks, you are my God :-)
ashleydb
Posts: 26
Joined: Mon Oct 03, 2005 2:06 am
Location: USA
Contact:

Post by ashleydb »

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
Post Reply