Skip to content

[FEATURE] Supporting vertex colors for gltf loading#1845

Draft
paireks wants to merge 3 commits intoxeokit:masterfrom
paireks:develop/VertexColorsInGltf
Draft

[FEATURE] Supporting vertex colors for gltf loading#1845
paireks wants to merge 3 commits intoxeokit:masterfrom
paireks:develop/VertexColorsInGltf

Conversation

@paireks
Copy link
Member

@paireks paireks commented Mar 31, 2025

Hey @xeolabs and @MichalDybizbanskiCreoox!

I wanted to add vertex color support to our gltf loader. This PR is adding it, so we can load it like this:
2025-03-31_13h58_22

The thing I cannot figure out is loading existing HousePlan file. After a change it looks like this:
2025-03-31_14h30_10

When I debugged it, it looks like this model contains the vertex colors, that are all (1,1,1,1) -> (which is all white), that's why it changed this color to white. Some other models don't have that, they just don't have vertex colors. I don't think ignoring vertex colors when they are all 1,1,1,1 is a good approach. Please let me know if you have an idea how to handle this.

Also, if you will find anything else during review: please let me know.

This topic is connected with XCD-273.

@paireks paireks force-pushed the develop/VertexColorsInGltf branch from b822c16 to b55474a Compare March 31, 2025 13:46
@paireks paireks removed the percy label Mar 31, 2025
@paireks
Copy link
Member Author

paireks commented Apr 1, 2025

Ok, after reading a bit more of documentation and experiments I think I get it a bit more, hope to discuss it tomorrow with you

@paireks
Copy link
Member Author

paireks commented Apr 3, 2025

So after a change (as the specification suggests) there is a mutiplication of a base color by vertex colors multipliers. It is a bit of a workaround to store this result of multiplication inside the ".colors", but this way the existing models should look same as before, even if they had these multipliers [1,1,1,1] like here:
Przechwytywanie2

Plus I added an example of a box with a base color AND vertex colors, and after this change it looks similiar to the existing viewers (because of this multiplication):
Przechwytywanie5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants