Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Assistance of a new kind...; When you want a Dr. Best reply
Topic Started: Nov 7 2015, 12:43 PM (164 Views)
TheStolenbattenberg
Member Avatar
Advanced Member
[ *  *  * ]
Hello!

This is a question more directed to the internal workings of Ultimate3D, and because of that directly to Dr. Best. If anyone has some incite though, please share.

Me and a team have been working on a new extension for Game Maker Studio, using the sweet, sweet window_device() function they have to get the DirectX9 device. We're trying to make it compatible with as many different Game Maker 3D extensions as I can.

Currently, I've been working on the compatibility with Ultimate3D, and making it easier to convert a project from Ultimate3D to 'MA-Engine' as we call it. This includes adding support for the ASM Shaders which Ultimate3D can use, but I have no darn clue how you've handled the U3D Effect files or the shaders at all, since they all appear to rely on Varying and Constant values set outside of the Shaders, and the values such as 'VS_CONST_WORLD_VIEW_PROJ_TRANS_1' don't tell me what they do... I'm presuming it's a 4X4 Projection Matrix? But then what's _2, _3 and _4?

The other constants are also a little elusive,

Anyway, if you're willing to share any information on this, it would be great. I'd love to make the Engine support .U3D files too, so if any documentation is around for that...

Thanks,
- TSB.

P.S: If you want to see the project so you know I'm not wasting your time, I can PM you a link to a repository with it.
Ashes to ashes, Dust to dust... Honor to glory; And iron to rust. Hate to bloodshed, From rise to fall... If I never have to die; Am I alive at all?
Offline Profile Quote Post Goto Top
 
Dr. Best
Member Avatar
Administrator
[ *  *  *  *  *  * ]
I'll answer the easy part first. The *.u3d model file format is fully documented. There's also a documentation of file format version 2.0 but since this never shipped with a published version of U3D you are probably not so interested. Though, the publicly available Blender to U3D exporter can export it and generally speaking it may be useful for you to reverse engineer the exporter.

Concerning the *.ufx format I have to say that I barely remember its existence. It is approaching its 10th birthday or so. Fortunately I do not need to remember this kind of things because I document them. The answer to your specific question is that the 4x4 matrix has to be split up into four columns. The reason for this is that assembler shaders use constant registers directly and a single constant register always consists of exactly four floating point values (at least in D3D 8.1). All provided shader constants in the *.ufx format are adapted to this limitation (with the sole exception of VS_CONST_MATRIX_STACK).

Hope that helps. You may have to wait a bit longer for further replies until 23rd of November. Feel free to bump this topic in case I forget about it.
Offline Profile Quote Post Goto Top
 
TheStolenbattenberg
Member Avatar
Advanced Member
[ *  *  * ]
Okay it's awesome it's split into four because that's exactly how our own engine handles it at the moment.

I had no idea the documentation on the actual format was there, I didn't see it when I looked through recently, or even about 2 years ago when I was using U3D myself.

Ashes to ashes, Dust to dust... Honor to glory; And iron to rust. Hate to bloodshed, From rise to fall... If I never have to die; Am I alive at all?
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply