Sign in to follow this  

ANN: D3D Movie "The Triangle Build Up Of An F1 Car"

This topic is 4558 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Evening all, I wish to announce a project that I've been working on for a few weeks now. I'm hoping you'll like it!
What is it?
I've made a 60 second movie showing how a 3D mesh is constructed in Direct3D9. It's a little difficult to explain, but it shows as a form of animation the steps that go on "behind the scenes" when you despatch a mesh to be rendered. It's aimed mostly at beginners - a sort of visual introduction to the process that they'll be trying to learn. It's unlikely there's anything ground breaking for intermediate/advanced D3D programmers, but you might find it interesting... TheTriangleMakeUpOfAnF1Car.zip (13.73mb). Grab this file, inside is a .AVI file encoded using the DivX codec. It should play fine in all reasonably up-to-date players.
Background
As you may or may not know, I've written 100's of articles on DirectX over the last few years. I wanted to try something new - and I'm not 100% sure yet that this format will work out. Given the somewhat obviously graphical nature behind Direct3D programming the goal was to create a video that demonstrates various aspects of how a D3D application works. One that might not be immediately obvious from looking at the code, mathematics and diagrams that often make up the bulk of introductory materials. In some respects, interactive source code that ships with articles does this job, but with a video it's easier for me (the author) to focus on particular things in a particular order. Also, for some advanced techniques a video could well show these off without having to worry about the end-user not being able to run the code. If people appreciate this video and there's some favourable feedback, then I've already given thought to making some more useful videos. This current video can be considered as an experiment of sorts.
A bit of explanation
As you'll see, the video runs through 4 distinct phases. It's fairly self-explanatory, but I thought I'd include a brief run-down here...
This first section shows, as green dots, each vertex that builds up the mesh. With this view you can see how the key points of the mesh are positioned.
The second part of the movie effectively joins up the dots, showing the outlines of each triangle as blue lines.
With the outlines of the triangles displayed, the renderer starts to fill in the content of each triangle based on the correct material-based lighting. This is the build-up of the display that you would be expecting to see if you were to request Direct3D to render it.
With the build up complete, the movie shows a rotation of the final mesh rendering. There are two particular things to note about this whole sequence: (1) In actually rendering a mesh, D3D doesn't do the first two phases of drawing the dots and connecting them up [smile]. I've put that in to show the progression of how the data contained in a mesh fits together to build the final product. (2) There is an interesting pattern to the order in which vertices and triangles are actually rendered. It is logical, but one of the things that this sort of movie was leading to (but didn't end up fitting in) is a visual "proof" of why a depth buffer (and associated things) might be necessary.
Your thoughts?
As mentioned above, this whole project is a bit of an experiment. I'm not aware of there being any similar videos available (my initial searches didn't yield anything). Any thought you have are greatly appreciated. Leave a post here or send me a private message I'm gonna run away and hide for now and come back later to check any replies - fingers crossed it'll be more than Cheers, Jack

Share this post


Link to post
Share on other sites
Nice idea, but I would like to have some kind of explanation while the video is running, and do it a bit slower. I know the idea of vertices and triangles, but it should be more educating, if you would show it slower and tell the "audience" some stuff about it.

Share this post


Link to post
Share on other sites
Quote:
Original post by matches81
Nice idea, but I would like to have some kind of explanation while the video is running, and do it a bit slower.

Yup, I had thought of that. I had a slight problem there - if I reduced the frame rate (say 20fps -> 15fps) it didn't look so smooth. If I increased the frame count so as to make it longer the file size got prohibitively big...

Quote:
Original post by matches81
I know the idea of vertices and triangles, but it should be more educating, if you would show it slower and tell the "audience" some stuff about it.

The most ideal thing would be to have a voice-over commentry, but I lack the software/hardware here to do that (not to mention the talent [wink]).

I had thought about breaking it into a power-point presentation so that it could have some text/diagrams running along side each section. Would that work?

Jack

Share this post


Link to post
Share on other sites
Overall, excellent job! I see that the filesize is within the limits of GDNet+ - remember that if you make more videos, you can store them on my webserver if you want.

Quote:
I had thought about breaking it into a power-point presentation so that it could have some text/diagrams running along side each section. Would that work?

That would be pretty cool, but watch how much stuff you put into those power-point presentations. The file sizes can get *really* big. Less than a full-fledged movie, though.

Oh yea, I see you've lost the messy jello objects

Share this post


Link to post
Share on other sites
Quote:
Original post by circlesoft
Overall, excellent job! I see that the filesize is within the limits of GDNet+ - remember that if you make more videos, you can store them on my webserver if you want.

Thanks for the offer! I'm still hoping there'll be a bit more feedback as to whether the format works effectively or not before I think too much about a "sequel".

Quote:
Original post by circlesoft
Quote:
I had thought about breaking it into a power-point presentation so that it could have some text/diagrams running along side each section. Would that work?

That would be pretty cool, but watch how much stuff you put into those power-point presentations. The file sizes can get *really* big. Less than a full-fledged movie, though.

I'm gonna have a go with this when I get time - just see what sort of possibilities/restrictions it has.

Quote:
Original post by circlesoft
Oh yea, I see you've lost the messy jello objects

Hehe, yeah - they weren't such a good idea [smile]. Realised I could get some help from a digi-artist that I know (who also does stuff for F1CM)..

Jack

Share this post


Link to post
Share on other sites
I love what you've done. It would go great with supporting text or (even better) a voice-over. I actually ran across a site where someone was making DirectX tutorial videos, but I don't remember the link. But I sure love the idea!

Share this post


Link to post
Share on other sites
That's actually a pretty cool idea. Especially beginners should get some sort of insigt in how the process works, and where you can gain performance

Thumbs up ;)

Share this post


Link to post
Share on other sites
Quote:
Original post by hannibal84
I love what you've done. It would go great with supporting text or (even better) a voice-over.

From a design point of view, this is what I would want. However, I don't hav a decent microphone and/or voice talents [wink]

Quote:
Original post by hannibal84
I actually ran across a site where someone was making DirectX tutorial videos, but I don't remember the link.

If you think of the name/url then send me a PM (or post here). I'd like to see that site.

Quote:
Original post by Nizro
That's actually a pretty cool idea. Especially beginners should get some sort of insigt in how the process works, and where you can gain performance

I haven't been thinking of it in terms of performance.

To be brutally honest to the beginners here (and on other forums I frequent!) I see a lot of very similar questions. Ones that I've answered a lot of times, ones that are referenced in the Forum FAQ. However, a lot of them only make sense when you've made the mistake and corrected it yourself.

The idea consequently is that if I show people, as a movie, what went wrong and what fixed it. Or, changing X affects Y hence you get Z - watch my movie and you'll see how and why this is the case.

The feedback is appreciated [smile]

Cheers,
Jack



Share this post


Link to post
Share on other sites
Quote:
I haven't been thinking of it in terms of performance.

What I was trying to say, was that the progressive 'build-up' shows how the stuff is dealt with (vertices being passed, linked and then shaded...). The numbers shown during the process gave me some kind of idea of where a lot of work is done, and where you might hit it to speed up.

Share this post


Link to post
Share on other sites
Quote:
Original post by Nizro
Quote:
I haven't been thinking of it in terms of performance.

What I was trying to say, was that the progressive 'build-up' shows how the stuff is dealt with (vertices being passed, linked and then shaded...). The numbers shown during the process gave me some kind of idea of where a lot of work is done, and where you might hit it to speed up.

Okay, I understand [smile]

Although, remember:
Quote:
(1) In actually rendering a mesh, D3D doesn't do the first two phases of drawing the dots and connecting them up [smile]. I've put that in to show the progression of how the data contained in a mesh fits together to build the final product.


As an aside, one of things I've contemplated was showing some heirachical culling algorithms (e.g. QuadTree) working from a "non camera" point of view... that would probably give a good idea of how/why culling is a good idea.

Jack

Share this post


Link to post
Share on other sites
This would be a very useful thing to show my first year games programming students - is there going to be a fixed home for it?

Share this post


Link to post
Share on other sites
Quote:
Original post by Trip99
This would be a very useful thing to show my first year games programming students - is there going to be a fixed home for it?

I currently have no plans to delete and/or move the file. It's occupying ~50% of my GDNet+ webspace; I suppose if I really needed to use that space for something else I might look for some different hosting (I've had a few generous offers)..

You're more than welcome to keep a copy of the archive on your own website / server for your university course.

Also, if you're wanting to use it for your university course (very cool idea! [smile]) I could sort out a better quality copy. I was constrained by the limits of server space (and download times), but the original (high quality, uncompressed) that I was working from is over 300mb [grin].

Thanks for your interest in my video!
Jack

Share this post


Link to post
Share on other sites
Great work mate... To get around the AVI size problem why not make this into an application? You script the building of the car and the voice overs, you could have Stop/Play/Rewind etc etc. Also, I don't know if you fancy taking this any further but I have a small recording studio so if you fancy trying out some voice work PM me and I'll do it for free. Don't know who will do the voice over though, I sound a bit Northern!

Eee By Gum, it's a vertex...!

Mark Coleman

Share this post


Link to post
Share on other sites
Quote:
Original post by mrmrcoleman
Great work mate...


Quote:
Original post by mrmrcoleman
To get around the AVI size problem why not make this into an application? You script the building of the car and the voice overs, you could have Stop/Play/Rewind etc etc.

That would be a good way of reducing size, but one of the reasons behind it being a video file is to get around any issues with hardware/driver support.

It doesn't hold for this particular video, but if I were to take it any further and use particular feature(s) such as SM2/SM3 shaders it could cause problems. Then again, I suppose most features worth covering will probably be fairly well supported [oh]

Quote:
Original post by mrmrcoleman
Also, I don't know if you fancy taking this any further but I have a small recording studio so if you fancy trying out some voice work PM me and I'll do it for free. Don't know who will do the voice over though, I sound a bit Northern!

Eee By Gum, it's a vertex...!

[lol] Thanks for the offer - greatly appreciated [smile]. I have no plans to make another video in the immediate future (next month or so), but I think I will give it another go soon. I've got a few ideas though..

It would be great to have a voice over explaining whats on-screen, it would add a lot of value to it.

Cheers,
Jack

Share this post


Link to post
Share on other sites
Jolly - if you do do another version then great, otherwise I can use this one. Our semester is just finishing anyway so I would not use it until the end of summer. Thanks.

Share this post


Link to post
Share on other sites
Quote:
Original post by Trip99
Jolly - if you do do another version then great, otherwise I can use this one. Our semester is just finishing anyway so I would not use it until the end of summer. Thanks.

Found out this morning that another university has recently used that video for their graphics course [oh]

Anyway, if you want to PM me any ideas of how you'd want to get your hands on a higher resolution / uncompressed version that'd be great... I don't have any webspace to even temporarily store a file that big [grin]

Jack

Share this post


Link to post
Share on other sites
What a cool video! How did you get the gradual rendering accomplished? I suppose you could just keep increasing the rendering buffer counts? But to have them render in that specific order was really cool.

Funny how I've never seen this until now. Shame on me for ignoring stickies [smile]

Good work!

Share this post


Link to post
Share on other sites
Quote:
Original post by Jiia
What a cool video! How did you get the gradual rendering accomplished? I suppose you could just keep increasing the rendering buffer counts?

I re-wrote ID3DXMesh::DrawSubset( ) [smile]

It took some doing, as getting all of the numbers in the params to various calls the same required a bit of guesstimation...

Quote:
Original post by Jiia
to have them render in that specific order was really cool.

Thanks [grin] I just considered it conceptually - points > wireframe > solid - and went from there..

Quote:
Original post by Jiia
Funny how I've never seen this until now. Shame on me for ignoring stickies [smile]

[lol] somewhat defeats the point of a sticky really[attention]

Thanks for the feedback - always appreciated.
Jack

Share this post


Link to post
Share on other sites
I think the video is a great start! Some constructive criticism:

The camera motion is very distracting. Although the concept is cool, this sort of motion is best left for hollywood-style VFX where the actual content of the graphics don't really matter. I have a hard time seeing all of the buildup that is happening with any clarity because the view keeps changing. I would make the camera motion very fluid and *slow*, to give a nice view of the mesh over time without disrupting the more-important animation of vertices/edges/faces.

The reflective floor is also a bit distracting, especially during the vertices portion. My eye has a really hard time creating the form of the car here and I just get very confused. The camera motion makes this feeling a bit worse than it would be otherwise.

I can't see the text readouts for most of the time due to the camera motion.

It's also worth noting that if your camera motion were a lot slower you could probably shave several megabytes off the size of your video. Because of the speed of the camera motion the encoder has to store much more data for each frame and the size of your video is much larger as a result. Better yet, you could encode a higher-quality video with an identical file size.

I hope my comments were helpful, I think videos like these can definately help people understand concepts much more quickly than text descriptions and static diagrams.

Jesse

Share this post


Link to post
Share on other sites
Quote:
Original post by jrapczak
The camera motion is very distracting. Although the concept is cool, this sort of motion is best left for hollywood-style VFX where the actual content of the graphics don't really matter.

Good point, I might try changing it later to see if it looks much better.

The camera motion is actually what took me the longest to get sorted. Originally I found that, particularly towards the end of the movie, you can't actually see everything for the simple reason it's drawing stuff that should be "underneath" other stuff.

I think some sort of view/camera movement would be required so that you can always see something happening.

Quote:
Original post by jrapczak
The reflective floor is also a bit distracting

I hadn't thought of that, but I can see how it might get in the way.

One of the first renders I did of that car also had specular high-lights on it, and a previous one for F1CM also had planar shadows. It looks so damn nice that way [grin]

Quote:
Original post by jrapczak
I can't see the text readouts for most of the time due to the camera motion.

Is that just because of the aforementioned problems with movement in general; or a technical issue with the compression/position??

Quote:
Original post by jrapczak
It's also worth noting that if your camera motion were a lot slower you could probably shave several megabytes off the size of your video.

I'll look into this, as the full 640x480 uncompressed version I have on my machine (which clocks in at 100's of megabytes [smile]) is a lot lot better during the point-cloud/wireframe stages...

Quote:
Original post by jrapczak
I hope my comments were helpful

Very helpful - thanks. I've got a lot of ideas from the various people who've replied to this thread (and a few emails/PM's). When I get some more time to work on another of these projects it'll incorporate a lot of what's been said [smile]

Quote:
Original post by jrapczak
I think videos like these can definately help people understand concepts much more quickly than text descriptions and static diagrams.

That's exactly what I was trying to achieve [grin]

Cheers,
Jack

Share this post


Link to post
Share on other sites

This topic is 4558 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this