Commit Graph

5994 Commits

Author SHA1 Message Date
Sean Harmer 1071f3e6a2 Add private module qt3dcoretest
Static library containing helpers for unit tests to avoid having to
build the same files 200 times.

Change-Id: I89d63abbd7777a96276154298c2748e2d6774514
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2017-08-03 14:34:56 +00:00
Nico Vertriest 5156fcf380 Doc: fix minor link issue
qlevelofdetail.cpp:270: warning: Can't link to Qt3dRender::QLevelOfDetailBoundingSphere

Change-Id: I29b023f5a2c60a62dd7bdacf63182649dd947059
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-08-03 09:48:05 +00:00
Paul Lemire 7d0454bd92 Fix compilation on linux with -qt3d-profile-jobs
Change-Id: Iebecab6fa362bb6bda4ee720cb0259214ced52a4
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-08-03 08:16:15 +00:00
Wieland Hagen e0ecb87437 Fix deferred-renderer-qml lighting
The lights must be part of entities that are actually included in the
final scene effect layer. So the light world positions have to be
forwarded from the actual scene entities to some "dummy" light entities
that exist just for the final scene effect render step.

Also correct model / modelNormal matrices must be used for global
normal/position calculation in the GBuffer render step.

Task-number: QTBUG-46707
Change-Id: I380d2e2ecb008ab0606dcd36cd5d98dd1ec41ba6
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-08-02 17:42:56 +00:00
Wieland Hagen e96ed4009c deferred-renderer-qml example: add all .qml files to project
Change-Id: I9add67acbfab26c78c137753bb6b81865bf0abcf
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-08-02 15:20:06 +00:00
Nico Vertriest 8e989d2642 Doc: correct link to Texture
qparameter.cpp:47: warning: Can't link to Texture

Change-Id: I32bd287393d0704246d28768f949f84e161ca7fb
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2017-08-02 13:37:33 +00:00
Paul Lemire b49316269c Fix RenderCommand sorting
- Remove type punning mechanism that was used to filter previously (could lead
  to undefined behavior)
- Properly filter based on shader and material
- Add unit tests

Change-Id: I8d0fd4a49d586e6ec26515e2cafe1ea94d38f8f1
Task-number: QTBUG-60183
Reviewed-by: Oleg Evseev <ev.mipt@gmail.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-08-02 10:45:35 +00:00
Wieland Hagen 3f6a0f18a5 Fix RenderState property updates
Some had old property names

Change-Id: Id82fcce9dac05d2566bafabebf66ff51300db16d
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2017-07-22 11:07:57 +00:00
Marc Mutz 2a0327d15d Use QSharedPointer::create() more
This is the result of running the (experimental) clang-tidy check
   qt-modernize-qsharedpointer-create

Discarded changes: none.

Change-Id: Ic6368521ebf5841267ffe7917cc652627f7b26a7
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-07-22 10:20:12 +00:00
Thiago Macieira 008b3906bd Fix build: src/plugins/sceneparsers/assimp depends on Qt3DAnimation
/usr/bin/ld.gold: error: cannot find -lQt53DAnimation
 assimpimporter.o:assimpimporter.cpp:function Qt3DRender::AssimpImporter::node(aiNode*): error:
 undefined reference to 'Qt3DAnimation::QKeyframeAnimation::setTarget(Qt3DCore::QTransform*)'

Change-Id: I84e45059a888497fb55ffffd14d2e19ea52ecf55
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2017-07-20 18:23:43 +00:00
Määttä Antti 102fef33f1 Fix memory leaks in assimp SceneLoader
Add deallocation guard agains resources allocated by the assimpimporter and
deallocate them when the scene is deallocated.

Task-number: QTBUG-61856
Change-Id: I2f7ddb1654da1674fa448861dfd2b368a55eb4f0
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2017-07-20 06:31:04 +00:00
Paul Lemire d826206802 RenderCapture: read back from the correct framebuffer
Up until now, RenderCapture would read back from the back buffer. In cases
where it's used within a RenderTargetSelector, it should instead read back
from the ColorAttachment0 of the framebuffer.
Later on we might allow to specify the ColorAttachment.

Change-Id: I9ca94333184338b2fdb79c5c2668d5929ac8d405
Task-number: QTBUG-61547
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
2017-07-17 09:28:56 +00:00
Tasuku Suzuki dc744a54ae Improve supported file format documentation in QMesh
Change-Id: I2078bec7dccea9f2c41978da310376df4ed84cff
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-07-13 08:33:01 +00:00
Wieland Hagen cadfd44c77 Apply slight z-offsets to distance field glyphs
When rendering distance field text, z-fighting may occur between
adjacent glyphs. To prevent this, we apply a very slight Z offset
to each rendered glyph.

Change-Id: I19f9808267547ae9521757c6022b4f65c1ca4ba5
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-07-07 09:35:40 +00:00
Wieland Hagen 29a6f78653 QTextureAtlas: pad sub-images with zeroes instead of border pixels
Fixes glitches in the distancefield text rendering

Change-Id: If957904906025d7eeb974a8fa808f9e6fafd1b79
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-07-07 09:35:38 +00:00
Laszlo Agocs b891cf66a3 Avoid crashing when there is one single keyframe
Change-Id: Ibb98f9ab222acdd47ebdf7d2d6ca8639ed7681c1
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-07-05 14:34:01 +00:00
Giuseppe D'Angelo 83cff579d1 Match the DDS/PKM file extension case-insensitively
... or you won't be able to load a file called "FOO.DDS".

Task-number: QTBUG-61760
Change-Id: Id46163f62e20e37a844fa60e0be6be2881280a2c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-07-03 10:15:47 +00:00
Laszlo Agocs 513b4fbcab Fix ClipAnimator crash when removing animators
When passing around animator handles, care must be taken before
actually using them since the animator component may have been
destroyed in the meantime.

Change-Id: Ib963d1422e1626b5a06e5bb157a0b6aab76b961d
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-30 17:29:43 +00:00
Liang Qi dee403c691 Merge remote-tracking branch 'origin/5.9.1' into 5.9
Change-Id: I4e58af30b6b735f2cd098051abcb1daaa4fbf845
2017-06-30 10:08:18 +02:00
Oswald Buddenhagen a2b9a69373 Bump version
Change-Id: Ic013a97a01d952c1e7b8c1406950b1ac83c13f35
2017-06-30 09:52:27 +02:00
Wieland Hagen 86ec8ca096 Make sure Qt3D gets a clean OpenGL state in Scene3D item
We need to reset the state before and after rendering,
because it may have been dirty before  and it might be dirty
afterwards.

Change-Id: Iaa32243aa5721d3e2319b2a58987624f30d6482d
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-29 12:26:32 +00:00
Wieland Hagen a530a45d1a Fix Deferred-Renderer examples
RGB32F and RGB16F will not work on some drivers.
Shader variables must be initialized to zero, will flicker if not done.

Task-number: QTBUG-56248
Change-Id: Iead5df1a607db80b733aefa73d7a59c8310a8d81
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-27 18:23:11 +00:00
Wieland Hagen 638b8e4aaf Fix renderer crash when camera is not set via CameraSelector
Entities would try to render and get their projection-matrix based uniforms
from the camera lens, but that is NULL. Print a warning in that case,
as that means that either a NoDraw is missing or a CameraSelector.

Task-number: QTBUG-61656
Change-Id: Ie2bd0d115f3f61568c5b176c6a22500d29495328
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-27 18:23:08 +00:00
Wieland Hagen 4d3dd82aaa SkyboxEntity: Shaders should be usable by OpenGL 3.0
Change-Id: Ia853e8e4eb2d13ec4805e79dad5f65b6fcf73cfc
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-27 18:23:04 +00:00
Määttä Antti 603663b74a Change manual tests using Scene2D to use TextureMaterial
Change render-qml-to-texture-qml and video-texture to use TextureMaterial.
This removes the dependency to the render-qml-to-texture manual test from
these tests. This also fixes the controls in the render-qml-to-texture-qml
test, which were 'upside down'.

Change-Id: I248014decd8f9d06b0e0922d035afe8c0b0f78ff
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-24 12:59:19 +00:00
Paul Lemire a75551c90b RenderCapture: fix race + random crash
Access to the vectors needs to always be protected with mutex

Change-Id: I460a1010fec02c445012e371be73ba0175521c02
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-23 13:01:37 +00:00
Antti Kokko 6310f05596 Add changes file for 5.9.1
Change-Id: I2d3cbdad72e97e3b6761c4acff80ec769a5c58bd
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-23 06:37:18 +00:00
Määttä Antti 927cdc4bde Fix QRenderCaptureReply deallocation
Add deallocation guard and set parent of the reply.

Task-number: QTBUG-61508
Change-Id: Ia299450d792b2254c2944472382c8241b271ebf6
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-21 11:03:29 +00:00
Määttä Antti 920e9ecef3 Add warnings to readFramebuffer
This allows detecting problems with the render capture if the capture
fails.

Change-Id: I20f630eb9a1adb677513ff225d21c7e338c57809
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-20 09:58:58 +00:00
Nico Vertriest c07aaf56c1 Doc: link errors
qclipanimator.cpp:55: warning: Can't link to AbstractAnimationClip
qparameter.cpp:47: warning: Can't link to 'Texture'
qclipanimator.cpp:55: warning: Can't link to 'ChannelMapper'

Change-Id: I84d8de99d5cfdc390b4e33fdae5882d60842b519
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-06-20 09:47:47 +00:00
Nico Vertriest c5cdc9b912 Doc: correct \property statements
qblendedclipanimator.cpp:276: warning: Unrecognizable QML module/component qualifier for AbstractClipBlendNode blendTree
qclipanimator.cpp:124: warning: Unrecognizable QML module/component qualifier for AbstractAnimationClip clip

Change-Id: Ia1b43f1089ad9d4c8079084c4b2d29e487a55b8a
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-06-20 09:47:34 +00:00
Nico Vertriest 87dd9e3890 Doc: correct \property and \qmlproperty statements
functionrangefinder.cpp:54: warning: Invalid syntax in '\fn'
qabstractclipanimator.cpp:127: warning: Unrecognizable QML module/component qualifier for bool running
qabstractclipanimator.cpp:168: warning: Unrecognizable QML module/component qualifier for int loops
qadditiveclipblend.cpp:173: warning: Unrecognizable QML module/component qualifier for AbstractClipBlendNode baseClip
qadditiveclipblend.cpp:191: warning: Unrecognizable QML module/component qualifier for AbstractClipBlendNode additiveClip
qabstractclipanimator.h:62: warning: No documentation for Qt3DAnimation::QAbstractClipAnimator::Loops

Change-Id: Iab2686f55149a6998eac81ca0aab991b815b12d9
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-19 11:59:02 +00:00
Laszlo Agocs 67216fee99 animationutils: Improve autotests for QColor
Change-Id: I88e254c36e99a83a8e7bbc562b7a729a04ace28a
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-19 08:37:31 +00:00
Oswald Buddenhagen e35b41fa9f Merge 5.9 into 5.9.1
Change-Id: Iaf884c049a4d109a0bb92e01c1e9f081ad5ce2b8
2017-06-19 08:20:51 +02:00
Mauro Persano 01a6bcd086 Update NodeInstantiator's children on parent update
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>
2017-06-16 12:53:49 +00:00
Nico Vertriest c804e393e7 Doc: typo in definition qmltype
QAbsractClipAnimator --> QAbstractClipAnimator

Change-Id: Iad454a48f22741e9c22e0539981a7e0b1c74c1dd
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-16 11:28:31 +00:00
Laszlo Agocs ff53707d66 Fix mix up regarding QVariant::isNull() and isValid()
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>
2017-06-16 10:31:20 +00:00
Mike Krus 716ef2a110 Add missing private export macros
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>
2017-06-16 07:31:10 +00:00
Laszlo Agocs 6263af1926 Pick the right type for QVariant channel targets
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>
2017-06-14 14:36:19 +00:00
Laszlo Agocs 86148b286b Add support for linear interpolation in clip json
...and add an autotest

Change-Id: I5c473f5f5918db9cc108f9966fe549e2cba374de
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-14 14:36:16 +00:00
Edward Welbourne 9c28631440 Remove misguided execute permissions from image files
Change-Id: I9079849c54deffbb15449d042ec0440e795c305b
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-14 11:39:22 +00:00
Mauro Persano d7cf168570 Fix memory leak in Quick3DNodeInstantiatorPrivate
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>
2017-06-14 11:15:42 +00:00
Laszlo Agocs 8155dae53f Fix and extend animationutils autotest
Test QColor and fix various issues and typos.

Change-Id: I559fa9887f65d176bb4b7d678deab0b182d0b3a8
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-14 10:50:05 +00:00
Laszlo Agocs e423907090 Add support for animating a QColor
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>
2017-06-14 10:41:37 +00:00
Laszlo Agocs 920d2e6e2b Implement linear interpolation for animations
Change-Id: I88522f53bead171f5ee7411b255d729ba5eb9565
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-14 10:16:13 +00:00
Mauro Persano 1661297138 Fix small memory leak in QRenderAspectPrivate
Release scene importers on destruction.

Task-number: QTBUG-61293
Change-Id: I48dfcc3f029cc90e32bb81ae47d53aa27b8ce5de
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2017-06-09 18:09:38 +00:00
Mauro Persano eeb42c08c3 Fix small memory leak in GraphicsContext
Release GraphicsHelperInterface instances on destruction.

Task-number: QTBUG-61293
Change-Id: I989aefb9102dd8772288d8a46cd47dbe3d16e8c0
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2017-06-09 18:09:22 +00:00
Nico Vertriest b2ae5770b5 Doc: add basic doc to undocumented classes
Change-Id: Ib67712bd961a3e0b113ddd25feaa819695e792b9
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-06-09 08:11:10 +00:00
Mauro Persano 842b8fa5ef Remove redundant code in AlphaCoverage/SeamlessCubemap render states
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>
2017-06-08 08:34:45 +00:00
Laszlo Agocs 93ea4251c7 Fix animation inifinite looping
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>
2017-06-08 08:31:49 +00:00