The Technology of a 3D Engine - Part One

Friday 21st December 2007, 10:10:00 AM, written by Geo

Beyond3D is very proud to present the first part of an on-going series featuring one man's thoughts and experience on modern engine development. As you'll see, as we publish subsequent parts, Rodéric has a valuable story to tell. Rodéric and Beyond3D's foremost intention is that it sparks up insightful and informed comment on the forums, where everyone can learn something new about what's still a bit of a dark art in programming terms.

And the best thing is that you don't need to be a programmer to follow it. Read on.


Discuss on the forums

Tagging

graphics ± software, games, development


Latest Thread Comments (32 total)
Posted by silent_guy on Wednesday, 02-Jan-08 07:49:18 UTC
Quoting suryad
I think what Davros meant when saying "massive speedups" is if game A is implemented in DX 9 purely, and if game A has another version written in DX 10 purely then DX 10 version with all the new features enabled will look better but use less resources and generate higher fps than the DX 9 version. Is that correct?
Sometimes... It really depends on where your performance bottleneck is located.

If you're completely maxing out on, say, the multipliers in the pixel shaders, then, on the same HW, you'll render that part at the speed no matter which API you're using.

In practice, a scene has different parts with different properties. Some will be floating point limited, others will be texture unit limited etc.

Posted by pthiben on Wednesday, 02-Jan-08 16:05:38 UTC
Quoting silent_guy
Sometimes... It really depends on where your performance bottleneck is located.

If you're completely maxing out on, say, the multipliers in the pixel shaders, then, on the same HW, you'll render that part at the speed no matter which API you're using.

In practice, a scene has different parts with different properties. Some will be floating point limited, others will be texture unit limited etc.
A pretty interesting read is here where profiling was done:
http://developer.nvidia.com/docs/IO/8230/BatchBatchBatch.pdf

The mentioned hardware is a bit old now, and it lacks statistics about D3D10 (and vista) but it's still a good read :)

Posted by suryad on Thursday, 03-Jan-08 23:33:36 UTC
Thanks for the link to the pdf. I understand for the most part but the term 'batches' as I am understanding refers to 'jobs for drawing objects'?

Posted by pthiben on Friday, 04-Jan-08 10:12:42 UTC
Quoting suryad
Thanks for the link to the pdf. I understand for the most part but the term 'batches' as I am understanding refers to 'jobs for drawing objects'?
On the 1st page, it is written that "Every DrawIndexedPrimitive() is a batch". For non D3D users, DrawIndexedPrimitive is the "draw call" referred in the article, i.e. the CPU asking the GPU to draw the triangles (the "objects" as you call it) it prepared for rendering.

Posted by suryad on Friday, 04-Jan-08 17:35:06 UTC
Quoting pthiben
On the 1st page, it is written that "Every DrawIndexedPrimitive() is a batch". For non D3D users, DrawIndexedPrimitive is the "draw call" referred in the article, i.e. the CPU asking the GPU to draw the triangles (the "objects" as you call it) it prepared for rendering.
Thanks!

Posted by Rodéric on Thursday, 10-Jan-08 11:18:20 UTC
Here's something from Tom Forsyth about Draw Calls (& state changes) costs w/ D3D9:http://tomsdxfaq.blogspot.com/2006_04_01_archive.htmlI know the kernel mode switch is expensive, although it seems it might not be the most expensive operations performed during a Draw Call.A quick summary of Draw Call costs would be :D3D9 > OpenGL >= D3D10(I'd like to spend some time making my own Draw Call speed tests in a real case scenario/game, however I don't have any time atm.)

Posted by hoho on Thursday, 10-Jan-08 11:51:50 UTC
Quoting Rodéric
A quick summary of Draw Call costs would be :
D3D9 > OpenGL >= D3D10
I wouldn't be so sure about that. I remember one NVidia GPU architect-engineer (http://www.allegro.cc/members/Bob) once said that D3D10 will be much better than D3D9 in terms of draw call cost but it won't be as good as OpenGL. Unfortunately I couldn't find the post where he said it.

Posted by Demirug on Thursday, 10-Jan-08 20:00:57 UTC
Quoting hoho
I wouldn't be so sure about that. I remember one NVidia GPU architect-engineer (http://www.allegro.cc/members/Bob) once said that D3D10 will be much better than D3D9 in terms of draw call cost but it won't be as good as OpenGL. Unfortunately I couldn't find the post where he said it.
Maybe this person was talked about the overhead of a single call down to the API. As Direct3D 10 still uses a runtime between the application and the driver there is some additional overhead for bookkeeping and some data conversion.

But developers normally refer to something different when the talked about “Draw call overhead”. This overhead includes the processing time for any pipeline updates that prepare the draw call. Direct3D 10 has an advanced here as you need less API calls to do the same. Additional API features like state objects and resource views allow the driver to move work from runtime to creation time.

It is not a surprise that OpenGL 3.0 aims for a very similar overall design.

Posted by Rys on Friday, 11-Jan-08 02:46:13 UTC
Quoting Demirug
I am not sure what you are mean with “format conversion” here.
Gah, I meant to reply to this at the time. I meant changing the representation of a surface on disk to something the GPU likes to consume, before its sent to the hardware.

Posted by dkanter on Saturday, 19-Jan-08 23:47:12 UTC
Thanks for putting this together. It's a very interesting introduction before I start diving into IEEE papers.

DK


Add your comment in the forums

Related graphics News

Beyond Programmable Shading CS448s first slides available
Khronos release OpenGL 3.3 and 4.0
Mazatech release AmanithVG 4.0, supporting OpenVG 1.1
OpenGL 3.0 is here (finally)
[Analysis] TSMC 40G to deliver up to 3.76x the perf/mm^2 of 65G & Power Implications
Old News: AMD CTO resigns, NVIDIA CFO retires, DDR3 for MCP7A, S3, etc.
SwiftShader 2.0: A DX9 Software Rasterizer that runs Crysis
S3 launches DirectX 10.1 Chrome 400 GPUs
GPGPU and 3D luminaries join 3D graphics heavyweights
Samsung joins Qimonda and Hynix in the GDDR5 race