-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes issue with framing a quantized GLTF #2463
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
*/ | ||
export const getNormalizedComponentScale = | ||
(buffer: BufferAttribute|InterleavedBufferAttribute) => { | ||
const array: ArrayLike<number> = buffer.array; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May need to check buffer.normalized
here - the array could be Uint8Array but not normalized.
No problem, I can add this check. Do you per-chance know of a model that
falls into this category of having UInt8Array of position data (for
instance) but is not normalized?
…On Sat, Jun 12, 2021 at 1:24 PM Don McCurdy ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In packages/model-viewer/src/three-components/ModelUtils.ts
<#2463 (comment)>:
>
+
+/**
+ * Gets a scale value to perform inverse quantization of a vertex value
+ * Reference:
+ * https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization#encoding-quantized-data
+ * @param buffer A gltf vertex buffer
+ * @returns A scale value based on KHR_mesh_quantization or 1 if the buffer is
+ * not quantized.
+ */
+export const getNormalizedComponentScale =
+ (buffer: BufferAttribute|InterleavedBufferAttribute) => {
+ const array: ArrayLike<number> = buffer.array;
May need to check buffer.normalized here - the array could be Uint8Array
but not normalized.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#2463 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABZY3MTIVSQHTPBTNGXJJXTTSO7BNANCNFSM46K53ZQQ>
.
|
Sure, gltfpack produces models like that — here's an aggressively quantized duck for example: |
Resolve framing/rendering issue with quantized models.
fixes #2450
Reference Issue