OBD talk:OTLF: Difference between revisions

From OniGalore
Jump to navigation Jump to search
No edit summary
(I don't feel comfortable with that 12/20 bit thing.)
Line 77: Line 77:
==> 12/20: Oha... it seems, that they have changed it after Brent Pease has left Bungie. [[User:Ssg|Ssg]] 10:01, 23 April 2007 (CEST)
==> 12/20: Oha... it seems, that they have changed it after Brent Pease has left Bungie. [[User:Ssg|Ssg]] 10:01, 23 April 2007 (CEST)
:
:
---
:
I don't feel comfortable with that 12/20 bit thing. 12 bit, that means a max of 4096 gunk quads per leaf node. That seems a bit to much to me. The GDC-paper says, that 256 is the limit. Did they increased it?
:
Maybe we can look at first 4 bytes of the OTLF packages 15 and 16 (IIRC) of level 3:
:
package 15: 13000000 ==> 12 bit = 130 (hex) = 304 (dez)<BR>
package 16: 0E300100 ==> 12 bit = 0E3 (hex) = 227 (dez)
:
That's what you get, if you read the 12-bit from right to left. If you calculate the sum of all 12-bits you get 2 million and a bit. Plus the highest 12-bit is 4080, which means 4080 gunk quads in a leaf node. If you read the 12-bit from left to right, the sum ist ~ 3 milllion and the highest value 4081.
:
Maybe they've used the factor four, because a lot of the packages overlap each other. (Dunno if this is really a reason.)
:
If you look to package 16, the 20-bit ist 256 (read from right to left). What does it tell me? Start with package 256 and read 227 packages or start at position 256 and read 227 packages? Or something else?
:
[[User:Ssg|Ssg]] 16:07, 27 April 2007 (CEST)

Revision as of 14:07, 27 April 2007

7F FE FC 39 ==> 7, 127, 127, 127 ==> Is this right? Because:

level 3 - lab

7FFEFC39

01111111111111101111110000111001

01111 - 15 (min 0; max 31)
111111111 - 511 (min 0; max 511)
101111110 - 382 (min 0; max 511)
000111001 - 57 (min 3; max 319)

011111111 - 255 (min 0; max 511)
111111011 - 507 (min 0; max 511)
111100001 - 481 (min 8; max 505)
11001 - 25 (min 2; max 31)

mirrored
10011100001111110111111111111110

10011 - 19 (min 4; max 31)
100001111 - 271 (min 16; max 303)
110111111 - 447 (min 0; max 447)
111111110 - 510 (min 0; max 511)

100111000 - 312 (min 64; max 505)
011111101 - 253 (min 0; max 511)
111111111 - 511 (min 0; max 511)
11110 - 30 (min 0; max 31)

39FCFE7F

00111001111111001111111001111111

00111 - 7 (min 0; max 7)
001111111 - 127 (min 127; max 511)
001111111 - 127 (min 127; max 511)
001111111 - 127 (min 63; max 511)

001110011 - 115 (min 5; max 127)
111110011 - 499 (min 7; max 511)
111110011 - 499 (min 6; max 511)
11111 - 31 (min 0; max 31)

mirrored
11111110011111110011111110011100

11111 - 31 (min 0; max )
110011111 - 415 (min 32; max 511)
110011111 - 415 (min 32; max 511)
110011100 - 412 (min 32; max 508)

111111100 - 508 (min 1; max 511)
111111100 - 508 (min 1; max 511)
111111100 - 508 (min 1; max 511)
11100 - 28 (min 0; max 28)

So, what's the correct one? The last block looks convincing to me.

---

"Bits 0-11 (12 bits) contain the number of gunk quads that intersect this leaf, bits 12-31 (20 bits) contain the index of the gunk quad list."

Are you sure? The GDC-Paper says 8/24 bit. *wonder*

Ssg 15:31, 20 April 2007 (CEST)

Yes to both questions.

  • First one:
For the size and position you must note that the maximum position of the octree node is stored. This leads to the fact that the maximum values must all be 511 because this is the size of the octtree and no nodes can be missing. This leaves as with just to cases to consider: 7, 127, 127, 127 and 28, 508, 508, 508.
Now the size of an octtree node is always a power of 2 so 28 or 7 are not sizes but powers and 28 will be a huge size for an octtree node (in fact you need to add 4 to this value to get the power, that means 28 ends up as 32 which is even bigger...).
  • Second one:
As for 12/20 bits vs. 8/24 bits: well, there must be a reason for "*) You have to devide the offset by 4 to get the correct offset." :). Of course 4 means only a 2 bit difference but there is another 2 bit difference from the fact that it's a index and not an offset. There is no file in Oni where an array offset is used instead of an array index as far as I know.

Neo

==> 12/20: Oha... it seems, that they have changed it after Brent Pease has left Bungie. Ssg 10:01, 23 April 2007 (CEST)

---

I don't feel comfortable with that 12/20 bit thing. 12 bit, that means a max of 4096 gunk quads per leaf node. That seems a bit to much to me. The GDC-paper says, that 256 is the limit. Did they increased it?

Maybe we can look at first 4 bytes of the OTLF packages 15 and 16 (IIRC) of level 3:

package 15: 13000000 ==> 12 bit = 130 (hex) = 304 (dez)
package 16: 0E300100 ==> 12 bit = 0E3 (hex) = 227 (dez)

That's what you get, if you read the 12-bit from right to left. If you calculate the sum of all 12-bits you get 2 million and a bit. Plus the highest 12-bit is 4080, which means 4080 gunk quads in a leaf node. If you read the 12-bit from left to right, the sum ist ~ 3 milllion and the highest value 4081.

Maybe they've used the factor four, because a lot of the packages overlap each other. (Dunno if this is really a reason.)

If you look to package 16, the 20-bit ist 256 (read from right to left). What does it tell me? Start with package 256 and read 227 packages or start at position 256 and read 227 packages? Or something else?

Ssg 16:07, 27 April 2007 (CEST)