Do the pros use D3DX

Started by
61 comments, last by Etnu 19 years, 7 months ago
Quote:Original post by vajuras
Well I decided to pull out my high precision timer and see how well my hand written, unoptimized matrix class fared against D3DX. Here's the result:

My Matrix 0.000003
D3DXMATRIX Time 0.000003
D3DXMATRIXA16 Time 0.000003

As you can see my matrix matches D3DXMATRIX. Sometimes they vary by 1 clock. In any case, this goes to show the D3DX math functions are not as fast as most folks believe.

That is very interesting . Could you run that code through a commercial profiler (ie Intel VTune)? If not, try timing thousands of operations at a time.

All the timers I have ever used aren't very accurate for single-call events. Timing an entire batch of them should be a better representation of the facts. [smile]
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
Advertisement
the point remains I have never seen a commercial engine rely on D3DXMATRIX/D3DXVECTOR (Unreal engine, etc) for core ops. so even if you ran VTune and proved that D3DXMATRIX was 1 clock cycle faster than the avg 3 loop matrix mul function it would not make any diff.

D3DX math functions are okay, nothing special, nothing the avg senior programmer can;t write in 1 day.

Btw, nice user rating you have there :D
Who is Carmack? Gee you guys wouldn't be his fan club would you?
If you base all your descisions on what one man does then you fall short of being sheep.

Well I heard Michael Jackson uses Head & Shoulders Shampoo, so I would advise everyone to do the same, I mean look at him, he's rich!
Quote:Original post by vajuras
the point remains I have never seen a commercial engine rely on D3DXMATRIX/D3DXVECTOR (Unreal engine, etc) for core ops. so even if you ran VTune and proved that D3DXMATRIX was 1 clock cycle faster than the avg 3 loop matrix mul function it would not make any diff.

D3DX math functions are okay, nothing special, nothing the avg senior programmer can;t write in 1 day.
Of course Unreal2/2x/3 doesn't use D3DX - it's targeted for PC, Mac, Linux, Xbox, PS2, and Gamecube. However, some commercial developers (perhaps those that only develop for XBOX and PC) do use D3DX for the core math operations (as well as texture loaders and shader compilers).

If the average senior programmer can replicate D3DX math functions in one day, then why does it take Intel and Microsoft programmers months to code them in the first place? The fact of the matter is, the D3DX math functions are much faster than the math functions that some programmer slaps together in one day. Do a proper profiling of the code, and you will find that out for yourself.
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
When did I say no one uses D3DX functions for compiling shaders, etc?

Unreal Engine/Doom 3 are undoubtably the top 5 commercial engines out there. If D3DXMATRIX was so great- trust me they would use it. Instead, they use plain vanilla matrix ops. It is not rocket science coding a matrix/vector class. It is not hard to write stuff that outperforms microsoft math functions. I am sorry if I have upset you but this is the truth. Every game company I have ever worked at, we wrote our own math libs. Every game company i ever visited, they wrote their own.

[Edited by - vajuras on August 29, 2004 1:24:49 PM]
Trivial Pursuit® Unhinged™
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
Is that the best you can do is list a freaking puzzle game, lol.
Quote:Original post by vajuras
Is that the best you can do is list a freaking puzzle game, lol.

You said "name one game that uses D3DX". He did. You then edited your post to remove your request for a single game.
You asked for an XBOX game, he gave you one. If you've been following the DIRECTXDEV list, you'll notice people ask D3DXMATRIX related questions there.
The 2004 update bug (matrices not transposed when set with effects) bit many of them, and they all added workarounds - that's saying something, isn't it?

Regarding your timing test: What functionality did you test exactly? Take a look at the list of matrix functions supported by D3DX, implement your own, and then send me a copy and let's profile together.
Also, don't forget to write a version against aligned matrices.

Also, I hope you did that timing test on a release build, not a debug one. And that you've also tested it on a PC capable of SSE.

Of course Unreal, Doom, etc. use their own matrix functions. They are going to be used on other platforms.

Doom is, of course, OPENGL, and probably wouldn't have much use for using DX functions anyway (so why use D3DX?)

Unreal needs to operate on at least 6 different platforms. Using a platform-specific implementation would be kind of silly.

---------------------------Hello, and Welcome to some arbitrary temporal location in the space-time continuum.

This topic is closed to new replies.

Advertisement