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
UV Coordinate Issue
Re: UV Coordinate Issue
Have you tried padding your vertex structure to 32 bytes?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
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
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.
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