summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Compile with Xcode 9.4Andy Shaw2018-08-206-9/+102
| | | | | | | The changes are backported from the assimp 4.1 version Change-Id: I0adee853961ffbbecf1f8212b41d3ec06fd57109 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Doc: Use correct module namePaul Wicking2018-07-302-3/+5
| | | | | | | | | | QML: Importing Qt3D.Scene2D doesn't work, QtQuick.Scene2D does. CPP: Specify header file, as convenience header doesn't exist. Task-number: QTBUG-67370 Change-Id: Ia53e92c076f52bbb81b91370425279c44bf9e3c5 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit 9b00bfe82f03ca6d39a004cc380fba144509da2b)
* Doc: Add basic documentation for Scene3D QML modulePaul Wicking2018-04-276-15/+131
| | | | | | | | | | | | Adds Scene3D as QML module. Provides preliminary documentation for Scene3D QML type. Task-number: QTBUG-61651 Task-number: QTBUG-54816 Change-Id: I2811bb2165ca0adde574ddde70fa7185b3c03083 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit 988928b9d37dfae08b5a98cd139eaaa14e72c02c)
* Doc: Add note about projectionMatrix effect on projectionType in QMLPaul Wicking2018-04-271-0/+4
| | | | | | | | | | | Replicate information provided in the CPP class to expose the information for readers of QML documentation, as suggested by bug reporter. Task-number: QTBUG-64386 Change-Id: If448e0a54f9c238938a9d930a0a0edcf72efa2aa Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit 2831c495233338403b31348393e785055700541b)
* Scene3DRenderer: Do not call windowChanged lambda on destroyed objectOliver Wolff2018-04-241-1/+1
| | | | | | | | | | By passing "this" as connect's third parameter we make sure that the lambda in question is not called on destroyed objects. Task-number: QTBUG-67324 Change-Id: I05c45b2ab7b4c81bbf462587515779cf4ef88232 Reviewed-by: Mike Krus <mike.krus@kdab.com> (cherry picked from commit 898c11d13a1af0c70fc8d5902bf3da210d6c2faf)
* Fix OnDemand rendering by keeping ComputeDirty from being re-enabledSvenn-Arne Dragly2018-02-142-5/+13
| | | | | | | | | | | | | | | The previous implementation would reset ComputeDirty every frame if markDirty(AllDirty) had been called earlier. This would break the OnDemand rendering policy because every frame would be rendered even if there were no changes or no compute commands in the scene. This change removes the code that would re-enable the ComputeDirty flag every frame and documents that the user must either set the rendering policy to Always or trigger the rendering of a new frame if the rendering policy is set to OnDemand. Change-Id: Ide03a3a49ee1670fd9d67ed47454c6679219765d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Remove null pointer checkJesus Fernandez2018-02-121-2/+2
| | | | | | | | >>> CID 187918: Null pointer dereferences (REVERSE_INULL) >>> Null-checking "node" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Change-Id: Ic799724e91d118a2c5b2715c5742a4184b09a217 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* ObjGeometryLoader: Fix out of bound errorPaul Lemire2018-02-081-7/+7
| | | | | | | Apparently this was a major security issue reported to security.qt-project.org Change-Id: Id52f035134ca6111e24b5820eb1b64b99449e47f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix crash if sharecontext is requested before initailizationMäättä Antti2018-02-062-34/+42
| | | | | | | | | | | | Scene2D can sometimes receive the render initialization event before the qt3d renderer has been initialized. This causes crash because the sharecontext hasn't been set yet. Add safeguard against this. Task-number: QT3DS-904 Change-Id: Ib50a60ed89c12ac54c9165266466d9804affe77c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix crash in scene2d at shutdownMäättä Antti2018-02-061-5/+8
| | | | | | | | | | | | | | | | | The resource manager policy for scene2d nodes has been changed so the scene2d constructor gets called multiple times at startup. That in turn increments render thread user counter every time. The cleanup code gets called for each instanciated QScene2D node so at shutdown the counter never reaches zero and the render thread is not closed properly. Change the implementation so that the counter gets incremented only when the render thread has been properly initialized. Task-number: QTBUG-66003 Change-Id: I33a5b1f407e65329776bcabe0b66ff049581a435 Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix array of textures in shader parameterMauro Persano2018-02-028-52/+94
| | | | | | Task-number: QTBUG-61759 Change-Id: I2c61f9cf41124816d10da90783c7fb9ff6088fc4 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Ensure node creation changes are sent before using in list propertiesSean Harmer2018-02-023-2/+29
| | | | | | | | | | | | | | | | This completes the fix for out of order event delivery related to creation changes. We now ensure that QNodes used as values in singular and list properties are fully constructed on the backend before they are referenced in properties of other nodes. Also added a check to not recurse into sending too many changes when adding a child node. Written with Svenn-Arne Dragly. Task-number: Task-number: QTBUG-65956 Change-Id: I1470e0f685c81d1277ac04ad985ec1b76f1c27c0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Don't compute bounding volumes for patch-based geometryMauro Persano2018-02-011-1/+1
| | | | | | | | | The actual geometry for patch-based geometry renderers is computed in tessellation shaders, so don't try to compute bounding volumes. Task-number: QTBUG-66073 Change-Id: I9ff13c526859020ff85ba84e6db7c4c4b7335974 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Cleanup AssimpImporterPaul Lemire2018-02-012-10/+10
| | | | | | | And improve error output Change-Id: I9364e0e610cc758ad322bf96b52f57989c7ed0df Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Compile failing shaders once only and avoid asserting on failureLaszlo Agocs2018-02-013-10/+20
| | | | | | | | | | | This way a material with a broken shader will fail once (and won't be retried unless the shader code gets changed), and the application will continue gracefully, without asserting. Task-number: QTBUG-65936 Change-Id: I7003e8c6f7d9094280d7757c1020b485f93e3b37 Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Make PickBoundingVolumeJob depend on ExpandBoundingVolumeJobSvenn-Arne Dragly2018-01-301-0/+1
| | | | | | | | PickBoundingVolumeJob uses QEntity::worldBoundingVolumeWithChildren(), which is set by ExpandBoundingVolumeJob. Change-Id: Ic03360a694254e45c9abfd6863a7b101910bb7fc Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Handle 0 stride vertex dataMike Krus2018-01-292-15/+15
| | | | | | | | | | | | | | | All examples, even with packed data, set actual vertex size on the attribute. However, convention is to pass 0 for packed data, in which case GL will compute vertex size based on number of coordinates and component data size. Neither the buffer visitor nor the triangle visitor respected this convention and relied on the real size to be set. Now computing the actual stride if it's passed in as 0. Change-Id: I9a65fd7d8d56f181e31faa93389e3fdd1a973c17 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Revise buffer traversal in bounding volume calculationLaszlo Agocs2018-01-292-65/+142
| | | | | | | | | | | | | Take the index attribute (and buffer) into account, when present. Rely on QGeometryRenderer::vertexCount(), when set. Initially done on dev as: 1d874d33da9174a82fccc266c66a22af006ac8ef Task-number: QTBUG-65590 Change-Id: I98d1865e3581272471d6b93b9633da38dc77163d Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix componentAdded/componentRemoved notifications dispatch to componentsMike Krus2018-01-265-4/+29
| | | | | | | | | | | | | | | | When a component is added to an entity, two change notifications were sent but they both were directed to the entity. This makes sure one message is sent to the entity and one to the component, as was intended. Same for remove notifications. Fixed the unit tests which where incorrectly testing for the subject id of the change notification. Change-Id: Ic697c08e92e884abf28e675e4ae2b44a93ca45d5 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Doc: Fix grammar glitch in module descriptionsKai Koehne2018-01-262-2/+2
| | | | | Change-Id: I8b519e3d0c5389607be069c08215c921b63e5f07 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Handle multiple surfaces properly for pickingMike Krus2018-01-2610-53/+89
| | | | | | | | | | | | | | | | This fixes issues with picking when having multiple viewports and/or multiple windows. Now check that the mouse event actually hits inside the viewport extents. Also track the source of events and check that the surface matches the source of the event. Remaining issue is overlapping viewports within the same window Task-number: QTBUG-59567 Change-Id: I76a4ee2bec7300d893fef6040d89bf81f2109795 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Doc: Add examples and enumeration to QCullFace documentationSvenn-Arne Dragly2018-01-251-4/+69
| | | | | Change-Id: I0196e0305d205b7499c77644c0fdd42eb671a309 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix issues due to changes in camera view matrixMike Krus2018-01-245-13/+18
| | | | | | | | | Picking relied on the transform matrix of the camera being the same as the view matrix. This has changed but picking and lod code was not update to use the new convention. Change-Id: I3250d3409d15e78a5c0b56eb3b1e74bce1e22843 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Replace Q_DECL_OVERRIDE with override keywordJesus Fernandez2018-01-231-1/+1
| | | | | Change-Id: I153ff68ac60f88d3db8815e133c8851b05e1c130 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* LoadGeometryJob: fix uninitialized valuePaul Lemire2018-01-221-0/+1
| | | | | Change-Id: Ia70ebeed824cdea7127a7741082c7983c89ec731 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Deprecate viewMatrix() on QCamera because its name is misleadingSvenn-Arne Dragly2018-01-221-0/+2
| | | | | | | | | | | The matrix returned by viewMatrix() is in a coordinate system relative to its parent, which is not the final view matrix used when rendering. The final view matrix depends on the world transform of the camera, but we do not calculate this on the frontend for performance reasons. We therefore deprecate this function because its name is misleading. Change-Id: Ib7891c13d83b4de43b86dde878994f66979ecb02 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Calculate and store real transform of camera in addition to view matrixSvenn-Arne Dragly2018-01-223-24/+60
| | | | | | | | | | | | | | | | | | | | | | | | | We used to store the viewMatrix as returned by QMatrix4x4::lookAt in the transform component of the QCamera. This was unfortunate for two reasons: 1) An arbitrary entity could not be used as a camera without changing its transform to a viewMatrix, which breaks any other use of the entity. 2) Adding entities as children to cameras lead to the wrong transformation. This made it impossible to properly add objects that should be attached to the camera, such as the hands of a character in first-person view. This commit computes the transform of the camera based on the requested position, view center and up vector. The view matrix is calculated when the matrices are updated in the RenderView. This calculation assumes that the view direction is along the entity's negative z-axis and that the up vector is along the y-axis. Change-Id: If22b29e3d38bf55fbf79e9f7baf0c922e0a48aeb Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* AssimpImporter: disable default mirroring on texturesPaul Lemire2018-01-221-0/+1
| | | | | | Change-Id: I8fd5776b44faf36b08f3966f634d656d06b203a4 Task-number: QTBUG-64133 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Merge "Merge remote-tracking branch 'origin/5.9.4' into 5.9" into ↵Liang Qi2018-01-182-9/+20
|\ | | | | | | refs/staging/5.9
| * Merge remote-tracking branch 'origin/5.9.4' into 5.9Liang Qi2018-01-182-9/+20
| |\ | | | | | | | | | Change-Id: I9c8aa5d2010fcc622b9cce3031e58a46b74ea2fa
| | * Scene3DRenderer: ensure window pointer stays the same while renderingv5.9.4Paul Lemire2018-01-102-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It appears that the pointer value for the window could in some cases be updated meanwhile we were rendering, which resulted in random crashes. We now save the window pointer to a member variable on startup or whenever the windowChanged signal is fired and use a mutex to ensure the pointer won't change while we are rendering. This also covers the case where the item is destroyed but the cross-thread signals are not received before rendering happens. Task-number: QTBUG-63897 Task-number: QTBUG-65407 Change-Id: I5f2797e2210b532f9086ed186959fce27ea9f514 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Add unit test and fix for broken order of event deliverySean Harmer2018-01-181-1/+22
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure a backend node is always created before it is used in a property of any other node. This avoids a race between sending the creation, add child and property update changes and the start of a new Qt 3D frame. The race is caused by the use of the event loop to trigger the node created and child added changes. Also be careful not to repeat the node creation. Task-number: QTBUG-65829 Change-Id: I6ca5eb269ce657f8d42d855550fb4f898e3bd420 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Volker Krause <volker.krause@kdab.com>
* | Scene3D: allow to force blocking renderingPaul Lemire2018-01-167-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using Scene3D, when the jobs preparing the render commands for the 3D scene take too long (more than the QtQuick refresh rate), the Scene3D wouldn't render anything when QtQuick requested it to. Then, the next time it would be asked to render (next QtQuick frame), if the jobs have finished by then, it will render. If the jobs are still not ready, then the above process is repeated. This patch introduces an environment variable SCENE3D_BLOCKING_RENDERMODE which can be set to force Scene3D to wait (for at most 10ms) instead of returning immediately for the jobs being ready. Change-Id: I2db10e622570a7bc8a2e2cbaff113c110135cd3e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Don't insert nullptr shader programs into the shader cacheVolker Krause2018-01-121-1/+2
|/ | | | | | | | This can happen when the shader program fails to compile/link, and will subsequently trigger an assert in the shader cache. Change-Id: I4c4093d89a8a0f5ed1970012258be5efe8ec29c9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Set devicePixelRatio on item size changeMorten Johan Sørvig2017-12-143-7/+10
| | | | | | | | | Propagate the dpr to the QRenderSurfaceSelector in addition to the the item size. Task-number: QTBUG-62235 Change-Id: I6555685392334b8edf2327fae97d5d531cffeaae Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Quick3DNodeInstantiatorPrivate: Fix build after private API changeFriedemann Kleint2017-12-141-2/+4
| | | | | | | | | qtdeclarative/60d589ccddb036e84883a6c2ef63a5292c8ad022 changed QQmlInstanceModel::object() to take an enumeration. Task-number: QTBUG-61537 Change-Id: I2fab7e80b728f9265e201f47614a79167199667f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Get rid of the INDEXBITS template argument for QHandleLars Knoll2017-12-1322-182/+123
| | | | | | | | | It's not required anymore, as the resource manager can grow as needed. Change-Id: If509de7f2ef90e1af9729d8fc60d7ecb08ede687 Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* qanimationgroup.h: Fix include of Qt classFriedemann Kleint2017-11-281-1/+1
| | | | | | | | Amends 91d4985e7b597457d024e67c64fe136c550c23fd. Task-number: PYSIDE-487 Change-Id: I8689241bb1899f2af9c449a7c51bfc3927d68a48 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Silence -Wunused-paremeter warnings in renderview.cppChristian Stromme2017-11-271-0/+2
| | | | | | | | renderview.cpp:341: warning: unused parameter 'begin' [-Wunused-parameter] renderview.cpp:341: warning: unused parameter 'end' [-Wunused-parameter] Change-Id: I0ddd23543101e10108725add7094b3e2a1520dc2 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix includes of Qt classesFriedemann Kleint2017-11-2336-50/+50
| | | | | | | | | 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>
* Fix for uniform arrays on some driversPaul Lemire2017-11-175-0/+15
| | | | | | | | | | | | Some drivers reports names of uniform arrays without the terminating [0]. Therefore if for a given uniform name, with uniform size > 1, [0] is missing, we append it. Fix provided by Donald Marotzke Change-Id: I53f9826c092e2aa1e7756dafb494b32caca8b3bc Task-number: QTBUG-63537 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Material dirty only on param name/enabled changeSvenn-Arne Dragly2017-11-151-1/+4
| | | | | | Change-Id: I11e5ce86b318386b8458743b63f57824d3732271 Reviewed-by: Christian Stromme <christian.stromme@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix AnimationClip crash when removing clipsAndy Nichols2017-11-153-0/+13
| | | | | | | | | Similar to ClipAnimators, it is important to take care when using these handles by checking if the frontend components have been destroyed already. Change-Id: I0dc3be94a6f0a7d5b064b864eed6cb2961b36ad9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add layer entity filter cachingSvenn-Arne Dragly2017-11-149-13/+145
| | | | | | | | Also add all dirty flag enums found in dev. Change-Id: Ib364773002a3170aef66e7b365a0a41d8e60bd92 Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Rework resource handlingLars Knoll2017-11-073-144/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rework the way the QResourceManager allocates and manages it's resources. Get rid of the huge pre-allocated freelist, and instead merge it with the counter field (that is now always a quintptr large). Give QHandle a direct pointer to it's data in addition to the counter. This makes QHandle 8 or 16 bytes large, but speeds up access to it's data and gives more safety on the counter as that one now always has at least 31 bits. Counter and the linked freelist use the same memory location. To avoid potential conflicts, make sure the counter is always an odd number, so it can't be a valid pointer. Do not use INDEXBITS anymore, the resource manager can now always allocate as many resources as we have RAM available and will grow with the required use (and not allocate fixed memory upfront). This change reduces the memory consumption of the qardboard example from a bit above 40 to 10MB. Change-Id: I514f2d3f957f8635098fb88342e42e3361456340 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Deal with trailing spaces and crlfKevin Ottens2017-11-071-0/+4
| | | | | | | | | We ended up having corrupted meshes if the application which exported the OBJ was adding trailing white spaces. Also make sure we got a test case using crlf for end of lines. Change-Id: Iace9dbc3d0d124fefe9e3350d396fdf26555cd17 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix SortPolicy sorting key generationLaszlo Agocs2017-10-203-4/+29
| | | | | | Change-Id: Ib06d84088d93e00ffdcaa6baa9d34e03358943cb Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Doc: Add doc for undocumented methodsNico Vertriest2017-10-201-0/+6
| | | | | | | | qanimationclip.h:56: warning: No documentation for Qt3DAnimation::QAnimationClip::clipData Change-Id: Ic44c96d47d3dff095b6b299f5280f21345dba452 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Doc: add doc to undocumented methods/propertiesNico Vertriest2017-10-205-4/+346
| | | | | | | | | | | | | | qtexturewrapmode.h:60: warning: No documentation for 'Qt3DRender::QTextureWrapMode::WrapMode' qtexturewrapmode.h:55: warning: No documentation for 'Qt3DRender::QTextureWrapMode::x' qtexturewrapmode.h:56: warning: No documentation for 'Qt3DRender::QTextureWrapMode::y' qtexturewrapmode.h:57: warning: No documentation for 'Qt3DRender::QTextureWrapMode::z' qtexturegenerator.h:59: warning: No documentation for 'Qt3DRender::QTextureGenerator::operator()() qtexturegenerator.h:60: warning: No documentation for 'Qt3DRender::QTextureGenerator::operator==(const QTextureGenerator &other) qtexturewrapmode.h:60: warning: No documentation for 'Qt3DRender::QTextureWrapMode::WrapMode' Change-Id: I6a77f43dfb153de142d12ef1c3cdb1850669d49f Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Doc: add doc to undocumented classesNico Vertriest2017-10-205-1/+21
| | | | | | Change-Id: I342a74f6605d7e6a9ac6f07af21dc8f7fd80c3ce Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>