I was looking at this engine(Hieroglyph 3) I think it was actually written by a member of this forum.Anyway,the code is really clean and organized and the sample apps run with excellent performance,however I don't understand why the author created custom vectors(Vector2f,Vector3f..) and custom matrices(Matrix3f,Matrix4f...) when there's DirectXMath with the SIMD wrappers.Maybe he wanted to abstract it from DirectX,so it's not DirectX reliant?Cause I thought you can actualy use DirectXMath/Xnamath on it's own without D3D and the other APIs.Please correct me if I'm wrong.
Hieroglyph 3 engine using custom vector and matrix objects?
Started by mrheisenberg, Nov 01 2012 04:31 PM
4 replies to this topic
Ad:
#2 Members - Reputation: 490
Posted 01 November 2012 - 06:32 PM
I can't speak for the reasoning behind rolling a custom math lib in H3, but I wrote my own for my engine as a learning experience, and because I could tailor the api to what I think is most practical to work with. Also, when msoft decide to move their math lib to a different sdk / drop support for it / rename it / change interfaces / etc. (as they tend to do from time to time), I won't have to do any work on my side. Same reason why I don't use their d3dx texture and mesh loading helper functions.
#3 Members - Reputation: 171
Posted 01 November 2012 - 06:33 PM
When he (Jason Zink) started writing Hieroglyph3 there was no DirectXMath nor any XNAMATH. According to the book he co-wrote, Practical Rendering & Computation with Direct 3D 11, he started the project in 2000 with D3D 8. I'm not even sure if there was a D3DX math back then, honestly. I expect he created the custom structures and math functions simply to fill a void (or possibly as a learning experience) and has kept them up to now since changing away from them would be a big undertaking. I think he does have plans to switch to DirectXMath, but I'm not positive and it would be quite a few hours of free time needed to complete it and test it out at any rate.
#4 Staff - Reputation: 8882
Posted 01 November 2012 - 07:16 PM
Jason often blogs about Hieroglyph3 (and more general concepts) in his developer journal here at GDNet, you might be able to find additional information there.
- Jason Astle-Adams.
From my blog: 20 ways to advertise your game | What next? Intermediate to advanced C++
How to make games WITHOUT programming | 4 reasons you aren't a successful indie developer
#5 GDNet+ - Reputation: 2367
Posted 01 November 2012 - 08:49 PM
You guys have it more or less right on - I started the library when I was just learning about graphics programming (and C++ for that matter...), so it was originally a learning exercise. When I started out, I followed Dave Eberly's Wild Magic engine, and he also used a series of custom match classes. Since his work was so well known, I followed along and converted them to non-templated versions, learning while I went along. I can also give the advice that it is very much worth the effort to implement your own math classes - even if you don't use them (for performance reasons or whatever) it is very instructive on a number of levels.
Regarding the lack of updating to something like DirectXMath, it is mostly because I don't do lots of CPU math in the engine. There are some matrix multiplications, but not really anything that could take advantage of heavy duty SIMD operations. Because of churn in the math libraries over the past few years (D3DX, XNAMath, DirectXMath, etc...) it has been a practical choice for me to stick with the CPU based classes. My development time seems to be much lower than it has traditionally been, so I have to pick my battles wisely
Thanks for the kind words about the engine - it is a labor of love, and it is nice to hear your feedback on it!
Regarding the lack of updating to something like DirectXMath, it is mostly because I don't do lots of CPU math in the engine. There are some matrix multiplications, but not really anything that could take advantage of heavy duty SIMD operations. Because of churn in the math libraries over the past few years (D3DX, XNAMath, DirectXMath, etc...) it has been a practical choice for me to stick with the CPU based classes. My development time seems to be much lower than it has traditionally been, so I have to pick my battles wisely
Thanks for the kind words about the engine - it is a labor of love, and it is nice to hear your feedback on it!
Jason Zink :: DirectX MVP
Check out our (now available) D3D11 book: Practical Rendering and Computation with Direct3D 11
Check out my Direct3D 11 engine on CodePlex: Hieroglyph 3
Check out our free online D3D10 book: Programming Vertex, Geometry, and Pixel Shaders
Lunar Rift :: Dual-Paraboloid Mapping Article :: Parallax Occlusion Mapping Article :: Fast Silhouettes Article
Check out our (now available) D3D11 book: Practical Rendering and Computation with Direct3D 11
Check out my Direct3D 11 engine on CodePlex: Hieroglyph 3
Check out our free online D3D10 book: Programming Vertex, Geometry, and Pixel Shaders
Lunar Rift :: Dual-Paraboloid Mapping Article :: Parallax Occlusion Mapping Article :: Fast Silhouettes Article






