summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Update NodeInstantiator's children on parent updateMauro Persano2017-06-162-0/+15
| | | | | | | | | | | | | | Currently the parent for elements created by NodeInstantiator are set to the instantiator's parent. This doesn't work for nested instantiators, since at the time the inner instantiator's children are being created the instantiator itself doesn't yet have a parent node yet. Update the parent of elements created by the instantiator when the instantiator's parent changes. Change-Id: I6f260ad2a8a81af5551799e6c643d8849f46e342 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Doc: typo in definition qmltypeNico Vertriest2017-06-161-1/+1
| | | | | | | QAbsractClipAnimator --> QAbstractClipAnimator Change-Id: Iad454a48f22741e9c22e0539981a7e0b1c74c1dd Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix mix up regarding QVariant::isNull() and isValid()Laszlo Agocs2017-06-161-2/+2
| | | | | | | | | Needs isValid() to check for a default constructed QVariant with no underlying type yet. Using isNull() was a mistake since it will be true for many default constructed types (0.0f, QVector3D(0), etc.) Change-Id: I1c7ac10bbb0732a40b67e7dbf61ae5d4185ebac2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add missing private export macrosMike Krus2017-06-1638-38/+76
| | | | | | | | Was found when Nathan tried extending QCamera. Probably good to go through other parts of Qt3D. Change-Id: I317acaa36ffe3fd0b1ac0bbf4af70eabb1111ab7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Pick the right type for QVariant channel targetsLaszlo Agocs2017-06-142-0/+11
| | | | | | | | | | | | | | | Animating a Parameter node would be impossible otherwise since the 'value' property is a QVariant so QChannelMapping has no chance of know what really is expected there. If a value is already set, we can automatically determine the QVariant's underlying type. If not, show a warning since we have no chance then. Start handling QMetaType::Float as well since a QVariant will ofen contain this, not a Double. Change-Id: I0ba2abbb2c8d85f2aa1a152ed4b8c6cd26f1fc97 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add support for linear interpolation in clip jsonLaszlo Agocs2017-06-141-7/+12
| | | | | | | ...and add an autotest Change-Id: I5c473f5f5918db9cc108f9966fe549e2cba374de Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix memory leak in Quick3DNodeInstantiatorPrivateMauro Persano2017-06-141-1/+2
| | | | | | | | | Objects are managed by the instance model, so delete instead of deleting objects directly. Task-number: QTBUG-61293 Change-Id: I6ff17e646fce60bf12d575c4c377bee3c82a60cb Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add support for animating a QColorLaszlo Agocs2017-06-141-3/+19
| | | | | | | | Using components R, G, B and expecting redF(), greenF() and blueF() in the corresponding keyframes. Change-Id: Ibac1488fe87bdf39d3446b23120114952874a5dc Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Implement linear interpolation for animationsLaszlo Agocs2017-06-141-5/+28
| | | | | Change-Id: I88522f53bead171f5ee7411b255d729ba5eb9565 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix small memory leak in QRenderAspectPrivateMauro Persano2017-06-091-0/+2
| | | | | | | | Release scene importers on destruction. Task-number: QTBUG-61293 Change-Id: I48dfcc3f029cc90e32bb81ae47d53aa27b8ce5de Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix small memory leak in GraphicsContextMauro Persano2017-06-091-0/+2
| | | | | | | | Release GraphicsHelperInterface instances on destruction. Task-number: QTBUG-61293 Change-Id: I989aefb9102dd8772288d8a46cd47dbe3d16e8c0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Doc: add basic doc to undocumented classesNico Vertriest2017-06-096-0/+32
| | | | | Change-Id: Ib67712bd961a3e0b113ddd25feaa819695e792b9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove redundant code in AlphaCoverage/SeamlessCubemap render statesMauro Persano2017-06-083-19/+6
| | | | | | | | | | The render states AlphaCoverage and SeamlessCubemap will only be added to the render set when their nodes are enabled, so there's no need for an additional boolean field in their backend nodes. Task-number: QTBUG-60419 Change-Id: I3184c665b1d1bd10c067428b2acac6cfb68bd638 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix animation inifinite loopingLaszlo Agocs2017-06-081-1/+1
| | | | | | | | Trigger also on -1, which is what QAbstractClipAnimator::Infinite is defined as. Updated tests to reflect this change. Change-Id: Ib33a5e9b58f48b3810a0238b7682e532e382c050 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Initialize member variable (found by GCC 7)Thiago Macieira2017-06-061-0/+1
| | | | | | | | shaderparameterpack_p.h: In function ‘void Qt3DRender::Render::RenderView::setUniformBlockValue(Qt3DRender::Render::ShaderParameterPack&, Qt3DRender::Render::Shader*, const Qt3DRender::Render::ShaderUniformBlock&, const Qt3DRender::Render::UniformValue&) const’: shaderparameterpack_p.h:76:8: error: ‘uniformBlockUBO.Qt3DRender::Render::BlockToUBO::m_needsUpdate’ may be used uninitialized in this function [-Werror=maybe-uninitialized] Change-Id: Ia3e896da908f42939148fffd14c4b22aab21f0ef Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Make render states honor the enabled flagMauro Persano2017-06-061-2/+5
| | | | | | | | | Currently render states are added even when enabled is false. Don't add them to the render state set if they are disabled. Task-number: QTBUG-60419 Change-Id: I89841b9978b5f47e71cf378796726bbaedebc127 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix GCC 7 warning about case fallthroughThiago Macieira2017-06-031-1/+1
| | | | | Change-Id: Ia3e896da908f42939148fffd14c480984f452a5c Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Normalize Q_ARG to avoid temporary memory allocationsSergio Martins2017-06-034-6/+6
| | | | | | | Found by -Wclazy-connect-not-normalized Change-Id: I774424bb53c0d24bd49d5fafdfb8f02e9f05ee16 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Merge remote-tracking branch 'origin/5.9.0' into 5.9Liang Qi2017-05-314-17/+33
|\ | | | | | | Change-Id: I57fe6fefc8a4f15c26c33cc2717eaf934b57bf60
| * Don't use a static value for the value type providerv5.9.0-rc2v5.9.0-rc1v5.9.0Sean Harmer2017-05-191-3/+6
| | | | | | | | | | | | | | | | | | | | Avoids the destruction of the provider at shutdown which if not previously added as a provider triggers an assertion. We use a pointer and avoid this static destruction codepath. Task-number: QTBUG-56546 Change-Id: I934ef79ce62e4adb41caf8058a065b8b0dcf42a6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * OnDemand rendering: only skip rendering jobsPaul Lemire2017-05-193-14/+27
| | | | | | | | | | | | | | | | | | As we still need to perform some of the jobs like picking, buffer loading.... Change-Id: Ic771533b6f114400fa431f6de5ad8259a2a17c71 Task-number: QTBUG-60738 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Support setting texture format on QTextureLoaderSean Harmer2017-05-302-25/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | This allows to specify the data loaded from a png image should be using the SRGB8_Alpha format instead of the usual RGBA8_UNorm format such that we get hardware sRGB->linear color conversion when sampling from such a texture. This is needed for serious use of PBR as the albedo/base color texture is often sRGB encoded. Task-number: QTBUG-60977 Change-Id: I0fd2baf533bb69eaf9e4ae5b696e2841f89a51e7 Reviewed-by: Robert Brock <robert.brock@kdab.com> Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Add reference count for backend buffersMauro Persano2017-05-303-7/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the main rendering loop, first dirty GL resources are uploaded, then render views are submitted, and then unused GL resources are released. Consider the following piece of code: entity->setParent(nullptr); entity->setParent(root); If this is executed inside a single frame, entity's children buffers will be marked for release when they are removed from the scene, and marked as dirty when they're added again. In the following frame, the render thread will upload them at the beginning of the frame, and incorrectly release them at the end of the frame. This patch adds a reference count for buffers in BufferManager to prevent this kind of race. The reference is incremented when a buffer is added to the scene (in Buffer::initializeFromPeer) and decremented when it's removed from the scene (in BufferFunctor::destroy). Task-number: QTBUG-60726 Change-Id: I8eed7b4c2d8262ba846e73bf4299edae7bc16b3e Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Fix crash when loading fbx file with embedded texturesMounir BOUDRIFA2017-05-301-1/+1
| | | | | | | | | | | | | | Task-number: QTBUG-59135 Change-Id: If5e210a415bae8c5be72da8dff587af154db4203 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Fix context sharing in scene2dMäättä Antti2017-05-272-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The scene2d context sharing fails if the share context is in use when scene2d tries to create it's context. This happens when the scene2d is initialized while Qt 3D is already using it's own context. In Scene3D case we always create another context to prevent this. Change the Qt 3D to create it's own share context only when it's context shareContext is not set. Also change the format in scene2d to always get it from the share context so that it matches with it and the sharing works with all platforms. Task-number: QTBUG-60974 Change-Id: I11df0b647207dbcc1d285ae4687c1e37010443f2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Fix container detachments detected by clazySergio Martins2017-05-265-6/+9
| | | | | | | | | | Change-Id: I551073c386247215f1c51dce92e5f05b5d335cc0 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Doc: add doc to undocumented Qt3D classesNico Vertriest2017-05-226-0/+43
| | | | | | | | | | Change-Id: Idb1f1b06b43f24dcab6a2e3eab023c134308623b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge branch '5.9.0' into 5.9Sean Harmer2017-05-2070-874/+2385
|\| | | | | | | Change-Id: Icb23dcb19d312559f5f4a71bde3dc26bf4a19408
| * Don't use seamless cubemap on GL <3.2Sean Harmer2017-05-171-2/+0
| | | | | | | | | | | | | | | | | | | | Otherwise it just floods with qWarning messages. This is only available on GL 3.2 or newer so only try it there. Task-number: QTBUG-60180 Change-Id: I8681c900ad5febc28a671305fa8c5d2e81662cab Reviewed-by: Oleg Evseev <ev.mipt@gmail.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * Ensure normal vector is normalized following interpolationSean Harmer2017-05-161-2/+4
| | | | | | | | | | | | | | | | | | Fixes "per-vertex" appearance of specular highlight in QMetalRoughMaterial. Task-number: QTBUG-60181 Change-Id: I03fd54ff997242fd987174d453642bd00076e26f Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
| * Match the Blinn-Phong specular power to be consistent with IBLSean Harmer2017-05-162-61/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | Use the same specular power as a function of roughness as used by Blinn-Phong in other engines and in Lys which is used to generate the image based lighting specular maps. During testing, noticed the specular highlight from punctual lights seems more like it's per-vertex based. Task-number: QTBUG-60181 Change-Id: Id379d59a5e1295c2cdf9bdabf246b7e0c0a9c499 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
| * Improve the roughness to mip level mappingSean Harmer2017-05-162-20/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We follow the approach used by Lys as detailed at: https://docs.knaldtech.com/doku.php?id=specular_lys Along with the perceptual linear roughness remapping as used by: UE4: http://graphicrants.blogspot.co.uk/2013/08/specular-brdf-reference.html Frostbite: http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf We should also check the punctual light implementation of Blinn Phong specular power based on the above references. Task-number: QTBUG-60181 Change-Id: I8ca6116d8d7847a8f200f366dcd11f693810608e Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
| * Renderer: prevent crash in case texture failed to be builtPaul Lemire2017-05-161-0/+2
| | | | | | | | | | | | | | This can occur if a TextureLoader fails to load (wrong path, access denied ...) Change-Id: I55b62312db79db3980146bb17cbadbe5c66d7a48 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Fix speed regressions in ES2 shadersOleg Evseev2017-05-161-173/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The GLSL ES specification (up to at least 3.0) does not mandate support of dynamic indexing of uniform block arrays. For that reason loops in ES2 shaders were unrolled by calling separate functions, but it had leaded to rendering speed regressions. This patch reverts loops unrolling using separate functions and replaces dynamic indexing in place instead. Task-number: QTBUG-60183 Task-number: QTBUG-54994 Change-Id: Ieb036f442922de312b2941a0b8c511c0b4b3ec5a Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Oleg Evseev <ev.mipt@gmail.com>
| * Fix qmlClearTypeRegistrations for Qt 3DMäättä Antti2017-05-124-1/+13
| | | | | | | | | | | | | | | | | | | | Unregister valueTypeProvider in qtquick_global.cpp to prevent multiple registrations. The Quick3DColorProvider doesn't seem to cause problems so leave as it is. Task-number: QTBUG-56546 Change-Id: I79139d8e8ab80458e72633dd97e15dbf108388e4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Fix SC breakSean Harmer2017-05-121-0/+8
| | | | | | | | | | Change-Id: If9bd9142dcfceedb8baefe0c8229e7eb7e1e6e50 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * Write docs for advanced custom material exampleMäättä Antti2017-05-101-3/+6
| | | | | | | | | | | | | | | | Also add it to highlighted items. Task-number: QTBUG-60287 Change-Id: I87a6074bed171970b287c6cd934e6550d86e27e0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * QNode: setParent create creation change only when neededPaul Lemire2017-05-101-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two cases need to be handled by setParent: 1) Parent already has a backend node and receives a new child -> in which case we need to send the creation event to the backend 2) Parent was created in the frontend, but has no backend (delayed notification sending because a ctor can't call a virtual) -> in that case, when adding a child and setting its parent we shouldn't be sending the creation change. We rather let that be handled when the creation change for the parent is requested Change-Id: I434c7d4e6af785c0314ac6538dc689992d90ed0c Task-number: QTBUG-60612 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Oleg Evseev <ev.mipt@gmail.com>
| * Improve QScene2D documentationsMäättä Antti2017-05-091-6/+91
| | | | | | | | | | | | | | | | Add missing docs and add usage instructions for the Qml type. Change-Id: Id52025f0022bbaad56b0dbf4aa8ed33575568ceb Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Add quick3d class for VertexBlendAnimationAntti Määttä2017-05-095-3/+209
| | | | | | | | | | | | | | | | | | Add the missing class for VertexBlendAnimation so that it can be used from qml. Task-number: QTBUG-60618 Change-Id: If47dccf5e44d0158053ca3b9122fcef91d73ea93 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Merge "Merge remote-tracking branch 'origin/5.9' into 5.9.0" into ↵Jani Heikkinen2017-05-097-34/+95
| |\ | | | | | | | | | refs/staging/5.9.0
| | * Merge remote-tracking branch 'origin/5.9' into 5.9.0Oswald Buddenhagen2017-05-087-34/+95
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/render/geometry/buffer.cpp Change-Id: If4d28a1e4c95cbd8e81b1751eed3214952516d8c
| * | | Add documentation for Scene2D exampleSean Harmer2017-05-091-1/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: I2d47b9224e4f26b342cd8a9bbe3c9c5a5e410dc1 Reviewed-by: Antti Määttä <antti.maatta@qt.io>
| * | | Scene2D cleanup - register pick events when scene is initializedAntti Määttä2017-05-098-103/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current model where mouseGrab is connected to picker signal doesn't work. The pressed event is not sent to scene2d item, because it is already lost when scene2d gets the grabMouse message where it registers to the picker events. This breaks the mouse event sequence (press-move-release) for the quick item. Instead hook to setScene of the node to message scene2d when the scene gets initialized and always register to the picker events. Task-number: QTBUG-58876 Change-Id: Ic9ca4b0899a030336ef20ff2cffbe10b567c36f5 Reviewed-by: Antti Määttä <antti.maatta@qt.io>
| * | | Scene2D cleanup - remove qml engine and sourceMäättä Antti2017-05-094-205/+9
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove QQmlEngine constructor and source property. Update unit tests and manual tests accordingly. Task-number: QTBUG-58876 Change-Id: Ide06bb1381f48efa5378f9a008476734a33089c1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
| * | Scene3DRenderer: fix race conditionv5.9.0-beta4Paul Lemire2017-05-063-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the window geometry changes, the Scene3DRenderer was updating a Qt3D frontend node's property from the QSGRenderThread. This resulted in the QPostman::notifyBackend being called from possibly two threads at the same time, resulting in a race condition where the changes would never be submitted again to the backend. Change-Id: I842aaa54637d85d4d45eb54620749efb36168e2a Task-number: QTBUG-54900 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Oleg Evseev <ev.mipt@gmail.com>
| * | Add documentation for simplecustommaterial exampleMäättä Antti2017-05-051-1/+2
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-60287 Change-Id: Id167ddd190b7aa5468bc6590c9f9f4fea234430b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | Scene2D: put picking coordinates back in window coordinatesKevin Ottens2017-05-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | We get the picking coordinates in model local tex coords which have a different convention than the mouse events in window coordinates. So flip them vertically to pass them in the right convention. Change-Id: I558cc62c7c820677407730eead8011193a4b967c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | Add a new mirrored property to QPlane(Mesh|Geometry)Kevin Ottens2017-05-056-7/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is regularly necessary to be able to flip vertically the UV coordinates on the plane mesh depending if we are using a texture in model space coords or in window coords. Especially necessary now with Scene2D which outputs textures in window coords. This property is necessary to make it usable. Change-Id: I0fe7d3fdc125f1791492cf39ebe908bbc20f1db2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | Apply layer filter to light sourcesLaszlo Agocs2017-05-051-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Cannot just take all entities with light components: the layer filter must be applied as usual. Task-number: QTBUG-60573 Change-Id: I361fab88745113c1b24b68cbff52051139046d9c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>