Jump to content

Interleaved Vertex Attribs?


Recommended Posts

Not sure if I might check out Babylon.js more in the future or not, but I'm kind of curious I guess, does Babylon.js interleave vertex attributes on meshes automatically?

I'll admit I don't know the cost of not interleaving attributes on modern hardware, and imagine it's not that bad even on mobile; but it just seems shocking and lazy to me for JS engines not to do things the right way™ for reasons I don't understand (Javascript elegance?)

Note: italics and TM symbol are my way of trying to acknowledge that I'm probably being stupid with this, ie. plz don't take this too seriously

Link to comment
Share on other sites

I guess you are talking about the (VNCVNC...) approach here : https://www.opengl.org/wiki/Vertex_Specification_Best_Practices


Unless it's done at some higher level in the code, I'm not sure it is the way BJS uses : https://github.com/BabylonJS/Babylon.js/blob/master/src/babylon.engine.ts#L1027


DK would probably answer better than me to this question.

Link to comment
Share on other sites

Thanks Jerome! Looking at that code it looks like it might be supported


                var offset = 0;                for (var index = 0; index < vertexDeclaration.length; index++) {                    var order = effect.getAttributeLocation(index);                    if (order >= 0) {                        this._gl.vertexAttribPointer(order, vertexDeclaration[index], this._gl.FLOAT, false, vertexStrideSize, offset);                    }                    offset += vertexDeclaration[index] * 4;
Link to comment
Share on other sites

@chg - you're bored, aren't you?  :D


(just kidding around).  :)


But also, the primary authors of the BabylonJS framework... are excellently kind.  So, grab that engine.js and hack that puppy until it does what you want, and even put your name on it afterwards!  (Even though you'll know you owe some creds.)  heh


The point is...  its open source, its JS, just whack it into doing whatever you want it to do.  :)  That's the delicious part.  And we got cool collab in our forum, too, eh? 


"Not sure if I might check out Babylon.js more in the future or not"


@chg - help a few forum users... by fixing their playgrounds, and in 90 days... we'll own you.  :D  You'll be so addicted to BJS that you'll never look back.  I think you'd make an excellent framework hacker/devver, chg.  I think you should just stick around with us, and help us torture stuff and blow stuff up. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...