You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basic support for picking metadata (from property textures) was added in #12075. Most of the tests happened based on the SimplePropertyTexture sample and the examples that are generated on the fly, in the specs. These do not cover the different combinations of offset/scale values that may be defined as part of the 'class property' or based on the 'property texture property' (overriding the one from the 'class property'). This can lead to wrong metadata values to be reported (as noticed in a PR that is supposed to use this new functionality).
An atttempt to summarize the approach and highlight the problem:
Values from property textures are converted into "metadata values" as part of the standard metadata handling in the shaders. For example, a "raw" value of 127 that is stored in the texture as a 'normalized UINT8' will be converted into the value ~0.5.
The picking writes these values into "colors/color components", which are then written into the metadata picking frame buffer (ending up as values in [0, 256) there)
These values are read from the frame buffer, and converted back into the proper "metadata values"
There is quite a lot of back-and-forth conversion going on, depending on the component type, the normalization, and whether the values include an 'offset' or 'scale'. And the latter is not properly taken into account. This means that a normalized UINT8 metadata value like 127 with offset=1.0 and scale=2.0 that should be 1.0 + 2.0 * ~0.5 = 2.0 was clamped to 255 in the output, and therefore, converted back to 1.0 instead of 2.0.
The text was updated successfully, but these errors were encountered:
Basic support for picking metadata (from property textures) was added in #12075. Most of the tests happened based on the
SimplePropertyTexture
sample and the examples that are generated on the fly, in the specs. These do not cover the different combinations ofoffset
/scale
values that may be defined as part of the 'class property' or based on the 'property texture property' (overriding the one from the 'class property'). This can lead to wrong metadata values to be reported (as noticed in a PR that is supposed to use this new functionality).An atttempt to summarize the approach and highlight the problem:
UINT8
' will be converted into the value ~0.5.There is quite a lot of back-and-forth conversion going on, depending on the component type, the normalization, and whether the values include an 'offset' or 'scale'. And the latter is not properly taken into account. This means that a normalized
UINT8
metadata value like 127 withoffset=1.0
andscale=2.0
that should be1.0 + 2.0 * ~0.5 = 2.0
was clamped to255
in the output, and therefore, converted back to1.0
instead of2.0
.The text was updated successfully, but these errors were encountered: