summaryrefslogtreecommitdiffstats
path: root/src/extras
Commit message (Collapse)AuthorAgeFilesLines
* Fix normal calculation in MorphPhongMaterialJoni Poikelin2018-10-052-2/+2
| | | | | Change-Id: Iad160f2d454633b558bee91b1e01c287d4202451 Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Fix QMorphPhongMaterialMäättä Antti2018-10-012-6/+23
| | | | | | | | Replace the removed phong.frag with graph-based fragment shader. Task-number: QTBUG-69751 Change-Id: I196be25aff656d6934d6179e4f082430b109b2a1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add metalRoughFunction to ES3Mauro Persano2018-09-274-0/+458
| | | | | | Change-Id: I5ac330462bf051285dafbfa4554aa97e6657ac65 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QOrbitCameraController: make zoom work when pressing shift keyPaul Lemire2018-09-261-1/+1
| | | | | | | Was mistakenly using yAxis instead of zAxis input value. Change-Id: Id91d04565c503ae5f286f6b433e246a1b94d6e12 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QText2DEntity: clear glyphrun when scene changesPaul Lemire2018-09-242-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | GlyphRun stores a reference to glyphs and indirectly to a suitable TextureAtlas based on the font needed by the glyphs. Whenever we recompute the glyph because some property has changed we: 1) Store information about the glyph we need 2) Generate a Rendering Entity for the glyph we need 3) Dereference the glyphs we don't need anymore (the old glyph run) Step 3) is performed last as whenever no more glyph reference a TextureAtlas, it gets deleted. If we were to do that first, we could end up in cases where we destroy the atlas and recreate it just after because the new GlyphRun actually uses the same font. TextureAtlases are tied to the lifetime of the scene's root node. However if the scene changes, the previous glyph run wouldn't be released. Since we don't keep a direct relationship between Glyphs and TextureAtlas (we basically do a getOrCreateTextureAtlasForFont and lookup available atlases in the scene), we could actually end up destroying a texture atlas we still need the next time we update our glyph run: When deferencing the old glyphs (whose texture atlas has been destroyed when the scene has changed), we would instead be removing references to the new atlas required by the new nodes (if they share the same font). To fix that, whenever the scene changes, we now clear the glyph run as well. Change-Id: Ibe62e2f6438c6655d2997681117c341302d64799 Task-number: QTBUG-70551 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Qt3DWindow/Qt3DQuickWindow base custom surface format on default onePaul Lemire2018-08-291-1/+1
| | | | | Change-Id: I52620326d7ee79be86419e55b186470689b02950 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Doc: Fix incorrect ForwardRenderer properties typeTakumi ASAKI2018-08-171-2/+2
| | | | | Change-Id: I1b02b6920b9525f4ced75271d36f07890a77f7fc Reviewed-by: Martin Smith <martin.smith@qt.io>
* QSkyboxEntity fixes:Paul Lemire2018-07-183-5/+5
| | | | | | | | | | Was setting the major version instead of minor version thus potentially never allowing technique/pass filtering to ever succeed. Update shaders/technique to target 3.3 as 3.0/3.1 might not work on mac. Change-Id: I48c0ee54aac4a017cf8ac5ff3219b788a15bbcdd Task-number: QTBUG-69522 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Doc: Fix documentation warnings related to Clang QDoc parserTopi Reinio2018-04-202-9/+10
| | | | | | | | | | | | | | | | | | | | | Since Qt 5.11, QDoc uses Clang to parse C++ documentation. Clang requires a module header, as well as proper include paths, to build a precompiled header and process the sources. To do this, add a custom module header that pulls in all Qt 3D modules - this way, we can continue using a single documentation project to covers all of Qt 3D. Fix all documentation warnings are caused by missing namespaces, QML module/type names and typos, as well as a number of linking problems and other minor issues. After this change, the remaining documentation issues consist of 'No documentation for ...' warnings. Task-number: QTBUG-67790 Change-Id: I38b91163c475a00cc1893e793240470c5409eb57 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Revert "Doc: Divide documentation into submodules"Topi Reinio2018-04-205-917/+0
| | | | | | | | | | | This reverts commit c8964b8f1cf56718a189b0f57bad446cec30a8b8. QDoc now supports documentation-specific custom module headers and include headers that allow us to keep using a single documentation project that covers multiple modules. Change-Id: I84706a7149097a6b03f0f266e55d6f712a6c773e Reviewed-by: Martin Smith <martin.smith@qt.io>
* Add support for Escape key in camera controllersMike Krus2018-04-204-0/+23
| | | | | | | Hitting the escape key does a view all on the active camera Change-Id: I19be96565358674958a193a96a0b487f36c085ba Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Remove unused variables detected by clang-clFriedemann Kleint2018-04-121-3/+1
| | | | | | | | | | nodes\qnode.cpp(391,34): warning: lambda capture 'this' is not used [-Wunused-lambda-capture] backend\gltfimporter.cpp(345,19): warning: unused variable 's' [-Wunused-variable] backend\gltfimporter.cpp(353,19): warning: unused variable 't' [-Wunused-variable] text\qdistancefieldglyphcache.cpp(79,13): warning: private field 'm_glyph' is not used [-Wunused-private-field] Change-Id: Id546607d95561efa7547fb5d7df0b03184bc5ed7 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Document state of the Qt 3D modulesKai Koehne2018-03-121-4/+7
| | | | | | | | | | | | | Do make it explicit which ones are still in development also in the landing page, and add \preliminary and \since tags (for released and TP modules, respectively). Note that the \preliminary, \since tags currently do not work for \qmlmodule, which hopefully gets fixed at one point: QTBUG-65963. Change-Id: I6648311c38f331286be37eefa60794984cd239b7 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Enable alpha blending on QTextureMaterialMike Krus2018-03-083-0/+62
| | | | | Change-Id: I8466ccd47f8bda9fec184f548a2df7807d456ac7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Revert "CameraControllers: use the Camera's upVector"Sean Harmer2018-02-192-2/+2
| | | | | | | | | | | | | | This reverts commit 627167bd4a2e1dc12ffee813e82f9b33bff19a22. There was a reason to use the y axis as the up vector here which is to keep the camera controller oriented correctly. Without this restriction it's far too easy to end up with a twisted camera. If we want a fully free trackball type controller, let's add that as a new type, or perhaps as an option on these. Change-Id: I56c8708535d4ccd05ccb5f2ddea732bb27abda58 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Merge remote-tracking branch 'origin/5.10' into 5.11Sean Harmer2018-02-152-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/animation/doc/src/qt3danimation-module.qdoc src/render/backend/abstractrenderer_p.h src/render/backend/buffervisitor_p.h src/render/backend/renderer.cpp src/render/backend/renderer_p.h src/render/backend/triangleboundingvolume_p.h src/render/backend/trianglesextractor_p.h src/render/frontend/sphere_p.h src/render/jobs/calcboundingvolumejob.cpp src/render/jobs/job_common_p.h src/render/jobs/pickboundingvolumejob.cpp src/render/jobs/pickboundingvolumejob_p.h src/render/jobs/pickboundingvolumeutils.cpp src/render/jobs/renderviewjobutils_p.h tests/auto/render/boundingsphere/tst_boundingsphere.cpp tests/auto/render/commons/testrenderer.h tests/auto/render/raycasting/tst_raycasting.cpp tests/auto/render/render.pro tests/auto/render/renderer/tst_renderer.cpp Change-Id: I76633bc5a5a065e5f9ea62cc16563377e5c693a3
| * QAbstractCameraController: Make struct InputState publicFriedemann Kleint2018-02-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | For generating Python bindings, the struct InputState needs to be public since a Python binding needs to be created for it so that a wrapper of QAbstractCameraController can be generated that calls into Python for an implementation of moveCamera(). Task-number: PYSIDE-487 Change-Id: Ib410b19a9e886ad06335dac05fd56206a72220bf Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Doc: Divide documentation into submodulesTopi Reinio2018-02-095-0/+914
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDoc in Qt 5.11 will use Clang (libclang) to parse C++ documentation. In order to do that, Clang needs to have the include paths available when parsing source; qmake provides that information to QDoc but only when the documentation project is located under the correct module (source) path. By having dedicated doc projects for Qt 3D Core, Render, Input, etc. the number of documentation warnings is signicantly reduced. A top-level 'Qt 3D' project is still kept, and contains the landing page, overview, examples, and top-level 'C++ classes' and 'QML types' pages that list all types documented across all Qt 3D submodules. Change-Id: Id5936de36f31c2a8764a64e1e9d7ae0d10e8ab14 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | CameraControllers: use the Camera's upVectorPaul Lemire2018-02-022-2/+2
| | | | | | | | | | | | | | Instead of assuming +Y everywhere Change-Id: Ie0ddc40a4b3cdc60df02cffd11f899e1c32caaa3 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Merge branch '5.10' into devSean Harmer2018-01-177-13/+13
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I248aa369ba98659a61e563fd29cc811c76ea1e2d
| * Fix includes of Qt classesFriedemann Kleint2018-01-153-6/+6
| | | | | | | | | | | | | | | | | | Add the module name, which is required for PySide2 to build. Complements 1129ff731fca6aff5849cafe1f434f1882342cd7. Task-number: PYSIDE-487 Change-Id: Icb6057f6849825536aac4c8f340d722b87b77857 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Merge branch '5.9' into 5.10Sean Harmer2018-01-124-7/+7
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/animation/backend/handle_types_p.h src/extras/defaults/qtexturematerial.h src/render/backend/entity_p.h src/render/backend/handle_types_p.h src/render/backend/renderview.cpp src/render/io/scenemanager.cpp Change-Id: Ic145062cc98360e9067fd60f0992c7a6b51e41bb
| | * Fix includes of Qt classesFriedemann Kleint2017-11-234-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The convention <QtModule/QClass> should be used. Among other things, this makes generating Python bindings possible. Task-number: PYSIDE-487 Change-Id: I32f114377dd70d27dee71a44b05c81474eb5dac3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLaszlo Agocs2017-12-1332-20/+66
|\| | | | | | | | | | | Change-Id: Ib51c8311ce78b2fec62dd0c09cb943a85a7d0b2b
| * | Merge remote-tracking branch 'origin/5.10.0' into 5.10Liang Qi2017-12-082-0/+18
| |\ \ | | | | | | | | | | | | Change-Id: I58cb37d5de618ad5e9b9a6f0598a0d790d3694f9
| | * \ Merge 5.10 into 5.10.0Oswald Buddenhagen2017-11-2011-0/+742
| | |\ \ | | | | | | | | | | | | | | | Change-Id: I1d59f6d4f69c5ab33efe1a00a983a2af880ef79a
| | * | | Fix resource init namespace issuesLaszlo Agocs2017-11-142-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the pattern from other modules and put Q_INIT_RESOURCES in a static function outside all namespaces. INTEGRITY reportedly has linking issues without this. Task-number: QTBUG-64468 Change-Id: Iccdd03f5384765251a94502766a445a6c6d732b0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
| | * | | Fix material system qrc in static buildsLaszlo Agocs2017-11-082-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Qt3DRender part is clear and we have a good global place to do the Q_INIT_RESOURCE call. Extras is debatable since there is no good place. Quick is already handled via the import plugins, but pure C++ applications also need this in static builds. For now add it to QForwardRenderer and Qt3DWindow. This should cover the common use cases for the materials in extras. Task-number: QTBUG-64279 Change-Id: I276e8d4265f4527736d415b07dbf03e9d8904adf Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | | | Doc: Qt 3D Extras: Fix information on deprecated classesTopi Reinio2017-12-0528-9/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDoc has no \see command. Further, Qt 3D Extras module page still listed the deprecated classes. To fix these and make it easier to maintain, assign (non-deprecated) classes to groups and list the group members on the module page. Change-Id: I6bb2ff9855c2c481b33c7d0d142a173a5e0b3fd8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
| * | | | QSkyboxEntity: try to reload texture only oncePaul Lemire2017-11-212-11/+20
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By using a queued invocation and a flag. This prevent cases where the basename would be set by a first call, with an extension not yet being set which would result in warnings. Change-Id: I385cffaf9ee262535c759109335bb3c150cc7525 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | | Merge remote-tracking branch 'origin/5.10' into devAndy Nichols2017-11-2011-0/+742
|\| | | | | | | | | | | | | | | Change-Id: Ia6496e1ea22f2393a28e37cdd9f6e34f7613db49
| * | | Replace all phong variants with QDiffuseSpecularMaterialKevin Ottens2017-11-1511-0/+742
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | This one reconfigures its graph layers and render states properly based on it properties. As such it covers all the features coming from the various phong materials we had in the past. That's why they are all marked as deprecated. Change-Id: I9a74639d4cff5170b496d475c8a74b1e4e163b03 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Merge remote-tracking branch 'origin/5.10' into devAndy Nichols2017-11-1331-312/+640
|\| | | | | | | | | | | Change-Id: I2d373d538df3a65ac2d41238e5c6a214a151be68
| * | Add missing layer to the baseColorMap nodeKevin Ottens2017-11-071-0/+1
| | | | | | | | | | | | | | | Change-Id: Id540dae6e52e027d7c5b18441575c05361d6e269 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | Remove qfirstpersoncameracontroller_p.h from defaults.priFriedemann Kleint2017-10-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | Fixing warning: WARNING: Failure to find: defaults\qfirstpersoncameracontroller_p.h Change-Id: I81d38b43c41fbca22ad8d4cffc73fc4b2c6679c9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * | Connect the normal parameter to the right signalKevin Ottens2017-10-131-1/+1
| | | | | | | | | | | | | | | Change-Id: I62f1d637f595d576bd1c4df48ef32a0002e6aa18 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | Have all the Phong variations based on a graphKevin Ottens2017-10-1325-307/+609
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a new layered graph file to deal with all the Phong material variations. It ports all the materials to using it, then of course it removes all the old frag implementations. Change-Id: Ia519eaf4cea3b6e3ff4dd5aa1cca2bedbfcbe7cb Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | Doc: Add the correct namespace for QAbstractCameraControllerTopi Reinio2017-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Without the namespace QDoc fails to find the class documentation. Change-Id: I999846649a4e6df975f09dca169be9d83f99ae7a Reviewed-by: Andy Maloney <asmaloney@gmail.com> Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
| * | Doc: add doc to undocumented methods in qt3dwindow.cppNico Vertriest2017-10-091-1/+27
| | | | | | | | | | | | | | | Change-Id: I450cdbd7cee58ae84f45ad82c5bc15489fe61771 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * | Fix dolly in/out speed calculationSean Harmer2017-10-061-1/+1
| | | | | | | | | | | | | | | Change-Id: Ie7fe80039a6cb88a0f1540ce252c9dee36d0afe1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-0563-1878/+1585
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/animation/backend/channelmapper_p.h Change-Id: I4e0f59c6648925ba45d30ccc2405524a9e901a0e
| * | Add Qt3DExtras::QAbstractCameraControllerv5.10.0-beta1Andy Maloney2017-10-0310-843/+810
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Abstracted the orbit and first person camera controllers into a base class. These two controllers shared a lot of similarities. This allows developers to easily create a custom camera controller by deriving from QAbstractCameraController and implementing one function. [ChangeLog][Qt3DExtras][] Added Qt3DExtras::QAbstractCameraController abstract base class to make implementing new camera controllers easier. Change-Id: I43cfbc03f7294b1740f199ac7ededa9578234974 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * | Since the ES2 includes use FP make sure it is definedKevin Ottens2017-09-273-0/+6
| | | | | | | | | | | | | | | Change-Id: Ibb735878c6c6b7f14eb26a0f98c200045b4979b6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | Move phongFunction in its own include fileKevin Ottens2017-09-2719-269/+423
| | | | | | | | | | | | | | | | | | | | | | | | | | | Makes it cleaner overall since the light structs were shared with the metalrough includes and the gooch fragment shader but they didn't use the functions in there. Change-Id: I459ff0fc2d751a5be9296dc33dda0efcb06b917c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | Add textureScale to MetalRoughMaterialKevin Ottens2017-09-273-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This property was available in the textured phong variants but somehow we didn't implement it yet for metal/rough. This new parameter is not used yet, but will be in the next commit where we unify the vertex shaders. Change-Id: I0d5293f6413a4a0412d92d2d42bf700238938fc6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | Move most vertex shaders into a unified oneKevin Ottens2017-09-2717-186/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | We currently do a bit more work than strictly needed in some cases, but that will change later on when this shader is converted into a graph. Changing now will make this future refactoring easier. Change-Id: I887601c18575bef79e25a23ed054aa336b1e860a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | Remove the *alpha.frag from extrasKevin Ottens2017-09-277-120/+4
| | | | | | | | | | | | | | | | | | | | | | | | They are identical to their non-alpha counterparts at that point, so no need to keep them around. Change-Id: Ia3961670dc1d5c0f65711476c8dc6cc467df62c5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | PhongAlpha: encode the alpha in kdKevin Ottens2017-09-274-20/+12
| | | | | | | | | | | | | | | Change-Id: I331dd9b4adf7a412338daba6d11ca945dc290054 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | Wrap adsModel into phongFunctionKevin Ottens2017-09-2521-130/+136
| | | | | | | | | | | | | | | | | | | | | This way the use is more similar to the one for metal/rough. Change-Id: I143df910f43e29ef622f24bd97a23c90a2c8ef68 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | Base PerVertexColorMaterial on adsModelKevin Ottens2017-09-255-161/+8
| | | | | | | | | | | | | | | | | | | | | | | | Since this was the sole user of adModel we also remove it in the process. Change-Id: Ibb79bb05c10b33e69601624ea9ad1fdf8523fdbf Reviewed-by: Sean Harmer <sean.harmer@kdab.com>