Strange issue with triangle drawing

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

Moderators: cheriff, TyRaNiD

Post Reply
AudioMonster
Posts: 37
Joined: Wed Sep 07, 2005 3:41 am
Contact:

Strange issue with triangle drawing

Post by AudioMonster »

I am drawing a simple triangle using the vertex :

struct Vertex2D
{
unsigned int color;
short x,y,z;
short _pad; // for padding, 32bits
};


rendering with :

sceGuDrawArray(GU_TRIANGLES,
GU_COLOR_8888 |
GU_VERTEX_16BIT |
GU_TRANSFORM_2D,
3,0,vertices);

If i am not explicitely initializing _pad with 0 then i have a very odd result ( the gouraud interpolation seems to fail too and do a crazy thing ).
What is the GU doing with that pad element ???
User avatar
Saotome
Posts: 182
Joined: Sat Apr 03, 2004 3:45 am

Post by Saotome »

I'm not really sure, but most triangle issues, where triangles don't show up as expected, are actualy cache issues.
Like here for example.

And _pad is for padding, so that all elements of the array are 32bit aligned.
infj
Post Reply