PDA

View Full Version : OpenGL(ES)...texture and vertex colors?



sourcerer
01-23-2009, 11:56 AM
Hi,
This one has me a bit puzzled. I set up the arrays to get textured quad with vertex colors blended in but I can't get it to work.

Colored vertices without texture - works.
Textured - works.

Both - no go.

I tried glEndable(GL_COLOR_MATERIAL) hoping that would do it, but no luck.
I do bind the color array.

Is there something I need to do to get it to work?

Any hints appreciated.

Kaj

sourcerer
01-23-2009, 10:56 PM
Hmmm...maybe I should rephrase - the first message was a tad chaotic.

Basically I am just trying to render a triangle, textured, however with vertex colors blended in.
I have done it with shaders, I have done it on the PSP but can't seem to get it working in openGL ES.

Surely it can be done without combiners? I mean...any lighting code does it implicitly.

I searched but no tutorial mentions it....they go straight into lighting when they're done discussing a textured primitive.

Kaj :o\

ZbuffeR
01-24-2009, 01:22 AM
Is there anything like the modulate texture blend mode in ES ?

sourcerer
01-24-2009, 01:35 AM
If you mean:
glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MO DULATE);

Then yes...I have it there.

As for the blend function, I am using alpha blending so that is:
glEnable(GL_BLEND);
glBlendFunc(GL_ONE,GL_ONE_MINUS_SRC_ALPHA);

For some reason it doesn't multiply in my vertex colors....puzzling.

Kaj

sourcerer
01-24-2009, 03:01 AM
Ugh....it did work, but due to some stupidity it didn't show. I had a texture with only greens in it (no R or B) and the vertex colors had R and B, and since it's multiplicative....ah well, you get the idea :o\