Coder Social home page Coder Social logo

Comments (5)

stevenvergenz avatar stevenvergenz commented on May 22, 2024

I think you're just looking at the wrong part of the spec. From the byte stride definition:

The stride, in bytes, between vertex attributes. When this is not defined, data is tightly packed. When two or more accessors use the same bufferView, this field must be defined. Minimum value: 4.

"Between" attributes suggests to me that it does not include the size of the component, implying that a byteStride of 0 would also indicate densely-packed data, but the spec authors prefer to omit the value entirely in this case.

The current algorithm has worked on all the sample models we've tried, but I admit it's possible that we misinterpreted. I don't think any of them use interleaved attributes or anything with byteStride. I'll ask the spec group.

from unitygltf.

anthonysteed avatar anthonysteed commented on May 22, 2024

I just think it is ambiguous, if you read this statement:

Each accessor must fit its bufferView, i.e., accessor.byteOffset + STRIDE * (accessor.count - 1) + >SIZE_OF_ELEMENT must be less than or equal to bufferView.length.

Then it implies the stride is the total stride, not the padding.

from unitygltf.

anthonysteed avatar anthonysteed commented on May 22, 2024

Wrong button.

This statement implies that the stride is the total stride, not the padding

Each accessor must fit its bufferView, i.e., accessor.byteOffset + STRIDE * (accessor.count - 1) +
SIZE_OF_ELEMENT must be less than or equal to bufferView.length.

from unitygltf.

stevenvergenz avatar stevenvergenz commented on May 22, 2024

Well, it looks like you're right, though it took some digging. The byteStride definition references WebGL's vertexAttribPointer's stride parameter, which reads:

A GLsizei specifying the offset in bytes between the beginning of consecutive vertex attributes. Cannot be larger than 255.

That's unambiguous. I'll get this fixed soon.

from unitygltf.

stevenvergenz avatar stevenvergenz commented on May 22, 2024

Fixed in 019b1c6

from unitygltf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.