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 

UV Coordinate Issue

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



Joined: 05 May 2005
Posts: 66

PostPosted: Sun Jul 31, 2005 2:35 pm    Post subject: UV Coordinate Issue Reply with quote

is there anything special with GU_TEXTURE_32BITF, whenever I add that and add UV's my model looks all weird.

My vertex buffer contains (in this order)
UVs 2 floats (8 bytes)
VERTS 3 floats (12 bytes)

Everything renders fine without UV's added, but then its all white, but when I add the GU_TEXTURE_32BITF and add my uv's to the vertex buffer weird stuff happens. Am I missing something obvious?


I am calling drawarray like this:

sceGuDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_INDEX_16BIT|GU_TRANSFORM_3D,count,&m_PSPIndexBuffer[0],&m_PSPBuffer[0]);

Thanks alot
Jeff
Back to top
View user's profile Send private message
71M



Joined: 21 Jun 2005
Posts: 122
Location: London

PostPosted: Mon Aug 01, 2005 6:10 am    Post subject: Re: UV Coordinate Issue Reply with quote

webjeff wrote:
is there anything special with GU_TEXTURE_32BITF, whenever I add that and add UV's my model looks all weird.

My vertex buffer contains (in this order)
UVs 2 floats (8 bytes)
VERTS 3 floats (12 bytes)

Everything renders fine without UV's added, but then its all white, but when I add the GU_TEXTURE_32BITF and add my uv's to the vertex buffer weird stuff happens. Am I missing something obvious?


I am calling drawarray like this:

sceGuDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_VERTEX_32BITF|GU_INDEX_16BIT|GU_TRANSFORM_3D,count,&m_PSPIndexBuffer[0],&m_PSPBuffer[0]);

Thanks alot
Jeff


Have you tried padding your vertex structure to 32 bytes?
This is written in the docs next to the definition of sceGuDrawArray -
"NOTE: Every vertex must align to 32 bits, which means that you HAVE to pad if it does not add up!"

Hope that solves your problem...

71M
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Mon Aug 01, 2005 6:48 am    Post subject: Reply with quote

bits != bytes.

And if he's already using floats for everything, it's already aligned. It's when you start using the 8- and 16-bit types you have to deal with it.

And it's nothing special about the uv-coordinates, except perhaps that without them, you might see some kind of result, and with them in the vertex-buffer, you get proper coordinates, but you've setup the parameters incorrectly? Look at the samples, there are a few that uses textures, it shouldn't be too complex to find your error.
_________________
GE Dominator
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