Welcome! Log In Create A New Profile

Advanced

textures+normals+vertexcolor simultaneously?

Posted by copete23 
textures+normals+vertexcolor simultaneously?
July 27, 2011 01:47AM
Hi, I tried to make that the Wii displays a 3d model with textures, normals, and vertex colors, but only get to show the textures and normals, is a limitation of the library?, or am I doing something wrong?
In the examples, is used only the combinations of position + color, or position + texture+ color, so I think that maybe it is not possible to use normals simultaneously.

In the case of that could be used, someone could explain how :) ?

Thanks! ;)
Re: textures+normals+vertexcolor simultaneously?
July 27, 2011 02:16AM
try changing the vertex color or the texture. The texture often hide the color that is below it.
Re: textures+normals+vertexcolor simultaneously?
July 27, 2011 04:06AM
I think I found the problem, the light, I'm using GX_COLOR0A0 in both, in the light and the model, that does not work, but now I don`t know how to use GX_COLOR1A1 for the model at the same time that GX_COLOR0A0 xD



Edited 1 time(s). Last edit at 07/27/2011 04:07AM by copete23.
Re: textures+normals+vertexcolor simultaneously?
July 27, 2011 05:17AM
I have no idea how the lights work, I'm using the grrlib framework with no lights. So I cannot help with that.
Re: textures+normals+vertexcolor simultaneously?
July 28, 2011 12:16AM
Same thing here with lighting, if I turn lights of it works, but that kind of defeats the whole point of having the normals.
This code with lighting does not show the GX_VA_CLR0 part.

// later on each call to a vertex attribute must match the order: Position, normal, color, texcoord. 
GX_SetVtxAttrFmt (GX_VTXFMT4, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);   
GX_SetVtxAttrFmt (GX_VTXFMT4, GX_VA_NRM, GX_NRM_XYZ, GX_F32, 0);
GX_SetVtxAttrFmt (GX_VTXFMT4, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
GX_SetVtxAttrFmt (GX_VTXFMT4, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);

                GX_LoadTexObj(&m_HardwareTextureInfo, GX_TEXMAP0);   

	GX_SetNumTexGens(1);
	GX_SetTevOp(GX_TEVSTAGE0,GX_MODULATE);
	GX_SetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);

	GX_ClearVtxDesc();
	GX_SetVtxDesc(GX_VA_POS, GX_DIRECT);
	GX_SetVtxDesc(GX_VA_NRM, GX_DIRECT);
	GX_SetVtxDesc (GX_VA_TEX0,GX_DIRECT);
	GX_SetVtxDesc(GX_VA_CLR0, GX_DIRECT);

	GX_Begin(GX_QUADS, GX_VTXFMT4,4);
                ...
                ...
	GX_End();
Sorry, only registered users may post in this forum.

Click here to login