- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.5k
 
[DOCS] Document APIs related to vertex attributes #1898
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
[DOCS] Document APIs related to vertex attributes #1898
Conversation
…r) into a separate interface VertexAttributeDescription
…scription) with additional vertex buffer layout data.
| 
           @willeastcott Feel I need to add some background here since this PR includes code changes which I strongly want to avoid when my objective is to fix typings and documentation. The biggest challenge I had with this PR was to document  
 I went with option 2 because I believe duplication will not only hurt readability and maintainability but also eventually lead to de-sync and confusing code documentation.  | 
    
| 
           Just wanted to drop a quick comment in here. I've scanned the changes here and my reflex reaction is that I suspect this has the potential to break the Editor and certain PlayCanvas apps that leverage this part of the API. I'd have to do a more thorough investigation to weigh up the risks around that. But in short, I can't merge this as fast as your other PRs from yesterday.  | 
    
| 
           @willeastcott If you are wary about the code changes, I could go with option 1 as described in my previous comment: 
  | 
    
| 
           @willeastcott I've removed all code changes (by going with option 1) in the hopes getting this PR rolling :)  | 
    
| 
           @willeastcott Have you had the chance to take a new look at the PR?  | 
    
| 
           Hello @willeastcott, I've reverted all jsdoc for the  Also simplified  Let me know if you have any more comments or thoughts.  | 
    
| 
           Let me put my concern another way. After this PR is merged, I would consult the API ref and assume I can do this: But that would return false.  | 
    
| 
           @willeastcott Fixed. I just thought we preferred avoiding code changes this time around :) 
 EDIT: PR description is also updated.  | 
    
| 
           @willeastcott Any chance we could merge and close this PR? :D Let me know if there is anything else I can do to get the PR moving. I'm happy to address any remaining concerns. Adding proper documentation and typings for this important part of the API, would be very valuable to us and others.  | 
    
| 
           @willeastcott Would it help if I just removed  Or are there plans to deprecate this whole API? Is that why you're reluctant?  | 
    
| 
           Yeah, sorry this PR is still in limbo. 😞 Actually, it's still  As for   | 
    
| 
           @willeastcott Thank you for responding. I know you mentioned before that you're not keen on new classes just to fix typings. I responded by trying to argue that  Anyhow, I hear you. I agree, iterating vertices in a interleaved vertex buffer is inefficient. The thing is, that interleaved data still considered to have better rendering performance. And from what I've seen in #1960, that PR will not provide a complete substitute for creating and accessing a interleaved buffer. And if a developer only needs to update/create a "procedural" mesh once, they should still have the option of choosing these "legacy" APIs for highest draw performance. Additionally, as you know we're trying to write an glTF exporter for PlayCanvas. And having proper access to APIs like   | 
    
This reverts commit cac35e7.
…VertexIteratorAccessor ctor (param vertexElement) individually
| 
           Alright, @willeastcott. I've removed the new class  I'm just making one existing class  Additionally, as mentioned before, the new procedural mesh API won't completely replace the need for   | 
    
| 
           This looks in good shape now. But I have merge #1960 first - a word of warning: there will be some merge conflicts after that. But hopefully they'll be easy to resolve.  | 
    
# Conflicts: # src/graphics/vertex-format.js # src/graphics/vertex-iterator.js
| 
           Thanks for your patience on this one, @aidinabedi. Feels great to finally merge it. 🎉  | 
    
The description is updated to reflect the latest changes based on feedback.
The PR includes the following:
pc.VertexIterator#element.pc.VertexIteratorAccessorand its methods.I confirm I have signed the Contributor License Agreement.