Commit Graph

865 Commits

Author SHA1 Message Date
Mike Krus 490fa176b6 Fix deprecated API usage and compile warnings
- QVariant::Type deprecated, use QMetaType related APIs
- QNodeId not used as reference in for loops (nop but really noisy)
- some unused code

Pick-to: 6.0
Change-Id: I08f72181ae6eeb369ca41015a21813cd7bf05231
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-11-23 17:18:02 +00:00
Mike Krus cbe7310d2a Fix build for latest qtbase changes
Change-Id: Ifc20f29a849be695558851d5ea01a68f94c35f26
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-11-05 11:14:56 +00:00
Mike Krus f5f6a5ccbd Finish removing traces of Scene3DView
Change-Id: I450e53cc716235db1bc0675c904466050e17296d
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-10-28 16:51:29 +01:00
Alexandru Croitor e25cd0b8b8 CMake: Regenerate examples to use qt_add_executable
Task-number: QTBUG-87661
Change-Id: I594521a2b9aada164d684b8ef6ce71c730bfb64a
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-10-20 18:33:29 +02:00
Paul Lemire 9112ad8459 Port instanced-arrays-qml to RHI
Change-Id: I272cfa7688260f4ffb6b8ff49012188f717f62f4
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-10-19 15:30:59 +02:00
Alexandru Croitor c4be23758f CMake: Regenerate qt3d examples
Many of the examples were missing find_package() calls.
Some were missing some example install dir things.
Some missing special cases.
Some incorrectly specified library names due to missing mappings in
pro2cmake.
Some incorrectly specified target names.

Change-Id: I131a02dc679502ea6c1cdeb32962e77f09e672af
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-10-16 16:49:27 +02:00
Joerg Bornemann 472e692199 CMake: Honor INSTALL_EXAMPLESDIR
Re-generate examples, but only the chunks that handle
INSTALL_EXAMPLESDIR, because there have been so many manual changes that
were not special-cased.

Fixes: QTBUG-87331
Change-Id: I0926c015ce2733b462adba18e3dbf47621a7e679
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Christophe Giboudeaux <christophe@krop.fr>
2020-10-13 20:17:04 +02:00
Mike Krus bcad723d9c Use internal CMake API
Task-number: QTBUG-86815
Change-Id: I7a8755571c8977be1f16b2287e5a8055e9016ee5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-07 16:00:04 +01:00
Assam Boudjelthia 1b0f097f36 Android: rename Android's package name for Qt 6
Rename Android package name org.qtproject.qt5.android to
org.qtproject.qt.android to avoid inconsistency with Qt 6 name.

Task-number: QTBUG-86969
Change-Id: Ife5db0d7272473872231a9f3cf94171dea95945a
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-10-03 11:21:22 +00:00
Jean-Michaël Celerier cc8ab55971 rhi: Start adding compute support
Change-Id: I37d0e1a0c56b874122e0db3ac60a90d19819630d
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-08-05 12:55:03 +02:00
Mike Krus 2b8eaa3350 Handle backend type based on QtQuick settings
By default, Scene3D will select the RHI backend.
If QQuickWindow::graphicsApi() is set to QSGRendererInterface::OpenGLRhi
(QSG_RHI_BACKEND set to "opengl") then Qt3D will select the OpenGL
backend.

It's possible to use the OpenGL backend to RHI by setting
QQuickWindow::graphicsApi() to QSGRendererInterface::OpenGLRhi
AND setting QT3D_RENDERER to "rhi".

(Note that setting to QSGRendererInterface::OpenGL has not effect).

Change-Id: I71488ddb290ce2e30c724ddcc10c57ed8afe267b
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-08-05 11:32:02 +01:00
Mike Krus 174cd487b4 Make sample meshes geometry renderers again
Introduce new geometry view class for each.

Change-Id: I8e9a8f3a078d4cc63f9656ae8142e39f05d755c7
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-07-30 13:51:37 +01:00
Jean-Michaël Celerier db611272f5 rhi: fix shadow map example
Change-Id: I7c91d265d1eecaceff434b88311a8f0ea9c1c51d
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-07-29 08:03:50 +02:00
Edward Welbourne e73b431baa Replace QTouchDevice with QInputDevice
Its DeviceType also becomes an enum class, so needs one more layer of
namespace prefix.

Change-Id: Iec519721f30811d91348de92a11ffc82ba86e81d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-07-27 11:33:44 +02:00
Paul Lemire 57b39e87f4 phong-cubes: reference existing assets
Example was referencing assets that were removed a long time ago

Change-Id: I9ab76c53d565d4579b9f7ffc9c69789d836d0159
Pick-to: 5.15
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-06-25 12:39:00 +02:00
Mike Krus d285e73c63 Update examples
Not all work

Change-Id: I7954f9fe41160c929ff48f8bdeae635b900fef33
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-06-25 07:19:28 +01:00
Qt Submodule Update Bot 3cd5102357 Update dependencies on 'dev' in qt/qt3d
Change-Id: I1e62b901adc2896129aab7ff714ca8bd3e762d69
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-06-24 20:12:58 +01:00
Mike Krus 96f429ae78 Restore building of examples
Change-Id: Ie9a73a025bc8de8dc58b6f283dc8467d9a6a1473
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-06-17 13:00:19 +01:00
Mike Krus eefd4511d5 Change how resources are bundled for Scene3d
Fix static build

Change-Id: Ifc2ef78694c2b8fe53961cee75371e5431fff9c4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-13 17:00:52 +01:00
Paul Lemire d604120720 Update dependencies
- QOpenGLEXtensions now private API in GUI
- Removed support for tessellation in GL 3
- Use QMouseEvent position
- Removed use of QDesktopWidget
- Adapt to change in QQuickWindow API

Change-Id: I79df8780b9d02c6d2a3620529f5f41daec7120fe
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-06-12 11:24:30 +01:00
Paul Lemire 3f98bd6a19 Update Scene2D example to use QtQuick.Controls 2
Change-Id: I4ab815079a5fd794714bc5a7cad05e970afcd731
Pick-to: 5.15
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Reviewed-by: Jean-Michaël Celerier <jean-michael.celerier@kdab.com>
2020-06-11 22:15:57 +01:00
Paul Lemire 50ee9444cc Fix Scene3D to work with latest QtQuick SceneGraph RHI changes
Change-Id: If507aac8d48cc33fa7acf993ab77b76cdd70ee9a
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-06-11 20:44:03 +01:00
Mike Krus a2835e19c2 Remove most examples
Trying to please CMake CI which crashes on large resources.
Will add back later.

Change-Id: I5b57e9b1326e37624bf209813c4ae7c9a0c6762f
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2020-06-10 16:45:51 +01:00
Jean-Michaël Celerier 96704a96fb cmake: disable examples on msvc until the big-resources issue is solved
Change-Id: I250de427ffca49d2736c1f01046733df5fb25d6e
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-06-07 19:30:19 +02:00
Jean-Michaël Celerier 840a51d3dd Remove references to removed TexturedMetalRoughMaterial
Change-Id: Ia1dd8d0441f6e6371cec574f7d937d6d94c57186
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-06-04 10:25:31 +02:00
Mike Krus 22dd309499 Add support for building with CMake
Change-Id: If6c887c6356a160a5f3fb906d38a341fff0c7b29
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-05-22 08:53:50 +01:00
Mike Krus 764924da8a Fix build for Qt6
- updated dependencies, excluding qtgamepad for now
- fixed issues with Q_PROPERTY not supporting forward declarations
- fixed for changes in QtQuick private API
- fixed for changes in QtOpenGLVersionFunctions API
- fixed for removal of QT_OPENGL_ES* macros
- fixed for changes in QtConcurrent API
- fixed RHI based build

Change-Id: I42ccd2f101b7f0a78e2860c6d551722bf6710a11
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-05-06 15:29:54 +02:00
Mike Krus 6c1758d35e Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Id669d5c1aab29965eac0dabd1cb497e908dac23e
2020-04-27 11:57:33 +01:00
Mike Krus 60f42119fe Pull bounding volume info from front end
When an entity has a bounding QBoundingVolume component AND that has
a QGeometryView, the bounding volume can be computed by the core
aspect and the results get pulled to the render backend.
Otherwise, we use the old code which computes the bounding volume
in the render aspect.

This means we have 2 jobs to compute bounding volumes and that the core
version must complete before the render aspect runs.

Change-Id: I4de45e48fa0c4d40d3d5084f387abfed5ea1a2f8
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-04-23 10:46:06 +01:00
Jean-Michaël Celerier df4ec04dae rhi: Port most of Qt3DExtras materials to RHI
Change-Id: Iba20f047404b20c1e5b9bdcef917b3c2a1000d59
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-04-22 09:36:46 +02:00
Antti Määttä 18b319f919 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp
	src/plugins/renderers/opengl/graphicshelpers/submissioncontext_p.h
	src/plugins/renderers/opengl/renderer/renderer.cpp
	src/render/backend/attachmentpack_p.h
	src/render/frontend/qrenderaspect.cpp
	src/render/picking/qabstractraycaster.cpp
	tests/manual/manual.pro

Change-Id: I617b7e34bf7e11b2921bfc15e1b99c3e81891ec7
2020-04-21 15:41:26 +02:00
Jean-Michaël Celerier 3b3c743340 Split examples so that build works without qtdeclarative
Change-Id: I98507808b43b116b1950fd60df54704562a234ce
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-03-11 09:36:40 +01:00
Mike Krus 5bf4f93fcb Make default geometries views
In Extras, make QTorusMesh and others a QGeometryView rather than
a QGeometryRenderer. Requires changes to scene graphs here and there
but going forward there simple shapes could be used as proxies for
picking or collision detection, etc.

Change-Id: Id488e064080dfd303e448aba11e6b242236b81d4
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-02-27 12:10:08 +00:00
Mike Krus 17706144e9 Geometry refactoring
Move QBuffer, QAttribute, QGeometry to Qt3DCore.

Change-Id: I59dfd091eefadcada93350b3aba955f40b304385
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-02-27 06:29:57 +00:00
Assam Boudjelthia ed34dea9fb Examples: enable HighDPI scaling for Android
These examples show very tiny UI elements on Android devices,
thus enabling HighDPI.

Task-number: QTBUG-80717
Change-Id: Ibc1a82679e36d74ab6f6d51a4a5b06925f913b84
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-02-24 09:15:56 +00:00
Mauro Persano 597c9df33c No need to register input aspect in basicshapes-cpp example
This is already done in Qt3DExtras::Qt3DWindow.

Change-Id: Idf742b93fdc0d8d4226284d6d949758a07921dd5
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2020-02-21 18:38:38 -03:00
Mike Krus 0159963cf5 Remove QtGui module path from OpenGL related paths
Many are moving to opengl module in qt6, will make merging
easier.

Change-Id: I0ad08510e6999a5d887d9197fe2cb0dc21919fb9
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-02-06 05:24:18 +00:00
Mike Krus 4ae7cc93b5 Add QRenderCapabilities to query GL about what is supported
Change-Id: I7981e7e4b514e5d15d66c82351f1ab2fe160d20d
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-01-20 13:04:19 +00:00
Mike Krus 34165446cd Add Profiling Overlay
Can be activated at adding a QDebugOverlay in the frame graph to
identify which surface it should be renderer one (renders only
once on first branch that contains such a node).
Can be also activated on the forward renderer from Qt3DExtras.

- Shows information about FPS and number of
  jobs/renderviews/commands/vertices/entities/geometries/textures...
- Allows to toggle job and gl call tracing and open folder where
  trace files are stored
- Windows to show and dump glinfo and renderview/command details to the
  console

Change-Id: I286ff85760e8f8f0604a23458883ff22229bda94
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-01-17 07:12:06 +00:00
Topi Reinio 0b5d01eeec Doc: Fix documentation warnings
- Add (basic) documentation for Qt3DAnimation::QAnimationCallback.
- Add missing namespace qualifiers for \class, \fn, \instantiates,
  \sa, and \property commands.
- Remove linking to example file pages, as QDoc no longe treats them
  as linkable targets.
- Fix function/QML method parameter documentation
- Fix missing \qmlproperty types
- Fix linking to QKeyEvent in QtGui.
- Move Qt3DRender::Quick namespace documentation to where QDoc can
  see it.
- Add enum documentation for
  Qt3DRender::QBlitFramebuffer::InterpolationMethod and
  Qt3DRender::QMesh::Status.
- Other minor fixes

This brings the current warning count to zero.

Fixes: QTBUG-79822
Change-Id: I1154a7f9c34917a3f240e99da0e7a300be7d65a0
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2019-11-13 11:29:48 +01:00
Eskil Abrahamsen Blomfeldt 8549dc8ce1 Update AndroidManifest.xml to be compatible with Qt 5.14
The bundled_in_lib and bundled_in_assets entries have been removed,
so all manifests have to be updated to no longer refer to these.
In addition, android-16 is no longer supported, so the minimum SDK
versions have to be updated.

Change-Id: Id01326df5522195647eb107b60ea7e637a950bb3
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-10-25 11:20:56 +02:00
Paul Lemire 3b649e3232 planets-qml: fix flickerring by using less precise scale unit
Essentially use 10^3 KM instead of KM so that we don't end up
with too much precision in the positions which can then result
in the camera flickering when the viewMatrix is computed for
rendering

Change-Id: Id2f878c2e1ccd22a2e72a3494d2e7f623f2b4eb6
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2019-10-23 14:22:57 +02:00
Paul Lemire f29a8c502f Scene3DView example: fix QML imports
Change-Id: Ia46926faa46568a12dc02f7983477af6b395616d
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2019-10-07 10:27:09 +02:00
Paul Lemire 69f3b01eb9 QForwardRenderer: rename clearBuffers to buffersToClear
Change-Id: Ifda1f6f69a6dc58d426dfddbd711620c185a30ab
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2019-10-07 10:26:49 +02:00
Paul Lemire 91dc1e1a61 Introduce Scene3DView
Allows to render several 3D scenes using a single Scene3D. To be used when
you need multiple Scene3D instances.

[ChangeLog] Introduce Scene3DView to render multiple distinct 3D scenes

Change-Id: I5d51c5935218cc84c15d57def3703aa0d92040ba
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2019-08-27 17:08:23 +02:00
Paul Lemire 1fcbcf06da Scene3D: introduce compositingMode (FBO or Underlay)
The default compositing mode is FBO.

One of the problematic aspects of Scene3D is its round trip
through a FBO, which is moderately expensive on low-end hardware,
although it makes it a fully fledged Qt Quick 2 item. If one
wants MSAA then things are even worse, as an intermediate MS'ed
FBO is needed, then resolving into the final one, whose color
texture is then sampled.

However, there's a significant use case for which these FBOs
can be avoided, and that's the case of a 3D scene "below" other
QQ2 content. In this setup, Qt3D can simply render to the
screen, driven by QQ2; then QQ2 can draw on top.

(It's the typical "underlay" scenario.) This can be enabled by setting
the compositing mode to Underlay

[ChangeLog] Scene3D add compositingMode property. Allows underlay rendering.

Task-number: QTBUG-74977
Change-Id: I1ec5f5d60eab45835dbdb2596a7bf1b2ac3624e0
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2019-08-27 12:10:09 +02:00
Paul Lemire 4eee1ab5a5 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/render/renderers/opengl/renderer/renderer.cpp
	tests/auto/render/textures/tst_textures.cpp

Change-Id: I4da0eafe7ddd4dd822c3dcb5f5fa826653a335b4
2019-06-03 12:29:52 +02:00
Liang Qi a4aa2f296b Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I9e9214906c5cda56d0bcc98678c77be69189699d
2019-05-29 11:40:59 +02:00
Marc Mutz 0570d73b61 Eradicate Q_FOREACH loops and mark the module clean
The only noteworth change is where a loop around spy.events modified
the container using takeFirst(). There was no reason to do so, so it
was changed to use the loop variable instead of the result of taking.

Change-Id: I02c62a7c2efc5d042c6e669fe5daddd7da7e85d2
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2019-05-22 16:13:12 +02:00
Paul Lemire 06f41f15ab Merge remote-tracking branch 5.12 into 5.13
Change-Id: I42affdd02bddb5205b9f2455f0c5e5efbd414dd8
2019-04-26 07:14:12 +02:00