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 callCode:... 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.Code:if(FAILED(D3DXCreateTextureFromFile(D3DDevice, "C:\\Grass.bmp", &Texture))) return false; D3DDevice->SetTexture(0, 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?Code://Render everything D3DDevice->SetStreamSource(0, VertexBuffer, 0, sizeof(VERTEX)); D3DDevice->SetFVF(FVF); D3DDevice->SetIndices(IndexBuffer); D3DDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, 0, NumVertices, 0, NumPolygons);
If there're any thoughts, I'm glad to hear them. Thanks for reading