mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-04-23 06:09:57 +08:00
Merge pull request #208 from google/update_conv
Update conventions text of spec
This commit is contained in:
commit
4f77ea0ac2
@ -1,33 +1,156 @@
|
||||
## Conventions
|
||||
|
||||
### General Conventions
|
||||
### Draco File Format
|
||||
|
||||
* All Draco encoded mesh files are comprised of four main sections. This first
|
||||
section is the header. The second section contains the metadata. This section is optional. The third section contains the connectivity data. The fourth section contains the attribute data.
|
||||
|
||||

|
||||
|
||||
* The header must be decoded first, then the metadata section (if present), then the connectivity section, and then the attribute section.
|
||||
|
||||
|
||||
#### Sequential Connectivity
|
||||
|
||||
* The sequential connectivity is comprised of two sections. The first section is the connectivity header. The second section is the indices data.
|
||||
|
||||

|
||||
|
||||
|
||||
#### EdgeBreaker Connectivity
|
||||
|
||||
* The EdgeBreaker connectivity section is composed of five sections. The first section is the connectivity header. The second section is the encoded EdgeBreaker symbol data. The third section is the encoded start face configuration data. The fourth section is the encoded split data.The fifth section is the attribute connectivity data.
|
||||
|
||||

|
||||
|
||||
|
||||
* The encoded split data must be decoded before the EdgeBreaker symbols are decoded. The offset to the split data is contained in the connectivity header.
|
||||
|
||||
|
||||
#### Valence EdgeBreaker Connectivity
|
||||
|
||||
* The valence EdgeBreaker connectivity inserts two sections in between the start face data and the split data. The first section is the EdgeBreaker valence header. The second section is the context data for the valence prediction.
|
||||
|
||||

|
||||
|
||||
|
||||
#### Attributes
|
||||
|
||||
* The attributes data contains two sections. The first section is the attribute header. The second section is comprised of one or more attribute types, such as positions, texture coordinates, normals… Each attribute type section is comprised of one or more unique attributes.
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
### Draco Conventions
|
||||
|
||||
* When bit reading is finished it will always pad the read to the current
|
||||
byte.
|
||||
|
||||
* varUI32 and varUI64 types must be decoded by the DecodeVarint() function.
|
||||
|
||||
* Draco encoded mesh files are comprised of three main sections. This first
|
||||
section is the header. The second section contains the connectivity data.
|
||||
The third section contains the attribute data. The header must be decoded
|
||||
first, then the connectivity section, and then the attribute section.
|
||||
|
||||
* The Connectivity section is composed of the following sections in order:
|
||||
### General Conventions
|
||||
|
||||
* Connectivity header
|
||||
|
||||
* EdgeBreaker symbol buffer
|
||||
The mathematical operators and their precedence rules used to describe this
|
||||
Specification are similar to those used in the C programming language.
|
||||
|
||||
* Start face buffer
|
||||
Assignment of an array is represented using the normal notation `A = B` and is
|
||||
specified to mean the same as doing both the individual assignments
|
||||
`A[ 0 ] = B[ 0 ]` and `A[ 1 ] = B[ 1 ].` Equality testing of 2 arrays is
|
||||
represented using the notation `A == B` and is specified to mean the same as
|
||||
`(A[ 0 ] == B[ 0 ] && A[ 1 ] == B[ 1 ])`. Inequality testing is defined as
|
||||
`A != B` and is specified to mean the same as
|
||||
`(A[ 0 ] != B[ 0 ] || A[ 1 ] != B[ 1 ])`. The functions `assign` and
|
||||
`push_back` behave simialrily on arrays as it is defined for c++ std::vector.
|
||||
|
||||
* EdgeBreaker valence header
|
||||
When a variable is said to be representable by a signed integer with `x` bits,
|
||||
it means that the variable is greater than or equal to `-(1 << (x-1))`, and that
|
||||
the variable is less than or equal to `(1 << (x-1))-1`.
|
||||
|
||||
* Context data for the valence prediction
|
||||
|
||||
* Split data
|
||||
### Arithmetic operators
|
||||
|
||||
| | |
|
||||
|:--------:| ------- |
|
||||
| `+` | Addition
|
||||
| `–` | Subtraction (as a binary operator) or negation (as a unary prefix operator)
|
||||
| `*` | Multiplication
|
||||
| `/` | Division
|
||||
| `a % b` | Remainder from division of `a` by `b`. Both `a` and `b` are positive integers.
|
||||
{:.conventions }
|
||||
|
||||
|
||||
### Logical operators
|
||||
|
||||
| | |
|
||||
|:--------:| ------- |
|
||||
| `a && b` | Logical AND operation between `a` and `b`
|
||||
| `a || b` | Logical OR operation between `a` and `b`
|
||||
| `!` | Logical NOT operation.
|
||||
{:.conventions }
|
||||
|
||||
|
||||
### Relational operators
|
||||
|
||||
| | |
|
||||
|:--------:| ------- |
|
||||
| `>` | Greater than
|
||||
| `>=` | Greater than or equal to
|
||||
| `<` | Less than
|
||||
| `<=` | Less than or equal to
|
||||
| `==` | Equal to
|
||||
| `!=` | Not equal to
|
||||
{:.conventions }
|
||||
|
||||
|
||||
### Bitwise operators
|
||||
|
||||
| | |
|
||||
|:--------:| ------- |
|
||||
| `&` | AND operation
|
||||
| `|` | OR operation
|
||||
| `~` | Negation operation
|
||||
| `a >> b` | Shift `a` in 2's complement binary integer representation format to the right by `b` bit positions. This operator is only used with `b` being a non-negative integer. Bits shifted into the MSBs as a result of the right shift have a value equal to the MSB of `a` prior to the shift operation.
|
||||
| `a << b` | Shift `a` in 2's complement binary integer representation format to the left by `b` bit positions. This operator is only used with `b` being a non-negative integer. Bits shifted into the LSBs as a result of the left shift have a value equal to `0`.
|
||||
{:.conventions }
|
||||
|
||||
|
||||
### Assignment
|
||||
|
||||
| | |
|
||||
|:--------:| ------- |
|
||||
| `=` | Assignment operator
|
||||
| `++` | Increment, `x++` is equivalent to `x = x + 1`. When this operator is used for an array index, the variable value is obtained before the auto increment operation
|
||||
| `--` | Decrement, i.e. `x--` is equivalent to `x = x - 1`. When this operator is used for an array index, the variable value is obtained before the auto decrement operation
|
||||
| `+=` | Addition assignment operator, for example `x += 3` corresponds to `x = x + 3`
|
||||
| `-=` | Subtraction assignment operator, for example `x -= 3` corresponds to `x = x - 3`
|
||||
{:.conventions }
|
||||
|
||||
|
||||
|
||||
### Mathematical functions
|
||||
|
||||
The following mathematical functions (Abs, Min, and Max)
|
||||
are defined as follows:
|
||||
|
||||
<script type="math/asciimath">
|
||||
"Abs"(x)={[x;,x >= 0],[-x;,x<0]}
|
||||
</script>
|
||||
|
||||
<br>
|
||||
|
||||
<script type="math/asciimath">
|
||||
"Min"(x,y)={[x;,x<=y],[y;,x>y]}
|
||||
</script>
|
||||
|
||||
<br>
|
||||
|
||||
<script type="math/asciimath">
|
||||
"Max"(x,y)={[x;,x>=y],[y;,x<y]}
|
||||
</script>
|
||||
|
||||
* The split data must be decoded before the EdgeBreaker symbols are
|
||||
decoded.
|
||||
|
||||
### Method of describing bitstream syntax
|
||||
|
||||
|
BIN
docs/spec/images/attributes.png
Executable file
BIN
docs/spec/images/attributes.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 7.6 KiB |
BIN
docs/spec/images/draco_file.png
Executable file
BIN
docs/spec/images/draco_file.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 4.6 KiB |
BIN
docs/spec/images/edgebreaker_connectivity.png
Executable file
BIN
docs/spec/images/edgebreaker_connectivity.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 7.6 KiB |
BIN
docs/spec/images/edgebreaker_valence_connectivity.png
Executable file
BIN
docs/spec/images/edgebreaker_valence_connectivity.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 8.3 KiB |
BIN
docs/spec/images/sequential_connectivity.png
Executable file
BIN
docs/spec/images/sequential_connectivity.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
Loading…
x
Reference in New Issue
Block a user