summaryrefslogtreecommitdiffstats
path: root/src/render
Commit message (Collapse)AuthorAgeFilesLines
* New prototypes for QShaderProgramBuilderRenato Araujo Oliveira Filho2017-09-071-0/+135
| | | | | | | | | | | Add new default prototypes that make more flexible for the apps to: Join two elements into one Join three elements into one Join four elements into one Cast an element into another Change-Id: I4544d3a193101a948b7017f2f12bd4f2d49ac892 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Initialize entity id in QPickEventPrivateMauro Persano2017-09-051-0/+1
| | | | | | Change-Id: Ic028e8bcd89c7d360eb088fc0cf7d8256f3948e3 Task-Id: QTBUG-62976 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Implement enabledLayers on ShaderBuilderKevin Ottens2017-09-042-1/+27
| | | | | | | | This is the backend counterpart to the QShaderProgramBuilder introduction of the enabledLayers property. Change-Id: Iecec5e9d1450c454f64c243f5f797c0d63e5f1ee Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Introduce enabled layers to QShaderProgramBuilderKevin Ottens2017-09-043-0/+34
| | | | | | | | This will allow to control the code generation by forwarding this to QShaderGenerator on the backend side. Change-Id: Ic613467ba742c05344ef553eabab861b2408d0ec Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QShaderLanguage to simplify protos and metal/roughKevin Ottens2017-09-041-217/+74
| | | | | | | | | | Thanks to those new enums and their support in the parameters system we can remove quite a few of the prototypes and give more expressivity in the material json files. Change-Id: I10780afca06c1c49e4bb99d90370abdc4c25919e Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Simplify node prototypes JSON using parametersKevin Ottens2017-09-041-226/+93
| | | | | | | | | Thanks to the parameters now being supported in the formats, we can simplify greatly the JSON file to have for instance a single sampleTexture prototype and not one prototype per possible texture name. Change-Id: I28f4f3e856f6cca0bbff579efb983bc13e0ea605 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge dev into 5.10Frederik Gladhorn2017-09-0210-19/+77
|\ | | | | | | Change-Id: I1bef655947a7176f7931c7f1b8ed4c4176395451
| * Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-09-0110-19/+77
| |\ | | | | | | | | | Change-Id: Ic4220f9957266c374f751d3612c60b81e9cea193
| | * Don't create GL textures when format is not setMauro Persano2017-08-312-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For textures where the format was not set (this may happen, for instance, for a Texture2D without TextureImage children), don't try to create a GL texture or the underlying OpenGL calls will fail. Also avoid trying to set the corresponding uniform while rendering. Change-Id: I17d95e2a2f1f1a1e5c22a0296c8641c4873e9e7f Task-Id: QTBUG-62654 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| | * Doc: add missing doc QGeometryNico Vertriest2017-08-301-0/+18
| | | | | | | | | | | | | | | Change-Id: I9d1fef3f793f9d3eb4ef0bb3fff356539fc03e2c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| | * Fix hover event handlingMike Krus2017-08-301-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | HoverMove is not a QMouseEvent. So we generate a fake one and send it for picking processing. Task-number: QTBUG-58607 Change-Id: Iaa06bfe49494db1a46cc021747fd5d0026330525 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| | * Doc: add doc to undocumented methods qt3dNico Vertriest2017-08-294-12/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qabstractlight.h:65: warning: No documentation for 'Qt3DRender::QAbstractLight::Type' qspotlight.h:64: warning: No documentation for 'Qt3DRender::QSpotLight::attenuation()' qshaderprogram.h:78: warning: No documentation for 'Qt3DRender::QShaderProgram::Status' qshaderprogram.h:121: warning: No documentation for 'Qt3DRender::QShaderProgram::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &change)' qpicktriangleevent.h:57: warning: No documentation for 'Qt3DRender::QPickTriangleEvent::uvw' Change-Id: Iedb73cc73bc28a5e9dd3498a0bb6547eb1a96ffc Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| | * Don't dereference null vaoSergio Martins2017-08-251-2/+4
| | | | | | | | | | | | | | | | | | | | | RPI doesn't support vao Change-Id: Icfcf90c6aff53a73704cc36c215b7b452be86778 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| | * Remove ill-timed viewVec-upVec check in QCameraLaszlo Agocs2017-08-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The check for parallel view and up vectors is well-intentioned, but it cannot be done this way: the view matrix is updated already after setting any of position, view center, or up vector. The (failing) check can thus be triggered right after setting a position or view center that (temporarily) results in a vector colinear to the (not yet final) up vector. Change-Id: I083200bf05582517880a88816b7987874810c2bb Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Send joint names and local poses from render to animation aspectSean Harmer2017-08-302-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow the animation aspect to easily update the local poses of all joints in a skeleton without needing to be able to address any frontend QJoint objects. Change-Id: Id2137f2533702387dc68296aba1dd8627b0599d6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Factor out local poses into their own vectorSean Harmer2017-08-305-16/+25
| | | | | | | | | | | | | | | | | | | | | | | | To make it easier and more efficient to send all the local poses for a skeleton between aspects. Change-Id: I68bf374a7d466f606f8979fdbf84cb697a47a8a7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Add name property to QJointSean Harmer2017-08-303-9/+17
| | | | | | | | | | | | | | | | | | | | | And set it from the backend when creating frontend joints. Change-Id: I26d37c7f516944eb353af38716aab4c55bd2f79f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | | Store joint names in their own vectorSean Harmer2017-08-304-4/+13
|/ / | | | | | | | | | | | | | | | | This makes the JointInfo vector smaller (better cache performance) and also makes it cheaper to pass the joint names over to the animation aspect in a following commit. Change-Id: I1a892c1639dc055757906179d2fab89aad5fa81c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | BlitFramebuffer framegraph nodeJuan José Casafranca2017-08-2328-4/+890
| | | | | | | | | | | | | | | | This node allows to copy the content from one FBO to another or to screen Task-number: QTBUG-58162 Change-Id: I6016c46d9d538a012c2f641116ed766dd70ad021 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Don't call deprecated QImage::byteSize() functionSean Harmer2017-08-221-1/+1
| | | | | | | | | | Change-Id: Ib2c1150e4612b378e5b04d0ea424f38af2c434c2 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | RenderQueue: make it hold its mutexPaul Lemire2017-08-226-22/+13
| | | | | | | | | | | | | | Allows to slightly clean up the renderer and remove things from the past. Change-Id: I04da9c4f9039df0de22e4da1dbd9193741e92a4d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge branch '5.9' into devSean Harmer2017-08-1940-175/+575
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/render/backend/renderer.cpp src/render/backend/renderview.cpp src/render/graphicshelpers/graphicscontext_p.h src/render/graphicshelpers/graphicshelperes2_p.h src/render/graphicshelpers/graphicshelpergl2_p.h src/render/graphicshelpers/graphicshelpergl3_2_p.h src/render/graphicshelpers/graphicshelpergl3_3_p.h src/render/graphicshelpers/graphicshelpergl4_p.h src/render/graphicshelpers/graphicshelperinterface_p.h src/render/jobs/pickboundingvolumejob.cpp tests/auto/animation/clipanimator/tst_clipanimator.cpp tests/auto/auto.pro tests/manual/manual.pro Also disabled the QQmlMetaType codepaths following commit 49a11e882059ee1729f776722e085dd21d378c36 in qtdeclarative. The QQmlMetaType codepaths will be re-enabled once a qt5.git integration has succeeded. Change-Id: Ia654d75425e6d406c472d19864383612208cad2b
| * Fix qml signal documentation for QObjectPickerPaul Lemire2017-08-181-35/+62
| | | | | | | | | | | | | | | | Also align everything properly Change-Id: I7948670912f3d321829ee1af90ebcb2497b6f98f Task-number: QTBUG-61996 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Doc: add missing QGeometryRenderer Lines primitive typeMassimo Callegari2017-08-161-0/+1
| | | | | | | | | | Change-Id: Id9b03475181ef28dbee7d51d5ef3f7671f815343 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * VSyncFrameAdvanceService: fix Scene3D renderingPaul Lemire2017-08-114-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When rendering with Scene3D it could be that doRender() is called a lot more times than the speed at which the Qt3D simulation loop is running (this happens when resizing the window) This results in vsyncFrameAdvance->proceedToNextFrame() being called while the simulation isn't in a waiting state (simulation loop not yet blocking on vsyncFrameAdvance->waitForNextFrame()). This means that when the simulation loop finally unlocks, it would be able to make several loops for a given frame. Obviously this is really dangerous as the simulation loop drives the synching of changes and this could result in the data being prepared by the render jobs and the actual data in the managers to be corrupt. To fix that, vsyncFrameAdvance->waitForNextFrame() now acquires all available resources + 1 to cope with proceedToNextFrame being called more than once. Obviously this doesn't happen when Qt3D drives the rendering and the VSyncFrameAdvanceService was adjusted to have different behaviors depending on whether we are rendering with Scene3D or not. Change-Id: I495779571256d132fa7e1b3b31114f737de35a71 Task-number: QTBUG-60613 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Implement property updates for QStencilTest and QStencilOperationWieland Hagen2017-08-036-30/+128
| | | | | | | | | | | | | | | | Make sure to catch all changed signals from the arguments classes and re-send the arguments to the backend. Change-Id: I0a5e2f42fce4c5ff81489d8a66ad277aa607db0c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Fix QAlphaMask and QStencilMask render states property updatingWieland Hagen2017-08-033-1/+10
| | | | | | | | | | Change-Id: Ie11ce88441a6d287d50d1cb78365a65b2742a502 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Add QRenderState unit testWieland Hagen2017-08-031-1/+1
| | | | | | | | | | | | | | Backend nodes should receive frontend proeperty changes Change-Id: I19ba70d08de833aab467a51d5b21553f0b602ec6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Doc: fix minor link issueNico Vertriest2017-08-031-1/+1
| | | | | | | | | | | | | | qlevelofdetail.cpp:270: warning: Can't link to Qt3dRender::QLevelOfDetailBoundingSphere Change-Id: I29b023f5a2c60a62dd7bdacf63182649dd947059 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Doc: correct link to TextureNico Vertriest2017-08-021-2/+2
| | | | | | | | | | | | | | qparameter.cpp:47: warning: Can't link to Texture Change-Id: I32bd287393d0704246d28768f949f84e161ca7fb Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
| * Fix RenderCommand sortingPaul Lemire2017-08-024-32/+179
| | | | | | | | | | | | | | | | | | | | | | | | - 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>
| * Fix RenderState property updatesWieland Hagen2017-07-221-11/+12
| | | | | | | | | | | | | | Some had old property names Change-Id: Id82fcce9dac05d2566bafabebf66ff51300db16d Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * Use QSharedPointer::create() moreMarc Mutz2017-07-223-8/+8
| | | | | | | | | | | | | | | | | | | | 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>
| * RenderCapture: read back from the correct framebufferPaul Lemire2017-07-1714-28/+102
| | | | | | | | | | | | | | | | | | | | | | 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>
| * Improve supported file format documentation in QMeshTasuku Suzuki2017-07-131-4/+24
| | | | | | | | | | Change-Id: I2078bec7dccea9f2c41978da310376df4ed84cff Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Renderer: launch proximity filter jobPaul Lemire2017-08-194-4/+42
| | | | | | | | | | | | | | Also added a manual test example Change-Id: Ib560dcfdd5e0996cb40d892886c94212e3f8e32d Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Entity: use macros to reduce code duplicationPaul Lemire2017-08-182-357/+95
| | | | | | | | | | | | | | | | | | | | These macros make it easiers to define the template specializations for componentHandle, renderComponent and componentUuid Functions are privately exported as this is required for Scene2D. Change-Id: I14a90ad5db1a506f1c5d3d02fa671e940f6290a0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | FilterProximityDistanceJob addedPaul Lemire2017-08-184-3/+218
| | | | | | | | | | | | | | | | | | | | Filters entity based on distance between an entity and another target entity. Properly unit tested Change-Id: I776c634dee2d4fd94c40cb5720cc5588daa1b741 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Add ProximityFilter backend nodePaul Lemire2017-08-185-3/+181
| | | | | | | | | | Change-Id: I2e3fa11cae9113106e4a8c77832e3a2a3c27a24a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Add QProximityFilter FrameGraphNodePaul Lemire2017-08-184-2/+367
| | | | | | | | | | | | | | Allows to filter entities based on their distance to another entity Change-Id: Id2486edc5ec49722308c4b94a87e61241e5bd932 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Remove unused code using past internal APIPaul Lemire2017-08-183-56/+0
| | | | | | | | | | Change-Id: I272642205ad01ae0b838c7ca5cda5bd4b33a57a8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Fix and improve layer filteringPaul Lemire2017-08-1810-143/+248
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now handle the case where multiple LayerFilter nodes are nested within the same FrameGraphBranch. We also have improved the Accept/Discard into Accept Any/All and Discard Any/All which should now handle all filtering cases. We now build a list of layerIds stored into Entity based on the recursive flags on the layers being set. This allows to make layer filtering simpler but the layerIds list building step will need to be improved as a follow up commit Unit tests updated Change-Id: I93451493e41c6c9486defa7e88eaee073a9bc932 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Create QJoints using factorySean Harmer2017-08-161-1/+3
| | | | | | | | | | | | | | | | That way we get the QML object including the extension object if using QML. This then allows us to access the child joints. Change-Id: I5c95da830625399f75ee7dfcab0f68263aa3b865 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Update local poses of JointInfos from dirty JointsSean Harmer2017-08-167-5/+53
| | | | | | | | | | | | | | | | | | | | | | These will then get picked up when calculating the skinning matrix palettes for the armatures. In the future, this job is a good candidate for being decomposed into multiple jobs for data parallelism e.g. one job per skeleton. Change-Id: Ie1e7ddb3baec80f639bf8824482f730967a43afe Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Trigger a skeleton re-load when an inverse bind matrix changesSean Harmer2017-08-163-7/+21
| | | | | | | | | | | | | | | | This is a rare operation so should not be a problem to do a full skeleton rebuild when it happens. Change-Id: I00c3293dfff91d99bda762051714cb9eaae2c40f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Set the SkeletonManager on Skeleton with a custom node factorySean Harmer2017-08-163-2/+42
| | | | | | | | | | | | | | Aligns it with Joint for consistency. Change-Id: Ie14dc65e8c00782bbb3e4b4a2270970b095a3586 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Change SkeletonManager to accept HSkeleton directlySean Harmer2017-08-163-7/+6
| | | | | | | | | | | | | | | | Avoids repeating the same lookup from QNodeId each time we mark a skeleton as dirty. Change-Id: I8a1365949532f6707c001b6f605efdedfb322f31 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Create SkeletonData from Joint backend nodesSean Harmer2017-08-165-5/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This can be done either by using a QSkeleton on the frontend or with a QSkeletonLoader that has the createJointsEnabled property set to true. In the latter case, the loader creates the joint node hierarchy on the backend then moves them to the main thread in a similar way to QGeometryRenderer handles Geoemtry. Once the joint hierarchy is set on the frontend QSkeletonLoader, it notifies the backend and from there it follows the same code path as for QSkeleton. Change-Id: I5f673e154bb3a3e677b80b8ee984f4168403c288 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Add backend node for QJointSean Harmer2017-08-1610-2/+315
| | | | | | | | | | Change-Id: Ie06f41aefebf9c5c5d8dd8bcd68f9f352799ad18 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Update skinned mesh example to expose joints of objectSean Harmer2017-08-166-17/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | To do this we add a helper Sqt struct that wraps up an affine transformation as a scale vector, rotation quaternion and a translation vector. This is the format in which the animation aspect will animate the joints later so it's easier to keep the transforms split like this. It's also less data to move around compared with a 4x4 matrix (10 vs 16 floats, 12 including the padding). Change-Id: Iaa30b5ef5d1635cc208ead918827140cf2765908 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>