Am I too greedy trying to render 16384 textured vertices at a perfect frame rate?
I'm rendering a terrain, and until now, I've simply had each vertice being coloured by a RGB value. It's time to move on to bigger and badder things, so I decided to get the startings of a texture going.
I'm starting with strictly tiling each "square" of vertices. And now that I've got it working, running around on my terrain is a chore. What used to be smoother than silk on teflon would now make a lumber jack proud. That's right, it's choppy like you wouldn't believe.
I'm not doing anything fancy in the rendering that I wasn't doing before.
My initialization includes:
And I call
D3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
D3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
D3DDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
// And as for my RenderStates:
// Culling none (CW doesn't help)
// ZEnable true
// Lighting false
// FillMode solid
// NormalizeNormals true
// Ambient 0x00FFFFFF
// AlphaBlendable false
Just once. Outside of my Rendering.
if(FAILED(D3DXCreateTextureFromFile(D3DDevice, "C:\\Grass.bmp", &Texture)))
Between the BeginScene() and EndScene() methods of my D3DDevice, the only code that appears is:
So, I'm at a loss where this performance hit can be coming from. And my only guess is that Textured vertices take more time?
D3DDevice->SetStreamSource(0, VertexBuffer, 0, sizeof(VERTEX));
D3DDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, NumVertices, 0, NumPolygons);
If there're any thoughts, I'm glad to hear them. Thanks for reading