PDA

View Full Version : Strange Problem with vertex arrayss



unreal
11-22-2004, 07:16 AM
I am getting lost...

can you tell me the difference between this two codes? One is with vertex array and the other is without vertex array.

http://rafb.net/paste/results/JeK0ZU11.html

The shader has this parameters:

fragment shader:

PARAM light0color = state.light[0].diffuse;
PARAM ambient = state.lightmodel.ambient;
PARAM light0atten = state.light[0].attenuation;

vertex shader:

PARAM mvi[4] = {state.matrix.modelview.inverse};
PARAM mvit[4] = {state.matrix.modelview.invtrans};
PARAM mvp[4] = {state.matrix.mvp};

ATTRIB tangent = vertex.texcoord[1];
ATTRIB binormal = vertex.texcoord[2];
ATTRIB normal = vertex.normal;

thsi is the code with the parameters only. not all the code.

The problem i have is at lighting. using vertex arrays is not correct.

any idea what is wrong?
thanks in advance!

Twixn
11-22-2004, 11:52 AM
Well, by looking at ur code i noticed u didn't enable the 'GL_TEXTURE_COORD_ARRAY' client state for each Tex Unit...Give that a try, Insert it after each 'glActiveTextureARB()' call.

Twixn

unreal
11-22-2004, 10:20 PM
hey man! thats it!I didnt knew that I must enable the 'GL_TEXTURE_COORD_ARRAY' for all the texture units. thank you