Jump to content

Adding Vertex Colors to a Mesh Without Them


JohnK
 Share

Recommended Posts

Is the following correct or is there a better way of adding vertex colors to a mesh?

When you have a mesh with `mesh..getVerticesData(BABYLON.VertexBuffer.ColorKind)` returning null then you cannot use 'updateVerticesData' since there in no colorKind array to update as exampled in https://www.babylonjs-playground.com/#ZRZIIZ

So to add vertex colors you need to copy the mesh data and create a new mesh with vertex colors and dispose of the original as in https://www.babylonjs-playground.com/#ZRZIIZ#1

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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