summaryrefslogtreecommitdiffstats
path: root/src/extras
Commit message (Collapse)AuthorAgeFilesLines
* Update phong and metalrough shader graphsPaul Lemire2021-06-155-625/+275
| | | | | | | | | | | | - RHI requires updates to existing prototypes, explicit locations for inputs and outputs and treats samplers, uniforms and other inputs differently Change-Id: I7f8c6bf0d2a4732b8badcb7fb426f3349da3d6c3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 9c9284ce7f0d4ea3dda6d6bc6b602f5d4d6016d4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix detection of VulkanMike Krus2021-04-201-2/+2
| | | | | | | | | | | | | | | | | | | | | When Qt is built to enable Vulkan support, it is given the path to the Vulkan header source. This then enables the vulkan feature. Qt3D used this feature to decide if it could use Vulkan directly or not, however, since it is now built separately, it has no idea where to find the headers, so QVulkanInstance is not properly defined. This caused an issue when using official installers of Qt since those are configured to support Vulkan. So we now do a separate config check to find Vulkan for Qt3D. When building Qt3D, you need to make sure if can find Vulkan (the same way you configure Qt itself) Task-number: QTBUG-90243 Change-Id: Ia05381597b4974d7b0914706ea2f607341dccacc Reviewed-by: Paul Lemire <paul.lemire@kdab.com> (cherry picked from commit 9a473a3c9b246f4895ae73d7060745b8b199a6c5)
* Make Qt3DWindow handle default surface format more gracefullyMike Krus2021-01-272-10/+26
| | | | | | | | | | | | | | | | | | The default is now to use the same rules as QtQuick. If nothing is specified, will use RHI and the best surface for the platform (Metal on Mac, DX on Windows, Vulkan if available, etc). If Qt3D's OpenGL backend is requested via QT3D_RENDERER, will always use OpenGL surface. If QSG_RHI_BACKEND is set, will honour that if possible. Otherwise will use the API requested in the constructor (which defaults to using auto detection). Pick-to: 6.0 Change-Id: I8941a081940c073dfcf66711a8628e8ef6fd0915 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Port QText2DEntity to use std::vectorMike Krus2021-01-114-35/+40
| | | | | Change-Id: I98febe2ae6500f2eaf44b489283f597c3c20c272 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Convert QExtrudedTextGeometryPrivate to use std::vectorMike Krus2021-01-111-22/+21
| | | | | Change-Id: I3fa63c558033488122c8c2ff60d4b9cd33cdbf2b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Qt3DWindow::setupWindowSurface set QT3D_RENDERER env variable if unsetPaul Lemire2021-01-071-6/+16
| | | | | | | | | So that anything relying on that env variable to detect the Qt3D rendering backend gets a valid value. Pick-to: 6.0 Change-Id: I291ec03720fd6127900f43888a7e40ab382a075a Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Restore use of QVector in private APIMike Krus2021-01-055-17/+17
| | | | | | | | Facilitates building against Qt 5.15. Will migrate to std::vector over time. Change-Id: I5db14c9ea95b38e4b2d596d7397fef76f6baf118 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Clean up configuration of Extras moduleMike Krus2020-12-151-3/+3
| | | | | | Pick-to: 6.0 Change-Id: I6ba2720dcda886cc91953f74054ca81ebd52b0df Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add RHI technique for distance field rendererMike Krus2020-11-302-0/+21
| | | | | | Change-Id: Ia69dceb8ade566c2b67ce681b7b554e0babb17f2 Pick-to: 6.0.0 6.0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Use RHI's clipSpaceCorrMatrix for backend where Y is not upPaul Lemire2020-11-269-0/+18
| | | | | | | | | | | | | | It's better to rely on RHI instead of a hard coded matrix. Also modify the UBO to provide the clipSpaceCorrectionMatrix and the uncorrected projectionMatrix. All the other matrices we compute and provide use the corrected projectionMatrix but these two new matrices give users the libertity of bypassing the correction if they need to. Pick-to: 6.0 6.0.0 Change-Id: I52e409cc9b38ea0e939d19d92e2ddd907aa7d1cb Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QShaderProgram: handle binding = auto replacement for raw shader codePaul Lemire2020-11-261-2/+2
| | | | | | | | | | | | | | | binding = auto replacement only took place when using shader graphs. This meant providing shader code that used binding = auto or that included snippets that themselves used binding = auto (such as phong.inc.frag) would fail. For that reason, that replacement was moved from the shadergraph builder to QShaderProgramPrivate so that it can be used for both cases: raw shader code or shader graphs. Change-Id: I298a82b83b1181d7a0f19a2e2fefc3aeb9eb81c4 Pick-to: 6.0 6.0.0 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Doc: Fix documentation warningsTopi Reinio2020-11-251-4/+4
| | | | | | | Pick-to: 6.0 6.0.0 Fixes: QTBUG-88842 Change-Id: Ie8ea1914c5e740c0c4bf25f4754a008aff6401cd Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Replace old Q_DECL statements with modern C++Allan Sandfeld Jensen2020-11-022-2/+2
| | | | | | | | Since we have long depended on C++11 now, all of these can go. Change-Id: I8808af2cd5ce192864c636b521dadd7de189563b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Document how the font is used for extruded textMichael Brasser2020-10-232-0/+16
| | | | | | Pick-to: 5.15 Change-Id: Ib18adc0809948092beaad6511bfddc68f22cc459 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Document the origin of extruded textMichael Brasser2020-10-212-0/+8
| | | | | | | | | Many other mesh types use the center as the origin, so be explicit that extruded text is different. Change-Id: Iab443fab7a0e3a3f0a05dfcc7f17a837f69b2ae8 Pick-to: 5.15 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Use internal CMake APIMike Krus2020-10-071-2/+2
| | | | | | Task-number: QTBUG-86815 Change-Id: I7a8755571c8977be1f16b2287e5a8055e9016ee5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Only set the format to 1.0 if it was not changed due to OpenGLAndy Shaw2020-09-301-1/+1
| | | | | | | | | | | | | Since the userRequestedApi variable can be set when a second Qt3DWindow is created (since the environment variable is set after the first time). Then we should be sure to only set the format version to 1.0 if it was not already set due to OpenGL being used. Pick-to: 5.15 Fixes: QTBUG-86436 Change-Id: Ib68f5f1f7f8651c1f20b66060fead7f3dcfb97e0 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* rhi: Qt3DExtras has different combinations of default.vertPaul Lemire2020-08-1114-10/+313
| | | | | | | | So that we only define the vertex attributes we require which avoids conflicts with Metal and Vulkan. Change-Id: I72155996719e27b5667e055d44024250a2596025 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* rhi: add gl and gles2 aliases for the RHI opengl backendPaul Lemire2020-08-101-1/+3
| | | | | | | This is to align with what is done in qtdeclarative Change-Id: I25c251c4d5755c1551e158ca34e9894b077d75fc Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Use QSG_RHI_BACKEND instead of QT3D_RHI_DEFAULT_APIPaul Lemire2020-08-071-6/+6
| | | | | | | | Otherwise it gets confusing having to set both when using Scene3D and taking care that they are identical. Change-Id: I4b3ab99159ff442c572554f9fb661680b46cc7bc Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Qt3DWindow: don't overload requested apiPaul Lemire2020-07-301-2/+0
| | | | | | | | if QT3D_RHI_DEFAULT_API is not set, we would overwrite the requested api to RHI. Change-Id: I5b645d3836fa1d0202974c424bdc55cef65074b5 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Make sample meshes geometry renderers againMike Krus2020-07-3027-132/+1927
| | | | | | | Introduce new geometry view class for each. Change-Id: I8e9a8f3a078d4cc63f9656ae8142e39f05d755c7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Refactor Scene3D to work with both RHI and GL Qt3D renderersPaul Lemire2020-07-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Depending on whether we are using RHI or GL we need to either trigger the rendering after the beforeRendering or beforeRenderPassRecording have been fired -> beforeRendering The RHI command buffer is set up but nothing has been recorded yet. This is what we want for the RHI backend but we will need to make sure we don't call begin/endFrame nor use swap chains other than the one QtQuick is using. This means RenderSurfaceSelector won't be possible. -> beforeRenderPassRecording The RHI command for buffer uploads have been uploaded but the actual RenderPass draw calls have yet to be made. The screen has been cleared already, so this is the best place for the GL backend which expects the screen to have been cleared. - The GL backend can use a QOpenGLFrameBufferObject but that is not possible with the RHI backend. - The RHI backend uses a custom QRhiRenderTarget that takes care of blitting its color attachment into a QRhiTexture which is then bound to a QSGTexture The overall Scene3DItem/Scene3DRender architecture remains the same: - processChange - Render Qt3D content into Texture - Set texture on a custom QSGNode quad Change-Id: Id6c317342d0a227d5295cbfefefc3ed12da160d7 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Use QList instead of QVector in implementation and docsJarek Kobus2020-07-0912-45/+42
| | | | | | | | | Fix some const correctness. Use list-initialization. Task-number: QTBUG-84469 Change-Id: I9c56742581f48f89a3b02e4121fae414117c7a25 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Use QList instead of QVectorJarek Kobus2020-07-072-7/+7
| | | | | | Task-number: QTBUG-84469 Change-Id: Ic726ce85e01190dbc64426388fd454c54ae3c3e3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* rhi: QTextureMaterial: add RHI techniqueJean-Michaël Celerier2020-06-222-0/+20
| | | | | Change-Id: I5d085cb017869406d33823362b6fe4052b7b60df Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add missing overrideAlexander Volkov2020-05-251-1/+1
| | | | | Change-Id: I6a2a4577b4c45d7ac601d2693044c3817e245111 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add support for building with CMakeMike Krus2020-05-221-0/+148
| | | | | Change-Id: If6c887c6356a160a5f3fb906d38a341fff0c7b29 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Fix build for Qt6Mike Krus2020-05-065-8/+5
| | | | | | | | | | | | | - 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>
* Merge remote-tracking branch 'origin/5.15' into devMike Krus2020-04-2751-52/+2164
|\ | | | | | | Change-Id: Id669d5c1aab29965eac0dabd1cb497e908dac23e
| * rhi: Make Qt3DQuickWindow work with RHIJean-Michaël Celerier2020-04-222-88/+76
| | | | | | | | | | Change-Id: Ic9bb79e780006e49d1baa13fd15f52344b81c86b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * rhi: Work needed for PBR material support in RHIJean-Michaël Celerier2020-04-221-0/+5
| | | | | | | | | | Change-Id: Id0e7d343083afcefd93f9d581917e14baa994b7f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * rhi: Port most of Qt3DExtras materials to RHIJean-Michaël Celerier2020-04-2240-123/+736
| | | | | | | | | | Change-Id: Iba20f047404b20c1e5b9bdcef917b3c2a1000d59 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * rhi: Handle RHI-required information in QShaderGraphJean-Michaël Celerier2020-04-2119-0/+1437
| | | | | | | | | | Change-Id: I705843bbb1f6928c2e36b327469882e11fb9613e Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * Merge remote-tracking branch 'origin/5.14' into 5.15Antti Määttä2020-04-212-12/+25
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * Fix typo in phong.inc.frag100Michael Brasser2020-04-191-4/+4
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-83336 Change-Id: I295036a932eba64479b4b1a7e03e676d56cae92f Reviewed-by: Mike Krus <mike.krus@kdab.com>
| | * QMetalRoughMaterial: only remove parameters if addedPaul Lemire2020-02-101-8/+21
| | | | | | | | | | | | | | | Change-Id: I2542334d004ae389238cdb08dd9d41f4014efccf Reviewed-by: Mike Krus <mike.krus@kdab.com>
| * | Implement MetalRough shader optimization TODOMichael Brasser2020-03-274-20/+4
| | | | | | | | | | | | | | | | | | | | | Calculate specularMipLevels only once, on the CPU. Change-Id: I694e3d5e45ea369875ac3ecff36f885b3f669bcf Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * | Add missing QPainterPath includesUlf Hermann2020-03-112-0/+2
| | | | | | | | | | | | | | | | | | | | | Change-Id: I315a4b0615830ae32915a3c2e0ff6ad54b6d15fd Fixes: QTBUG-82792 Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
| * | Allow Qt3DWindow to choose which graphics API to use on constructionJean-Michaël Celerier2020-03-112-3/+73
| | | | | | | | | | | | | | | Change-Id: Id3ff72a2eaa7f85844a546ef55dc3e1b71a14659 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Introduce QCoreAspectMike Krus2020-04-091-0/+2
| | | | | | | | | | | | | | | | | | | | | Does nothing for now Change-Id: I94310a893c3be430aa3d36948c07e0d50efe6c8a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Track dirty state on front end nodesMike Krus2020-04-072-7/+7
| | | | | | | | | | | | | | | | | | | | | Nothing clears the state yet, will be up to the core aspect to do that. Change-Id: Ia3a5297a4b837b1d67545bd29ddce56666c520f3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Merge remote-tracking branch 'origin/5.15' into devMike Krus2020-03-101-0/+18
|\| | | | | | | | | | | Change-Id: Ida354e9c302ef968fbae78edd60a1ad1fabef477
| * | Add missing documentationMike Krus2020-03-101-0/+18
| | | | | | | | | | | | | | | Change-Id: I68d386671c271462a4b156ba9e0f61222a9c79c3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Remove more deprecated codeMike Krus2020-02-273-135/+0
| | | | | | | | | | | | | | | Change-Id: I14695a93c4dc1b54c5ebc149b0fde0d328d75d7b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Make default geometries viewsMike Krus2020-02-2713-26/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Geometry refactoringMike Krus2020-02-2733-264/+274
| | | | | | | | | | | | | | | | | | | | | Move QBuffer, QAttribute, QGeometry to Qt3DCore. Change-Id: I59dfd091eefadcada93350b3aba955f40b304385 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Remove custom deprecation macroPaul Lemire2020-02-121-1/+0
| | | | | | | | | | | | | | | Change-Id: If9fdd63d58b2f9d41dc3a6c99d1dde2245506d15 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Hide deprecated functor APIMike Krus2020-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now private for QTextureGenerator and QGeometryFactory updates. QTextureImageDataGenerator remains for now as it was not previously deprecated and, mainly, it's the only API to get data into an image. Consequently, QAbstractFunctor has been un-deprecated. Change-Id: Ie6691bc402ad603d63abcf1ec9fc3513091f5740 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Remove buffer functor APIMike Krus2020-02-1115-535/+161
|/ / | | | | | | | | Change-Id: I78cc60ff634f909111b891d5b9716e19cae35f3b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>