Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to Interpret vertex-data (DX9)

54 views
Skip to first unread message

R.Wieser

unread,
Sep 4, 2012, 7:04:41 AM9/4/12
to
Hello all,

I'm looking at some vertex-data, but I can't make much of it. Especially as
it seems to use D3DFVF flags at positions I cannot find any info about.
Next to that the sizes and types of the stored values seem to change (int,
half-float), which is also something I did not find any reference to ..

As far as I can tell the below is a single vertex-definition:

0000 - 8F BF 93 B1 B6 BD 00 3C A1 35 E1 B7 FE 0B 70 BF
0010 - 36 EA B1 3E 19 3D 37 3A A8 EE 50 FF

Its type is(?) 1B003102.

I've got several problems here:

1) As far as I can tell the first 3 groups of two bytes are the vertices,
but no idea what number-type is. I've tried 2-byte integers, half, dword-
and quad-word floats. Some seemed to be promising, but failed later on in
the vertex-list (but maybe the float16-to-float32 conversion I found is
incomplete though: it does not seem to handle denormalized numbers)

2) I've got no idea what the fourth group of two bytes is (3C00). Just
padding for a DWORD alignment ?

3) The "3" in the type baffles me. Although the low bit could be
D3DFVF_LASTBETA_UBYTE4, there is no data to apply it to ....

4) Is the "1B" in the type significant ? Might those contain info to the
value type & sizes (int, float, 16 ... 64 bits) ?

The question boils down to: can someone help me (with info about to how to)
decompose such a vertex ?

Regards,
Rudy Wieser



Richard [Microsoft Direct3D MVP]

unread,
Sep 5, 2012, 9:45:06 PM9/5/12
to
[Please do not mail me a copy of your followup]

"R.Wieser" <add...@not.available> spake the secret code
<5045df3f$0$6893$e4fe...@news2.news.xs4all.nl> thusly:

>The question boils down to: can someone help me (with info about to how to)
>decompose such a vertex ?

In D3D9 you can either use an FVF code to describe a vertex, or you
can create a vertex declaration. The vertex declaration is the more
general of the two. If all you have is raw data from a vertex buffer,
then you have no way of knowing, without additional information,
whether it was created with an FVF code or a vertex declaration.

However, the only reason you would have the raw data and not the code
that creates the data is because you're reverse engineering someone
else's game or content and that's not considered a nice thing to do,
and may be a violation of law depending on where you live.
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
The Terminals Wiki <http://terminals.classiccmp.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>

R.Wieser

unread,
Sep 6, 2012, 9:24:14 AM9/6/12
to
Hello Richard,

> If all you have is raw data from a vertex buffer, then
> you have no way of knowing, without additional
> information, whether it was created with an FVF
> code or a vertex declaration.

Well, I know the size of the vertex record. I also posted, as fas as I know,
the vertex definition bitflags, that 1B003102 value, as both are stored in
the data file

Some further experimenting did show me that the upper byte (that 1B) most
likely indicates the size & type of the components stored in the vertex
record.

By the way: I found a vertex record of just 4 bytes (example: 17 5E AC 82)
with a type of 9A000001. As far as I could tell fron the DirectX 9 docs the
low bit is reserved ...

> However, the only reason you would have the raw data
> and not the code that creates the data is because you're
> reverse engineering someone else's game or content and
> that's not considered a nice thing to do, and may be a
> violation of law depending on where you live.

Yes, its from a game. I don't know if you can call displaying available
graphics data by way of code I wrote myself reverse-engeneering though
(hint: I'm not touching the games code). Also, its fully for my own
enjoyment and education (no intent to market or even spread it).

Although ... I've got an alterior motive: There is an area in the game
which you are not designed to go, and I wanted to see if I could change some
collision-data to create an entrance. And before you ask, its a
single-player game (the only one I could cheat would be myself :-) ).

> and may be a violation of law depending on where you live.

Its not my intention to put myself on the wrong side of the law for
something like this. As far as I know (IANAL) I'm not breaking any
aplicable laws by doing the above.

Regards,
Rudy Wieser

P.s
I did change a configuration file for the game, causing most NPCs to
disregard me no matter what I did (even punch them in the face). Would that
tinkering be breaking the law ? :-o :-p


-- Origional message:
Richard [Microsoft Direct3D MVP] <legaliz...@mail.xmission.com> schreef
in berichtnieuws k28v72$or2$1...@news.xmission.com...

Richard [Microsoft Direct3D MVP]

unread,
Sep 12, 2012, 7:46:35 PM9/12/12
to
[Please do not mail me a copy of your followup]

"R.Wieser" <add...@not.available> spake the secret code
<5048a2ee$0$6889$e4fe...@news2.news.xs4all.nl> thusly:

>> However, the only reason you would have the raw data
>> and not the code that creates the data is because you're
>> reverse engineering someone else's game or content and
>> that's not considered a nice thing to do, and may be a
>> violation of law depending on where you live.
>
>Yes, its from a game. I don't know if you can call displaying available
>graphics data by way of code I wrote myself reverse-engeneering though
>(hint: I'm not touching the games code).

For the purposes of IP law, it doesn't matter. It also doesn't matter
that what you're doing is for your own enjoyment/education.

I'm not saying I agree with those positions, but they are the
positions that the law takes on this matter.

R.Wieser

unread,
Sep 13, 2012, 4:48:56 AM9/13/12
to
> For the purposes of IP law, it doesn't matter.

Actually, yes it does. There are a few exceptions in there.

> It also doesn't matter that what you're doing is
> for your own enjoyment/education.

And again, it does.

> I'm not saying I agree with those positions, but they are the
> positions that the law takes on this matter.

Please be(come) aware that the world exists outof more places that the US of
A , and that those other places could-and-do have more liberal/less
constraining rules, especially when personal enjoyment (lots of leeway where
I'm living) and/or education (some specific exclusions) is involved.

Apart from that, I could also have, if all I was after where those models,
intercepted them when they are handed-off to the DX9 engine. That would
have given me some quite specific information to work with as opposed to the
method I'm using now (reading and interpreting the raw game-data).

Regards,
Rudy Wieser


-- Origional message
Richard [Microsoft Direct3D MVP] <legaliz...@mail.xmission.com> schreef
in berichtnieuws k2r6sr$lfb$1...@news.xmission.com...
0 new messages