Original Post
I'm trying to rid of my ugly skybox and implement a skydome instead. I am going through the skydome paper at spheregames.com and haven't gotten the expected results. Here is a screenshot of what I'm getting:
Vertex buffer creation: I am using a dTheta of 15 and dPhi of 15 which gives me 576 vertices -
Vertex buffer creation:
m_pD3DDevice->CreateVertexBuffer(m_numVerts * sizeof(VertexPNT), D3DUSAGE_WRITEONLY, 0, D3DPOOL_MANAGED, &m_pVB, 0);
VertexPNT *v;
m_pVB->Lock(0, 0, (void**)&v, 0);
int n = 0;
float dtor = D3DX_PI / 180.0f;
for (int phi=0; phi <= 90 - m_dPhi; phi += (int)m_dPhi) {
for (int theta=0; theta <= 360 - m_dTheta; theta += (int)m_dTheta)
v[n].pos.x = radius * ::sinf(phi*dtor) * ::cosf(dtor*theta);
v[n].pos.y = radius * ::sinf(phi*dtor) * ::sinf(dtor*theta);
v[n].pos.z = radius * ::cosf(phi*dtor);
//v[n].color = D3DXCOLOR(1.0f, 0.0f, 0.0f, 1.0f);
n++;
v[n].pos.x = radius * ::sinf((phi+m_dPhi)*dtor) * ::cosf(theta*dtor);
v[n].pos.y = radius * ::sinf((phi+m_dPhi)*dtor) * ::sinf(theta*dtor);
v[n].pos.z = radius * ::cosf((phi+m_dPhi)*dtor);
//v[n].color = D3DXCOLOR(1.0f, 0.0f, 0.0f, 1.0f);
n++;
v[n].pos.x = radius * ::sinf(dtor*phi) * ::cosf(dtor*(theta+m_dTheta));
v[n].pos.y = radius * ::sinf(dtor*phi) * ::sinf(dtor*(theta+m_dTheta));
v[n].pos.z = radius * ::cosf(dtor*phi);
//v[n].color = D3DXCOLOR(1.0f, 0.0f, 0.0f, 1.0f);
n++;
if (phi > -90 && phi < 90) {
v[n].pos.x = radius * ::sinf((phi+m_dPhi)*dtor) * ::cosf(dtor*(theta+m_dTheta));
v[n].pos.y = radius * ::sinf((phi+m_dPhi)*dtor) * ::sinf(dtor*(theta+m_dTheta));
v[n].pos.z = radius * ::cosf((phi+m_dPhi)*dtor);
//v[n].color = D3DXCOLOR(1.0f, 0.0f, 0.0f, 1.0f);
n++;
}
}
m_pVB->Unlock();
for(int i = 0; i < numPasses; i++)
{
m_tltEffect->BeginPass(i);
m_pD3DDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 574);
m_tltEffect->EndPass();
}