idreamlovey
08-08-2007, 07:07 AM
In my first engine which is basically intent to render outdoor environment. I am using one large Dynamic Vertex and Index Buffer to make no Vertex-Index buffer switches. I am using GridBased system. Each grid has been further divided into OCTREE. At each leaf node static Polygon Lists(Dynamic Link Lists) have been created which stores info about Vertices and Indices sepearted by material types. Now at the time of culling, i am copying the polygon lists data of each leaf into another dynamic polygon Linklist. So i traverse each grid and each octree leaf that is currently in view and copy the polygons seperated by their material type. Now Doing this i can Batch the whole triangles according to thier material type thus reducing the DrawIndexPrimitive call. All i am doing like this as in two steps:-
step 1:
1.Cull Tree
2. At leaf Node
for (int i=0;i<numMaterials;i++)
Copy LeafPolygonLists(i) to MainPolygonLists(i) (i used link list here but showing as array just to make u understand what i m doing)
(memset is used here)
step 2:
start vertexCache
for (int i=0;i<numMaterials;i++)
{
SetMaterial(i)
Copy MainPolygonLists(i) to Vertex Buffer and Index Buffer;
(memcpy is used here)
Flush the vertex cache
}
Now here u see i have to do two copies. Engine can render 20000 tris at 18 frame rate at NVIDIA 5200 fx card. But i want to increase it more and i am thinking that two copies can be avoided by only one copies....
In my engine u can see 3200 tris with light mapping, 1800 with pixel based splatting, 5500 tris with environmental texturing (vertex shader used)and soft shadow(pixel shader used), 6000 with alpha blending transperent obects some with no BackfaceCull and rest are with lights on (without specular). SkyBox with sunflare. And i think my engine is not good as i see FLATOUT and NFS Carbon demo runs at 30 frame rate with more poly and shader..
I want to know what u guys do actually in scene management. Is the above one is good approach and need additional optimization in same engine....Please tell me what should i do to make a good managed engine...If u have link to any article...It will be great to me....
step 1:
1.Cull Tree
2. At leaf Node
for (int i=0;i<numMaterials;i++)
Copy LeafPolygonLists(i) to MainPolygonLists(i) (i used link list here but showing as array just to make u understand what i m doing)
(memset is used here)
step 2:
start vertexCache
for (int i=0;i<numMaterials;i++)
{
SetMaterial(i)
Copy MainPolygonLists(i) to Vertex Buffer and Index Buffer;
(memcpy is used here)
Flush the vertex cache
}
Now here u see i have to do two copies. Engine can render 20000 tris at 18 frame rate at NVIDIA 5200 fx card. But i want to increase it more and i am thinking that two copies can be avoided by only one copies....
In my engine u can see 3200 tris with light mapping, 1800 with pixel based splatting, 5500 tris with environmental texturing (vertex shader used)and soft shadow(pixel shader used), 6000 with alpha blending transperent obects some with no BackfaceCull and rest are with lights on (without specular). SkyBox with sunflare. And i think my engine is not good as i see FLATOUT and NFS Carbon demo runs at 30 frame rate with more poly and shader..
I want to know what u guys do actually in scene management. Is the above one is good approach and need additional optimization in same engine....Please tell me what should i do to make a good managed engine...If u have link to any article...It will be great to me....