-
Notifications
You must be signed in to change notification settings - Fork 60
Scatter markers and other scatter features #913
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
Conversation
Yes it's purpose if to rotate the marker; the little image that we draw at the position of the point. So very specific to the PointsMarkerMaterial even. |
Someday, a user will come by with a use-case 😉 But I agree that in this context its fine to select at instantiation. And ppl can always modify the |
Yea I could implement it but I don't want to do it now. For example if you go from markers to sprites, you have to clear the geometry markers buffer and anything related to markers and then create a new texture. Lots of things to keep track of. |
|
OK I need to change |
… a class attribute
|
Need to update the garbage collection test nb because depending on the scatter mode some features can be |
|
It's going to fail with the release version until pygfx/pygfx#1219 is in the release. |
clewis7
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM

After pygfx/pygfx#1208 we can have per-vertex scatter markers 🎉 . After this PR I think we cover the full space of the pygfx points API.
VertexMarkersbuffer manager for fancy indexing of markersUniformMarkergraphic featurePointsRotationsbuffer managerUniformEdgeColorEdgeWidthUniformRotationsScatterGraphic(image=...)VertexMarkersbuffer managerPointsRotationsbuffer managerI think search sorted can be used to map user marker -> "standard" marker string, not just the ints which is already done,let's skip this until we hit performance issues for a use case.This PR also makes a few other changes to graphic features that aren't specific to scatters:
property_nameis now an instance attribute instead of a class attribute. And the value of thetypefield of the emitted event dict comes from theproperty_nameinstance attribute. This let's us use theVertexColorsbuffer manager for both per-point vertex face colors AND edge colors and keep their property_name different when used within the same graphic. Similar thing forTextureArray@almarklein the only usecase of per-vertex rotations is for points right, I don't see how that would make sense for any other type of object (ex: lines).
The
PointsMaterialthat is chosen depends on the marker mode (basic, marker shapes, image (sprites), or gaussian). By default it will usePointsMarkerMaterialbecause distinct markers are the most common scientific use case. Once an object has been instantiated you can't switch between the materials. I think let's keep it that way unless someone has a usecase, I can't think of one @almarklein @clewis7 .I wonder what the purpose of the basic
PointsMaterialis when we have markers. @almarklein have you benchmarked performance?