Skip to content

GLMeshItem: allow ubyte color buffers#3231

Merged
j9ac9k merged 1 commit intopyqtgraph:masterfrom
pijyoi:opengl-byte-color
Jan 28, 2025
Merged

GLMeshItem: allow ubyte color buffers#3231
j9ac9k merged 1 commit intopyqtgraph:masterfrom
pijyoi:opengl-byte-color

Conversation

@pijyoi
Copy link
Copy Markdown
Contributor

@pijyoi pijyoi commented Jan 28, 2025

When specifying colors for a large number of vertices, keeping colors as float32 (16-bytes) instead of uint8 (4-bytes) can be wasteful in memory and bandwidth.

Furthermore, trimesh colors are retrieved as uint8, which then requires conversion before being able to be used in pyqtgraph. (See the example in #3230)

MeshData doesn't do any computation on the colors besides indexing and reshaping. i.e. it is actually agnostic to the dtype.
GLMeshItem only needs to tell OpenGL whether the VBO is float32 or uint8.

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Jan 28, 2025

Thanks @pijyoi for this PR! Wonderful to see more expanding compatibility within the opengl codepaths!

@j9ac9k j9ac9k merged commit a5ac32f into pyqtgraph:master Jan 28, 2025
29 checks passed
@pijyoi pijyoi deleted the opengl-byte-color branch January 28, 2025 21:44
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