glTF
glTF copied to clipboard
Comment period for Draco extension
Hello everyone,
We have been working on adding Draco (geometry compression) to glTF 2.0 as an extension. The two major parts that need to be finalized are the glTF 2.0 Draco extension and the Draco bitstream specification. We would like to close the comments and finalize the extension for ratification by 10/22.
Please post any comments to this issue.
Thank you, Frank Galligan
From Alexey: The way how EdgeBreaker Connectivity section is laid out is optimized for encoders: "Split Data" section is located at the end because its contents isn't known until symbols are written. I'd argue that layout should be changed in favor of decoders (i.e. write "Split Data" first), because not every runtime environment has a notion of "file pointer" - e.g., on the web, random resource seek is not always an option so client will have to postpone decoding until "Split Data" arrival.
It reminds me the situation with "progressive MP4 streaming" ("moov" and "mdat" boxes): videos that start with "moov" could play almost instantly; otherwise client has to make several HTTP Range requests or download file entirely (not every server setup allows Range requests).
From Alexey: connectivity_method from "6.1 ParseSequentialConnectivityData()" seems to be unused in the spec. Yet, in the source code that parameter enables RANS indices compression.
-
[x] Section 2.3 mentions
push_back
andassign
fromstd::vector
. But besides those, bitstream spec uses:back
,begin
,end
,insert
, andsize
. That section should mention them too. -
[x] The spec refers several times to
pop
whilestd::vector
defines onlypop_back
. Looks like some containers must implementstd::stack
(or there're typos in the spec). -
[x] Also, what does
.get()
mean (e.g. inPredictionSchemeWrapDecodingTransform_ComputeOriginalValue
)?
-
[x]
GetNumComponents()
isn't defined. -
[x]
ProcessInteriorEdges()
isn't defined. -
[x] Statement with
is_crease_edge_pos
fromMeshPredictionSchemeConstrainedMultiParallelogramDecoder_ComputeOriginalValues
lacks function name. -
[x]
ReadEncodedData
isn't used, also title doesn't match: -
[x]
.DecodeLeastSignificantBits32
fromParseEdgebreakerStandardSymbol
isn't defined.
At this point I think we have addressed all open items. If anyone has any issues/comments/questions please post them here ASAP.
Thanks, Frank
-
[x] Please replace
[size]
with actual names of variables that should be used in:-
ParseMetadataElement
-
ParseSubMetadataKey
-
DecodeRawSymbols
-
DecodeTaggedSymbols
-
-
[x] Consider naming constant integer values for variables like:
-
scheme
inDecodeSymbols
, -
connectivity_method
inDecodeSequentialConnectivityData
, and probably other similar cases.
-
-
[x]
Float
bitstream type doesn't specify its precision (assuming single, but this should be explicit). -
[x]
f[]
bitstream type isn't defined. It's used with variable length inDecodeTaggedSymbols
and with length of 1 inParseTopologySplitEvents
. Is it an array of unaligned bits? How to interpret it? -
[ ] Since local vars lack types, it's not always obvious when division operator should be integer or float. Sure, this could be deduced from context, but I'd say that the spec should be explicit about that somehow.
-
[x] In
DecodeTaggedSymbols
,max_symbol_bit_length_t
has constant value5
, thereforeComputeRAnsUnclampedPrecision
always returns7
andComputeRAnsPrecisionFromMaxSymbolBitLength
always returns12
. Sorans_precision_bits_t
is always12
. Similar logic seems to be inlined inDecodeRawSymbols
but with variablemax_bit_length
. Why are those two helper functions needed?
- [x] Extra dot:
- [x] What does
.data()
mean inDecodeAttributeSeams
,DecodePredictionData_ConstrainedMulti
,DecodePredictionData_TexCoords
,DecodePredictionData_GeometricNormal
, andMeshPredictionSchemeConstrainedMultiParallelogramDecoder_ComputeOriginalValues
?
- [x] Consider harmonizing array semantics in bitstream types:
UI8[size]
vssize * UI8
.
- [x]
EdgebreakerValenceDecodeSymbol
andParseEdgebreakerStandardSymbol
don't have arguments, but they're used withsym
inEdgebreakerDecodeSymbol
.
- [x]
EdgebreakerValenceDecodeSymbol
refers to undefinededge_breaker_symbol_to_topology_id
array.
- [x]
CornerToVert
accepts two arguments(att_dec, corner_id)
, but all its usages inNewActiveCornerReached
provide only one.
- [x] After https://github.com/google/draco/commit/308b812c2caf14a31cedf66dea3a468ee3469d61,
curr_att_dec
is being used inNewActiveCornerReached
before its first initialization to0
inDecodeAttributeData
. Should connectivity decoder always use0
? If so it could be a separate constant value to keepcurr_att_dec
in scope of attribute data decoding.
Small question regarding f[n]
:
When bit reading is finished it will always pad the read to the current byte.
- [x] When
f[n]
is being read in a loop, should this padding happen after loop ends or after each value?
- [x] In
DecodeTaggedSymbols
before https://github.com/google/draco/pull/251/commits/cf02c772fe87992c45f5688ce82659a7918fa39b,rans_precision
was equal to4096
andl_rans_base
to16384
. After that commit,rans_precision
became undefined and one of two occurrences ofl_rans_base
has been changed to a different constant value (4096
).
- [ ]
PosOpposite
andSetPosOpposite
refer to undefinedopposite_corners_
array. What length should it have? Draco source suggests thatopposite_corners_
consists of int32 elements and its length isnum_faces * 3
.
- [x]
NewActiveCornerReached
refers to undefinedsplit_active_corners
.
- [x]
NewActiveCornerReached
sets unusedtopology_edge_list
values.
- [x] What buffer should
ParseEdgebreakerStandardSymbol
use? Isbit_symbol_buffer
somehow related toeb_symbol_buffer
?
Wow, thanks for all the feedback here!!! @FrankGalligan please close this when ready.
- [ ]
MapCornerToVertex
assigns to uninitializedcorner_to_vertex_map_[0]
.
- [x] Section 2.3 should mention
.empty()
fromstd::vector
. It's used byEdgeBreakerTraverser_ProcessCorner
,EdgeBreakerAttributeTraverser_ProcessCorner
, andPopNextCornerToTraverse
.
- [x]
first_vert_id
is used as function inRecomputeVerticesInternal
.
- [x] Is
static_cast<bool>
inConvertSymbolToSignedInt
needed to be in the spec?
- [x]
DecodeTaggedSymbols
still refers to uninitializedl_rans_base
.
- [x]
IsTopologySplit
uses pointer syntax (*
) for writing outout_face_edge
andout_encoder_split_symbol_id
;MeshPredictionSchemeTexCoordsPortablePredictor_ComputePredictedValue
uses pointer syntax for writing outpredicted_value_
. Other functions don't use*
. Is it intended?
Wow. I can't decide if I should fear or long for the day when @lexaknyazev does code review on anything I wrote. 🥇
The spec should not be using pointers. Removed.
- [x]
last_vert_added
inNewActiveCornerReached
isn't initialized.
- [x] There're slightly different usage semantics of
ans_decoder_
:-
ProcessInteriorEdges
andDecodeAttributeSeams
have local declarations ofans_decoder_
of undefined typeAnsDecoder
. There're no such declarations in other relevant places. -
DecodeTaggedSymbols
andDecodeRawSymbols
use different variable name:ans_
. -
RabsDescRead
calls inDecodeAttributeSeams
,DecodePredictionData_ConstrainedMulti
,DecodePredictionData_TexCoords
, andDecodePredictionData_GeometricNormal
use&
prefix forans_decoder_
. There's no&
in otherans_decoder_
usages.
-