Skip to content
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

Support Vertex Colors #26

Open
albertso opened this issue Aug 6, 2024 · 2 comments
Open

Support Vertex Colors #26

albertso opened this issue Aug 6, 2024 · 2 comments
Assignees

Comments

@albertso
Copy link

albertso commented Aug 6, 2024

It would be nice to have support for vertex colors, with interpolation of color in subdivided levels, like in Blender.
Currently vertex colors disappear even when subdivisions are at level 0.
Anyways, great job!

@tefusion tefusion self-assigned this Aug 15, 2024
@tefusion
Copy link
Owner

Should be doable, could you point/give me a test file though? If not I'll just test it with a quick cube from blender. Interpolating colors works the same as UV's (face varying) so this should be straightforward to add. I'll probably add it this or next week, wanted to test if 4.3 broke anything anyways.

@tefusion
Copy link
Owner

tefusion commented Sep 6, 2024

I added it on the dev branch in 7eb2189. You can download the prebuilt version from from github actions. It'd be nice if you could test this since I really don't use vertex colors a lot besides simple shaders and don't have test larger test files.

The mesh needs to have UV data (If you export gltf from blender/any 3D editor it should always be there unless explicitly disabled) Otherwise it will show a warning in the editor that colors are ignored on import since the face varying index array is build based on UV data (gltf throws out all topology data so the importer tries to reconstruct it. If UV's overlap some vertex colors might be lost. I don't want to hack this in by doing another equality check for vertex colors so until I come up with a good way to abstract face varying data and find the time to implement this I won't merge this to main (simplest solution is to just make a new class with a hash function for construction, but the importer needs cleaning in general so this will take a while).

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

No branches or pull requests

2 participants