Giter Site home page Giter Site logo

Comments (5)

pwuertz avatar pwuertz commented on July 19, 2024

Hi there! Yes, the Qt graphics stack indeed changed quite a bit. Most of the new concepts are explained in https://doc.qt.io/qt-6/topics-graphics.html and https://doc.qt.io/qt-6/qtshadertools-index.html.

I think I got the gist of how to port the shader code to the new framework:

  • Custom vertex/fragment shaders like those used for colormapped image data must be ported to a "Vulkan-compatible GLSL" format, which probably isn't much of an issue.

  • At build time, the build system needs to compile all shader sources to ".qsb" files and include those in the application's QML resources. This requires porting the library to CMake.

Now, the part I haven't understood is how you'd port the custom OpenGL code for creating and updating grayscale float textures, drawing lines and drawing point sprites. Qt RHI might simply not provide a solution for those features, in which case you'd have to implement those code paths for every single backend to be supported. At least I presume Qt will still let you write target specific code..

from qmlplotting.

FelixvdDonk avatar FelixvdDonk commented on July 19, 2024

I will start with getting the XYPlot working first.

https://doc-snapshots.qt.io/qt6-dev/qsggeometry.html#DrawingMode-enum

The drawing mode allows you to set it to draw lines, that would still work I think? I guess the RHI selects the right call there instead of GL_LINE_STRIP. The sprites could also be geometry with a fill I would think? Perhaps that is also more performant. Currently having the points enabled is quite costly

from qmlplotting.

pwuertz avatar pwuertz commented on July 19, 2024

Right, RHI / QSGGeometry provides an abstraction for the GL drawing mode, so drawing line strips and simple points should still work. Point sprites on the other hand are somewhat of an OpenGL high level speciality if I recall correctly. According to some benchmarks I found point-sprites are the fastest solution on NVidia and AMD compared to geometry shader or instancing solutions. Performance on other systems depends on the quality of the GL driver implementation ofc.

Porting the xy-marker renderer to RHI seems a bit more involved though. The next best thing after point-sprites is instanced rendering, but Qt doesn't support it through RHI. At the moment, it looks like one would have to fall back to backend specific solutions for this, i.e. implement the preferred solution on each supported backend.

from qmlplotting.

pwuertz avatar pwuertz commented on July 19, 2024

FYI @FelixvdDonk, I also started porting some things to Qt6 now and created QtQuickPlotScene as a continuation from QmlPlotting. QmlPlotting was based on a very early Qt5 version with extremely limited C++/Qml interoperability, so the API looks kind of ridiculous from today's perspective - something I'd like to change in the new project.

from qmlplotting.

pwuertz avatar pwuertz commented on July 19, 2024

tl;dr I'll keep this project here around as-is and do the Qt6 port at QtQuickPlotScene.

from qmlplotting.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.