Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Drawing dashed line with QSGSimpleMaterialShader
Qt 6.11 is out! See what's new in the release blog

Drawing dashed line with QSGSimpleMaterialShader

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 820 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    polaris
    wrote on last edited by
    #1

    As I understand there is no way to draw dashed line in Qt Quick Scene Graph so I decided to create shader material to do this.
    I'm trying to apply this approach http://korkd.com/2012/02/15/dashed-lines/ to this example http://doc.qt.io/qt-5/qtquick-scenegraph-simplematerial-example.html.

    • How can I get ModelView matrix in my shader? I need to multiply ModelView matrix by vertex to get its current position.
    • How in this example works QSGGeometry::defaultAttributes_TexturedPoint2D? What values does it store?
    • How can I pass sourcePoint (the first point of a line) to my shader?

    If someone knows better way to draw dashed line I would be grateful to you for telling me it.

    Regards, Artem

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved