これが私の問題です。GL_TRIANGLE_STRIP を使用してボックスを描画しています。テクスチャ、マテリアル、シェーダーは関係ありません。色付きの三角形をレンダリングしているだけです。
ここでどのように見えるかを見ることができます:失敗ボックス
しかし、ご覧のとおり、明確な色あせの問題があります。照明も点灯していません。
ボックスの初期化とレンダリングに使用するコードを次に示します。
//here init code
for(list<Particle*>::iterator p = this->shapes[this->activeShape].particles.begin();
p != this->shapes[this->activeShape].particles.end(); p++)
{
float yValue = 20.0f;
this->vertexArray[this->activeShape][current].Position.x = (*p)->x0.x;
this->vertexArray[this->activeShape][current].Position.y = -yValue;
this->vertexArray[this->activeShape][current].Position.z = (*p)->x0.y;
this->vertexArray[this->activeShape][current + listSize].Position.x = (*p)->x0.x;
this->vertexArray[this->activeShape][current + listSize].Position.y = yValue;
this->vertexArray[this->activeShape][current + listSize].Position.z = (*p)->x0.y;
current++;
}
// render code
glFrontFace(GL_CW);
glEnable(GL_BLEND);
glVertexPointer(3, GL_FLOAT, sizeof(LsmVertexColor), &this->vertexArray[this->activeShape][0].Position);
glEnableClientState(GL_VERTEX_ARRAY);
glColor4f(SCULPTY_R, SCULPTY_G, SCULPTY_B, SCULPTY_A);
glDrawElements(GL_TRIANGLE_STRIP, 20, GL_UNSIGNED_SHORT, &this->indexArray[this->activeShape][0]);
glDrawElements(GL_TRIANGLE_STRIP, 20, GL_UNSIGNED_SHORT, &this->indexArray[this->activeShape][22]);
glDrawElements(GL_TRIANGLE_STRIP, 10, GL_UNSIGNED_SHORT, &this->indexArray[this->activeShape][44]);
glDrawElements(GL_TRIANGLE_STRIP, 10, GL_UNSIGNED_SHORT, &this->indexArray[this->activeShape][54]);
私は OpenGL ES 1.1 を使用しており (最新ではないことはわかっています)、プログラムは iPhone/iPad で実行されています。