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

Update colors to be normalized #31

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

paireks
Copy link
Member

@paireks paireks commented Mar 11, 2024

Correct me if I'm wrong, colors in xeokit v3 should be normalized (0-1 range)?

@paireks
Copy link
Member Author

paireks commented Mar 11, 2024

Additionally I can try to update face_colors, but I'm thinking what would be the best way. In .bim each element can have face_colors attached. I see SceneGeometryParams contains colors, but these are vertex colors. Should I convert face_colors array into vertex colors array and try to place it there?

@xeolabs
Copy link
Member

xeolabs commented Mar 11, 2024

Correct me if I'm wrong, colors in xeokit v3 should be normalized (0-1 range)?

Yes, in the SceneMeshes they are stored as normalized values between [0..1], then internally stored in textures as [0..255] for drawing by the shaders (to use 8-bits for minimal storage size in the texture).

@xeolabs
Copy link
Member

xeolabs commented Mar 11, 2024

Additionally I can try to update face_colors, but I'm thinking what would be the best way. In .bim each element can have face_colors attached. I see SceneGeometryParams contains colors, but these are vertex colors. Should I convert face_colors array into vertex colors array and try to place it there?

Yes, I think this is the way to go.

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