Vertex Attribute Table November 25, 2010 10:31PM | Registered: 14 years ago Posts: 118 |
GX_SetVtxDesc(GX_VA_POS, GX_DIRECT); GX_SetVtxDesc(GX_VA_NRM, GX_DIRECT); GX_SetVtxDesc(GX_VA_CLR0, GX_DIRECT); // Vertex Attribute 0 GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_NRM_XYZ, GX_F32, 0); GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0); // Vertex Attribute 1 GX_SetVtxAttrFmt(GX_VTXFMT1, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); GX_SetVtxAttrFmt(GX_VTXFMT1, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
// Only colors GX_Begin(GX_QUADS, GX_VTXFMT1, 4); GX_Position3f32(0, 0, 0); GX_Color4u8(0xff, 0x00, 0x00, 0xff); GX_Position3f32(1, 2, 0); GX_Color4u8(0xff, 0xff, 0xff, 0xff); GX_Position3f32(1, 1, 0); GX_Color4u8(0x00, 0xff, 0x00, 0xff); GX_Position3f32(2, 1, 0); GX_Color4u8(0xff, 0xff, 0xff, 0xff); GX_End(); //... // Colors and normals GX_Begin(GX_QUADS, GX_VTXFMT0, 4); GX_Position3f32(5, 5, 0); GX_Normal3f32(0, 1, 0); GX_Color4u8(0xff, 0x00, 0x00, 0xff); GX_Position3f32(8, 7, 0); GX_Normal3f32(0, 0, 0); GX_Color4u8(0xff, 0xff, 0xff, 0xff); GX_Position3f32(7, 7, 0); GX_Normal3f32(1, 0, 0); GX_Color4u8(0x00, 0xff, 0x00, 0xff); GX_Position3f32(7, 8, 0); GX_Normal3f32(1, 1, 0); GX_Color4u8(0xff, 0xff, 0xff, 0xff); GX_End();
Re: Vertex Attribute Table November 25, 2010 11:08PM | Moderator Registered: 15 years ago Posts: 703 |
GX_ClearVtxDesc( ); GX_SetVtxDesc(GX_VA_POS, GX_DIRECT); GX_SetVtxDesc(GX_VA_CLR0, GX_DIRECT); GX_Begin(GX_QUADS, GX_VTXFMT1, 4); GX_Position3f32(0, 0, 0); GX_Color4u8(0xff, 0x00, 0x00, 0xff); GX_Position3f32(1, 2, 0); GX_Color4u8(0xff, 0xff, 0xff, 0xff); GX_Position3f32(1, 1, 0); GX_Color4u8(0x00, 0xff, 0x00, 0xff); GX_Position3f32(2, 1, 0); GX_Color4u8(0xff, 0xff, 0xff, 0xff); GX_End(); GX_ClearVtxDesc( ); GX_SetVtxDesc(GX_VA_POS, GX_DIRECT); GX_SetVtxDesc(GX_VA_NRM, GX_DIRECT); GX_SetVtxDesc(GX_VA_CLR0, GX_DIRECT); GX_Begin(GX_QUADS, GX_VTXFMT0, 4); GX_Position3f32(5, 5, 0); GX_Normal3f32(0, 1, 0); GX_Color4u8(0xff, 0x00, 0x00, 0xff); GX_Position3f32(8, 7, 0); GX_Normal3f32(0, 0, 0); GX_Color4u8(0xff, 0xff, 0xff, 0xff); GX_Position3f32(7, 7, 0); GX_Normal3f32(1, 0, 0); GX_Color4u8(0x00, 0xff, 0x00, 0xff); GX_Position3f32(7, 8, 0); GX_Normal3f32(1, 1, 0); GX_Color4u8(0xff, 0xff, 0xff, 0xff); GX_End();
Re: Vertex Attribute Table November 26, 2010 12:30AM | Registered: 14 years ago Posts: 118 |
Re: Vertex Attribute Table November 26, 2010 12:33AM | Moderator Registered: 15 years ago Posts: 703 |
Re: Vertex Attribute Table November 27, 2010 07:07PM | Registered: 14 years ago Posts: 686 |
Re: Vertex Attribute Table November 28, 2010 12:35AM | Registered: 14 years ago Posts: 118 |
Re: Vertex Attribute Table December 02, 2010 08:51AM | Registered: 15 years ago Posts: 62 |