 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
webjeff
Joined: 05 May 2005 Posts: 66
|
Posted: Sun Jul 31, 2005 2:35 pm Post subject: UV Coordinate Issue |
|
|
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 |
|
 |
71M
Joined: 21 Jun 2005 Posts: 122 Location: London
|
Posted: Mon Aug 01, 2005 6:10 am Post subject: Re: UV Coordinate Issue |
|
|
| 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 |
|
 |
chp
Joined: 23 Jun 2004 Posts: 313
|
Posted: Mon Aug 01, 2005 6:48 am Post subject: |
|
|
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 |
|
 |
|
|
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
|