-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[3D] Add support for data defined properties of points #57929
base: master
Are you sure you want to change the base?
Conversation
This will be used by `QgsPoint3DSymbol` in the next commit.
`QgsInstancedPoint3DSymbolHandler` uses OpenGL instancing in order to draw multiple times the same entity at different locations with the same shape. In practice, this means that only two Qt3D entities are created: - one for the points which are not selected - one for the selected points Indeed, the selected points do not have the same color as the normal ones. If there isn't any selected point, only one entity is created. When a point can have a data defined radius, this logic needs to be updated. The idea is to group the points which have the same radius. This logic is handled by the `PointData` class and the `==` operator. If two different have the same state (selected or normal) and the same radius, they are grouped together in the same `PointData` instance and their respective positions are stored in `positions`. This means that if there are 3 different radii, at most 6 different entities are created: 1. Entity1: (normal, radius1) 2. Entity2: (selected, radius1) 3. Entity3: (normal, radius2) 4. Entity4: (selected, radius2) 5. Entity5: (normal, radius3) 6. Entity6: (selected, radius3) If there is only one radius, the previous case still applies.
This will be used by `QgsPoint3DSymbol` in the next commit.
This will be used by `QgsPoint3DSymbol` in the next commit.
This will be used by `QgsPoint3DSymbol` in the next commit.
This will be used by `QgsPoint3DSymbol` in the next commit.
171a697
to
db63491
Compare
BottomRadius SIP_MONKEYPATCH_COMPAT_NAME( PropertyHeight ), //!< Bottom Radius | ||
MinorRadius SIP_MONKEYPATCH_COMPAT_NAME( PropertySize ), //!< Minor Radius | ||
TopRadius SIP_MONKEYPATCH_COMPAT_NAME( PropertyHeight ), //!< Top Radius | ||
Size SIP_MONKEYPATCH_COMPAT_NAME( PropertySize ), //!< Size |
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.
Size
is not a reserved word?
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.
I don't know.
I'm wondering how well this approach scales. Eg if you had a point layer with thousands of points , and each has there own distinct height, we'll end up with a LOT of entities. Have you tested to see what the usable limits are? I suspect we would need some way to abort creating new entities early if we approach the usable limit... |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
I have the same concerns as Nyall - this approach will likely not perform well when used with slightly larger datasets, with many thousands of draw commands required. The correct solution here is to add data-defined properties to vertex buffers and handle sizing in the vertex shader code... |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
This pull request has been tagged for the changelog.
You can edit the description. Format available for credits
Thank you! |
I tried to apply your suggestion but I don't know how to write some vertex shader code which could handle the data defined properties. For example, how would it be possible to handle the |
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check
|
While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist. |
Description
This PR introduces support for data defined properties (radius, length...). This needs some changes in
QgsInstancedPoint3DSymbolHandler
. Inded, it uses OpenGL instancing in order to draw multiple times the same entity at different locations with the same shape. In practice, this means that only 2 Qt3D entities arecreated:
Indeed, the selected points do not have the same color as the normal ones. If there isn't any selected point, only one entity is created.
When a point can have a data defined shapes, this logic needs to be updated. The idea is to group the points which have the same shape. This logic is handled by the
PointData
class and the==
operator. If two different have the same state (selected or normal) and the same shape, they are grouped together in the samePointData
instance and their respective positions are stored in
positions
. With that logic, the following entities are created:...
If there is only one shape, the previous case still applies.
Example