DX Backface culling Slower than......

Started by
7 comments, last by reltham 19 years, 1 month ago
Uhm....anyone who knows why a simple backface culling using dx ( g_pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CW ) ) is slower than mine made in software doing a simple cross and z test ( C=AxB if C.z<0 cull it otherwhise draw it ) ? Thanx in Advance!
Advertisement
How do you know its slower? Timing D3D functionality is full of potential pitfalls.

Congratulations if your CPU-based software renderer can outperform a dedicated hardware T&L pipeline though [smile]

Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Just to add:
- With a powerful CPU, you can outperform the GPU in some calculations, but that's not the point. Your CPU isn't 'dedicated' to graphics calculations, it's running many things in parallel - both inside and outside your process. Outside your process, you've got the OS and other applications. Inside, it typically processes things like physics and AI.

That's one reason synthetic benchmarks aren't easy to get right - a simple mistake and you end up simulating a non-real-life (or non-real-game) scenario.

- What kind of speed difference are you seeing? How are you measuring it?

Just a question : How do you draw your mesh ? Because I don't really see how you can cull each triangle in CPU if you're using Vertex/Index buffers ...
Which kind of function do you use ? DrawIndexedPrimitive or DrawIndexedPrimitiveUP ??
If you use the last one, that's why your culling is more efficient. If you use the first one, then I don't see why ^^

.:: Paic Citron ::.
I use Fraps to get fps, it slows down of about 5-10 fps, i use "DrawIndexedPrimitive"........
it's very strange............
Quote:Original post by giuseppeCT
I use Fraps to get fps, it slows down of about 5-10 fps, i use "DrawIndexedPrimitive"........
it's very strange............

From how many FPS to 5-10?
Also, how many primitives are you sending to DIP? (Copy/paste the call code here)

If you're culling in software, you have to completely rewrite your index buffer each frame, right ? Did you create your index buffer with D3DUSAGE_DYNAMIC and D3DPOOL_DEFAULT ??

Last question (from my own experience ^^) what's the speed of your AGP ? I used to work on a PC with an AGP bus that was so slow that a culling in software would have been more efficient than a hardware one.

.:: Paic Citron ::.
I rewrite the buffer every frame, yup is dynamic write only.............
i think agp is not the problem, i've 8x agp however, tris are about 10000 per frame.
When you let the GPU do the culling, are you still building the index buffer each time or just using a static index buffer?

If you are always building the index buffer, then the difference is going to be that when you cull on the CPU are you build an index buffer that is likely half the size and thus you are sending half the index data across the bus. That would be enough to cause a noticable drop in frame rate.

If you are going to let the GPU do the culling, then you should use a static index buffer.

This topic is closed to new replies.

Advertisement