Commit Graph

6679 Commits

Author SHA1 Message Date
Paul Lemire 726be38f77 Renderer::doRender scene3dBlocking fixes
-Reorder sleep and locks
-Properly protect isFrameQueueComplete lookup
-Reread queueIsEmpty which could have been updated

Change-Id: I2b5a52284bbb3ddb48483c5bf73779e335c8bdda
Task-number: QTBUG-71294
Reviewed-by: Christian Andersen <csandersen3@gmail.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2018-11-05 13:46:45 +00:00
Paul Lemire fd9f66d17d GLTexture: do not set layers when target is Texture3D
Because Texture3D doesn't support layers and that results in a warning
being added to the console.

Change-Id: I54d34ccccc2bc1f022814689b97aaaf624026249
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2018-11-02 05:37:07 +00:00
Christian Andersen 3314694004 Fix crash due to racecondition in renderer on shutdown
Protects access to m_renderQueue using the m_renderQueue mutex on
shutdown. When a Qt3DWindow is deleted it signals the aspect thread to
do early cleanup, the aspect thread calls Renderer::shutdown which in
turn resets m_renderQueue. Meanwhile the render thread may be working on
m_renderQueue, this leads to a double free of the front render view in
m_renderQueue (and potentially other stuff).

Fixes: QTBUG-69877
Change-Id: Ifd018597dbdb2f1538494932c907c63e8db9c715
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2018-10-23 17:36:10 +00:00
Jim Albamont f575334691 Fix notifications for QClipAnimator::clip property
Qt3DAnimation::QAbstractAnimationClip was not registered as metatype resulting
in the following error when calling QClipAnimator::setClip:

QMetaProperty::read: Unable to handle unregistered datatype 'Qt3DAnimation::QAbstractAnimationClip*' for property 'Qt3DAnimation::QClipAnimator::clip

Change-Id: If92d781fdab5be06ce11ec88f0b3921cfbd557ff
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2018-10-05 15:34:52 +00:00
Joni Poikelin d8789d8fd1 Fix normal calculation in MorphPhongMaterial
Change-Id: Iad160f2d454633b558bee91b1e01c287d4202451
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
2018-10-05 08:50:43 +00:00
Paul Lemire c82d0c81aa Fix compilation with -qt3d-profile-jobs on Android
Change-Id: Id6dc461bbc61712f59484898c54a85d07fd8fc22
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2018-10-05 07:12:05 +00:00
Paul Lemire 08f979f96f Further complete missing functions on ES3 helpers
Change-Id: I62e83c360619a2e096401330a61a6f2602b743d2
Task-number: QTBUG-70660
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2018-10-04 10:32:59 +00:00
Paul Lemire ff07ec93db Fix leak with VAOManager
Change-Id: I09f15de230c571adb580bdbb3250405f562f255b
Task-number: QTBUG-70892
Reviewed-by: Juan José Casafranca <juan.casafranca@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2018-10-03 07:55:54 +00:00
Paul Lemire c19036f848 QChangeArbiter: fix leak
When all observers for a node have been removed, we should also remove
its entry in m_nodeObservations hash.

Change-Id: I56762bb345e6a3eba74d5174b225dc86acd17e8f
Task-number: QTBUG-70892
Reviewed-by: Juan José Casafranca <juan.casafranca@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2018-10-03 07:55:50 +00:00
Kai Koehne 9b51fea01c Remove unused CameraController.qml from simple-qml example
Change-Id: Id76f8fc4d4701933e7744ff0dff837ec5e4bcc02
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2018-10-02 11:55:15 +00:00
Määttä Antti d05d2fd3d2 Fix QMorphPhongMaterial
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>
2018-10-01 06:59:31 +00:00
Mauro Persano c8e95f8409 Add metalRoughFunction to ES3
Change-Id: I5ac330462bf051285dafbfa4554aa97e6657ac65
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2018-09-27 12:38:02 +00:00
Mauro Persano dbaf2319da ES3 deprecated gl_FragColor, use output variable instead
Change-Id: I9a6a7ee88db5471a1c4ed88ed13c99d66b764d93
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2018-09-27 12:37:44 +00:00
Mauro Persano 6eb906bf57 Use GLSL texture() instead of texture2D() on ES3
Change-Id: Icfec19e5bd76f6a6ca53700a5a3705aa97763859
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2018-09-27 12:34:32 +00:00
Michael Dippold 565a89ac43 Scene3D crashing on destruction
Moved logic accessing the Scene3DItem from the render function into an
afterSynchronization call which has the main thread locked to prevent
the race condition.

Task-number: QTBUG-70747
Change-Id: I596d445512b5985c7dfb54d228fa0a5fcc596a27
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2018-09-27 12:34:08 +00:00
Paul Lemire 74b8191968 QOrbitCameraController: make zoom work when pressing shift key
Was mistakenly using yAxis instead of zAxis input value.

Change-Id: Id91d04565c503ae5f286f6b433e246a1b94d6e12
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2018-09-26 08:57:49 +00:00
Leena Miettinen 999424908f Doc: Mark deprecated Qt 3D QML types obsolete
The types will be listed on the "Obsolete QML Types" page that is
linked from the "All QML Types" page.

Task-number: QTBUG-69713
Change-Id: Ieff402d1cce426c0ce4b9191b8fe9b1dd02b4328
Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2018-09-25 07:50:52 +00:00
Paul Lemire e879254613 QText2DEntity: clear glyphrun when scene changes
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>
2018-09-24 11:54:02 +00:00
Paul Lemire e22971073e GLTexture: mark texture for upload when it's recreated and contains data
In some cases, a GLTexture will destroy its internal OpenGL texture
before recreating it (when it requires a new allocation due to some
property change).
When this happens, we need to ensure we also request our content data
to be uploaded after the new internal OpenGL texture is recreated.

Change-Id: Ifd3f8a1e40e5fad63d117417006c65fade5c2b39
Task-number: QTBUG-70551
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2018-09-24 11:53:58 +00:00
Kai Koehne b830f43075 Document third party asset 'miramar'
The files got added in commit f49cabe35c. However, the original
sources from the linked url are in .tga format, so I assume they
got converted before importing. We should probably add a
'Modifications' entry to highlight such conversions in the future.

https://opengameart.org/content/miramar-skybox categorises the license
as CC-BY 3.0, but the upload was done not by the author.

Change-Id: I312a871716104507434eb6d12a547c3752da51af
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2018-09-24 07:09:53 +00:00
Paul Lemire 9486a8a4b6 Complete ES 3.1 and 3.2 helpers
Which didn't handle indirect drawing, compute and tessellation
Since ES 3.1/3.2 don't provide API for glShaderStorageBlockBinding,
code was adjusted to use the default binding points and not require
that API.

Change-Id: Ie4dcd05f0a1d72e4a25f49b5fae138dc605ba5e3
Task-number: QTBUG-70660
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2018-09-21 07:54:37 +00:00
Kai Koehne 9884d3bffc Replace use of qmlRegisterRevision
qmlRegisterRevision was incorrectly used to actually expose the revision
to QML; anyhow, it is only meant to registering revisions of a base
class that the type depends upon.

Also remove one duplicated registration.

Change-Id: I0c743fc951954870f13a7e0e099fc16a4b7efa4f
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2018-09-20 13:48:48 +00:00
Qt Forward Merge Bot 03253babc2 Merge remote-tracking branch 'origin/5.11.2' into 5.11
Change-Id: Iedf7378db2e180e91d79e07696064ef868b0167b
2018-09-09 12:15:01 +02:00
Antti Kokko d630e3c8a9 Add changes file for Qt 5.11.2
Change-Id: Ic54262355ba79b138b09b467e9987df6fea66434
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
2018-09-06 04:29:59 +00:00
Paul Lemire 42a466e0c7 Qt3DWindow/Qt3DQuickWindow base custom surface format on default one
Change-Id: I52620326d7ee79be86419e55b186470689b02950
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2018-08-29 13:27:10 +00:00
Paul Lemire d0692c6944 Fix: remove compile warning in graphicscontext.cpp
Change-Id: I3f1b5cca75973abf8970b3f1929a3a0ea385d8f1
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2018-08-21 13:46:42 +00:00
Takumi ASAKI 295b16da92 Doc: Fix Scene2D and Scene3D QML modules uri
This is additional fix for QTBUG-67370.
And fix for Scene3D.

Task-number: QTBUG-67370
Change-Id: Id362e60ac4072b7935ee86ff2a44e23018adc381
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2018-08-17 11:39:45 +00:00
Takumi ASAKI ccfe440c34 Doc: Fix incorrect ForwardRenderer properties type
Change-Id: I1b02b6920b9525f4ced75271d36f07890a77f7fc
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-08-17 01:00:00 +00:00
Laszlo Agocs 0d23715c78 Remove AUTOTEST_EXPORT from templated function
...to avoid warnings (that can be treated as errors) with Mingw.

What we have seen in the CI is that including renderer_p.h from an
external module can lead to

error: inline function 'T Qt3DRender::Render::variant_value(const
QVariant&)' declared as  dllimport: attribute ignored [-Werror=attributes]
Q_AUTOTEST_EXPORT inline T variant_value(const QVariant &v)

which is treated as an error if the external user happens to be a Qt
module with warning_clean enabled.

Not sure why this surfaced now, but removing the export should be the
correct thing to do regardless.

Change-Id: Ie8de120fa0e5c96fbcffc1632db57edeac87a95b
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2018-08-15 11:47:25 +00:00
Laszlo Agocs d3395bf51c Avoid initializing GraphicsContext on every frame
m_initialized is inherited from GraphicsContext, having another
m_initialized in SubmissionContext is wrong.

Change-Id: I431ba67c671b8854fafce769c8bfd90ba71e7441
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2018-08-14 13:29:23 +00:00
Kai Koehne aaa28f6802 Document third party asset 'wine'
The code was originally imported in commit 2a9a67d1b1, and then
updated in to upstream version 0.8 in commit 473bd13ed3.

LICENSE.md is from upstream repository.

Change-Id: I20f97d46125abc4f1c7d54c52b891acc50336ac5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2018-08-14 07:55:23 +00:00
Paul Lemire 411c2e9f78 Texture property update: notify frontend only when properties have changed
Change-Id: Ic69b25c92ff45f349715a47b19c3f3c1c40eabea
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2018-08-14 04:25:18 +00:00
Paul Lemire a488e8e371 GLTexture: simplify createOrUpdateGLFunction
By dividing code into function which make following the bigger picture
easier

Change-Id: I7c43178d5484b7d387f6ce7b9c36025d8e13c642
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2018-08-14 04:25:04 +00:00
Paul Lemire 5adb8f40f0 Texture: remove invalid property name
maximumLayers was renamed to layers in the 5.7 release
see commit 26d4260897

Change-Id: Ibe6e55bb5f6ad47181a4584a4eb32cdec3934034
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2018-08-13 19:35:05 +00:00
Paul Lemire f5456748d5 Improve backend texture unit tests
Change-Id: Ie7baba99e03defcd3d8194fd11838a86d1680060
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2018-08-13 19:34:41 +00:00
Paul Lemire 93b70cca96 Allow to build assimp sceneparser on Android when using clang
Which should be all Android builds since gcc has been deprecated
in favor of clang in the NDK.

Also disable building of tools when cross compiling

Change-Id: Idb3f88130bf211926f7dd4ce52ac6582d806570d
Task-number: QTBUG-65542
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2018-08-13 19:31:24 +00:00
Paul Lemire 752ee8daab Fix typo on loadscenejob.cpp
Change-Id: I2fdb971bdf24669622752e62b656fcc403c17ee0
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2018-08-13 19:30:25 +00:00
Laszlo Agocs 3a3fa5db6c ResourceAccessor: allow read-only access to textures
Change-Id: I0a8d20081912f3ff9a037cab74702581b3b02613
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2018-08-10 11:52:17 +00:00
Paul Lemire 85f8e910fa Properly update properties from Backend to Frontend textures
Taking into account we have texture sharing in the backend,
we can only update frontend texture properties once we have
created the shared backend texture.
Code was adjusted to retrieve these properties when creating
the GLTexture. Such changes are stored and sent on the next
run loop from a job where they are distributed to all referenced
frontend Texture.
The status property handling has also been updated to send status
changes to all shared textures instead of just the texture whose
data generator is used to gather the data.
A manual test checking texture property updates, sharing and
remote url sharing has also been added.

Change-Id: I8ed2449fe57c9d7337580b0f7561f974cbd5006d
Task-number: QTBUG-65775
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2018-08-08 13:41:13 +00:00
Sean Harmer 0b10ab797f Apply similar logic to the native Qt 3D animation clip selection
If the file contains a single animation use that clip. Otherwise we
then consider animationName and animationIndex with the index having
priority.

Change-Id: Id974b1d446d6067bbe4c5ecce9f20891cb1086b0
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2018-08-02 08:57:18 +00:00
Sean Harmer 80a51b60c2 Add support for loading specific animations from glTF 2 files
Can now specify source urls to QAnimationClipLoader with query
parameters for animationIndex or animationName.

Add a new manual test to demonstrate/test this by loading the 2nd
animation from the Rigged-Simple.gltf file.

Will followup with the same support for Qt 3D native json animation
files.

Change-Id: Icb66073f29b8471fe06e2e2e9c43720567dc9ee5
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2018-08-02 08:57:15 +00:00
Takumi ASAKI 8b9f4b0936 Doc: Fix incorrect GoochMaterial properties name
Change-Id: Ic2062cec8faaeed072c76f7f985b92a1e732454b
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-08-01 06:27:35 +00:00
Juan Jose Casafranca 6caecac1c8 Enable ConstantInterpolation for fcurves
Change-Id: If51c8377f5b29433feaa520a7586f0608b7510f1
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2018-07-31 16:44:52 +00:00
Antti Kokko ed1ca081f0 Add changes file for Qt 5.9.6
Change-Id: I8409969e743e993d19af0f94597a4e0d5d017721
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
(cherry picked from commit ea18da8361)
Reviewed-by: Antti Kokko <antti.kokko@qt.io>
2018-07-31 09:59:34 +00:00
Antti Kokko f0c8d7154c Add changes file for Qt 5.9.5
Change-Id: I8bbd918922e4d9aab0c9fa4b2751de21313fc09b
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
(cherry picked from commit 096500140b)
Reviewed-by: Antti Kokko <antti.kokko@qt.io>
2018-07-31 09:59:30 +00:00
Oswald Buddenhagen ef2b1fe00f Bump version
Change-Id: I63d64f2dc716890274394fa3f5dce34f04fabb9a
2018-07-30 18:44:40 +02:00
Paul Lemire c3c4d7073b Request manager to cleanup ShaderBuilder entries that are removed
Change-Id: Icc5b19a1971510bb2df3263862311a2f980b5eac
Task-number: QTBUG-69695
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2018-07-30 13:44:47 +00:00
Paul Wicking 9b00bfe82f Doc: Use correct module name
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>
2018-07-30 12:35:57 +00:00
Paul Lemire 9e20a1d578 QTextureImage: warn user that remote urls on QTextureImage aren't yet supported
Change-Id: I19debff59679901ddf1763062ef917023d413fd5
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2018-07-20 19:47:24 +00:00
Paul Lemire 2fe1ab3715 Texture: properly handle texture sharing with remote URLs
Change-Id: I6f5ed6b04023578d389c41c4616b8ddb364bdc37
Task-number: QTBUG-69543
Reviewed-by: Mike Krus <mike.krus@kdab.com>
2018-07-20 19:47:05 +00:00