summaryrefslogtreecommitdiffstats
path: root/src/render
Commit message (Collapse)AuthorAgeFilesLines
* Fix the way we compute light positionsPaul Lemire2019-10-291-1/+2
| | | | | | | | | | We were using worldBoundingVolume->center() but this has been changed recently and a null bounding volume now cannot be transformed. Instead just use the worldMatrix transform to compute the light position. Change-Id: I2d884a4a5a3808ff812eb581f6bb631bbe6ab4c1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add BufferCapture QML documentationMats Honkamaa2019-10-171-0/+8
| | | | | | | | Copied the very basic C++ docs. Task-number: QTBUG-79109 Change-Id: Ib5803dfc06d7d10001e31f9cb0c113509cc23f0f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add QML doc for texturesPaul Lemire2019-10-162-0/+185
| | | | | Change-Id: I649cf174ff59c64358d13c762eeb500521f712ce Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Add light_0/7 as uniformsJuan Jose Casafranca2019-10-161-0/+23
| | | | | | | | | Some ES2/3 drivers dont support structure arrays This patch uploads also light_0/7 uniforms in addition to light[0]/[7] so the shader can be unrolled for those devices that need it Change-Id: I9356e7624c1c0593e7803914f0ecf2d84de48681 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Renderer: check context thread before destroying resourcesPaul Lemire2019-10-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | Only try to cleanup the resources if we know we are called from the right thread. releaseGraphicsResources can be called from 2 places: - Scene3DCleaner when using Scene3D (when closing the window) - AspectThread when the RenderAspect gets unregistered In configurations where the context lives in the main thread (Scene3D + single threaded render loop / ANGLE), the RenderAspect gets unregistered before the Scene3DCleaner has had time to call releaseGraphicsResources. This means that we won't release the resources ourselved and that the driver will have to do that for us. This has been fixed properly in 5.14 with the AspectThread removal. Task-number: QTBUG-60971 Change-Id: I49c1c2f74ad09e7162b988f87bac65863f8490d8 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Doc: Use correct qml module names for qml typesPaul Wicking2019-10-142-1/+2
| | | | | Change-Id: I19c9f2a3d31af77366316e78194a15789d1b67f9 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Add note to material system nodes that can't be disabledAntti Määttä2019-10-104-0/+16
| | | | | | Task-number: QTBUG-67017 Change-Id: I20acb3aa5e778be7752e1568b08001838f094eb3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Make sure right screen is set on QOpenGLContext and QOffscreenSurfaceAndy Shaw2019-10-107-0/+26
| | | | | | | | | | When the Qt3D window is on a specific screen, then it needs to ensure that any supporting QOpenGLContexts and QOffscreenSurfaces are set to be using that same screen or it will fail to render the content. Change-Id: Ief4f3e88bf6f71862bc5dace0cb0bddcdf3a98b5 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix blitting to also blit depth and stencil buffersPaul Lemire2019-10-091-1/+2
| | | | | Change-Id: Ib7b491c638508cfcdfbd523fd4e6a3d757c2c832 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Prevent picking from losing eventsAntti Määttä2019-10-091-2/+2
| | | | | | | | | | | Use append instead of assingment in PickBoundingVolumeJobs setxxxEvents. The setters gets called more times than the job gets to run so appending will not overwrite the events we have not processed yet. Task-number: QTBUG-69397 Change-Id: I4823ac5f622f636ee18af64d729ef196f76bc886 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add comment about far plane value affecting pickingAntti Määttä2019-10-091-0/+6
| | | | | | | | Task-number: QTBUG-70589 Change-Id: I397d24f3d7fed25fe3612e481a3ee16d4e0fe1ab Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix rendering when closing and re-opening a windowTomi Korpipaa2019-10-091-4/+0
| | | | | | | | | | | | | Scene3D stops rendering if a window is closed and then opened again. That happens because eventfilter was removed at SurfaceAboutToBeDestroyed. There is no need to remove the event filter, as a destroyed window will not receive any events in any case. Task-number: QTBUG-77263 Change-Id: I1bcf3c572da6c06c09d1d9590bd8481b1fed6953 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix for bounding volume handling and calculationVolker Enderlein2019-10-013-34/+107
| | | | | | | | | | | | | | - Fixed Ritter algorithm implementation - Added notation of invalid bounding sphere (radius == -1.0) - Handle merging of invalid bounding sphere with valid ones - Added test cases and adjusted tests boundingsphere and proximityfilter - This is necessary to ensure the correct working for viewAll and viewEntity Task-number: QTBUG-78313 Change-Id: I1dc6d227cf9009f6fbd3230093c7a7a94fb05ae3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Doc: Fix documentation issues for Qt3DRender::QTexture* classesTopi Reinio2019-09-271-2/+24
| | | | | | Fixes: QTWEBSITE-878 Change-Id: I8a4ac1de75dfb8ec4ff784a01d3e4abbc031a7ba Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Fix potential memory leakMichael Brasser2019-09-171-1/+1
| | | | | Change-Id: I91a41154ad4acb0f1f7497a2616d219770640ca6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-315-14/+29
|\ | | | | | | Change-Id: Iae9a2903afd5da09cfd9288ff6cf74d7f069c83b
| * Allow multiple instances of a few render statesHarald Vistnes2019-08-265-14/+29
| | | | | | | | | | | | | | | | | | | | Allow more than one instance of BlendEquationArgumentsMask and ClipPlaneMask render states. Task-number: QTBUG-77735 Change-Id: I9d2bdc82843e2eaf0f8a781208e4ca10e3a777c7 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-242-3/+51
|\| | | | | | | Change-Id: I7d7274866129a3c8a3ed3788680a46368120d20d
| * Expand QCamera::exposure documentationMichael Brasser2019-08-201-0/+20
| | | | | | | | | | Change-Id: Ia844b046720b530fbb9b7bac096d1853710225c3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * Expand EnvironmentLight documentationMichael Brasser2019-08-201-3/+31
| | | | | | | | | | Change-Id: Ia6e6ca65469c7c04914fbb6a73f796ec86436577 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-133-1/+10
|\| | | | | | | Change-Id: I359b15d87622515ee4f05db1f01d4b476027378e
| * Improve documentation of ObjectPickerJean-Michaël Celerier2019-08-071-0/+2
| | | | | | | | | | | | | | Add a reference to Scene3D hoverEnabled Change-Id: I59e282a985ae5af30ff22d7caf433fb3b7cd821b Reviewed-by: Mike Krus <mike.krus@kdab.com>
| * GLTexture: glTexParam is not supported on multisampled texturesPaul Lemire2019-08-071-0/+7
| | | | | | | | | | | | | | So try to avoid performing these calls on such texture Change-Id: I051fd6a0150d07656687a1f84756d8a3d506ec24 Reviewed-by: Mike Krus <mike.krus@kdab.com>
| * submissioncontext fix: devicePixelRatio is not an integerPaul Lemire2019-08-071-1/+1
| | | | | | | | | | | | | | | | Converting it to int would cause the viewport not to take the whole expected size as the interger conversion would essentially floor the value. Change-Id: Ic608b0e1a0910aadb8b98c3225f999cba6326535 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-061-3/+16
|\| | | | | | | Change-Id: I8957f671305454e7b2db83f52a09a2fa4b6d3e67
| * Improve SortPolicy documentationMichael Brasser2019-08-051-3/+16
| | | | | | | | | | Change-Id: If7759ce872d26087d181eefe24504409aa779ea9 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-305-1/+64
|\| | | | | | | Change-Id: Id2885cdbb45f8aa701e218b6201f0a3732b7ef11
| * ShaderData: don't call markDirty(AllDirty)Paul Lemire2019-07-241-1/+1
| | | | | | | | | | | | | | | | But only markDirty(ParametersDirty) as that's the only thing this is affecting. Change-Id: I450d013dc266ca70ca51cfa866b731a6e8b6499a Reviewed-by: Mike Krus <mike.krus@kdab.com>
| * Provide more detail in *Light documentationMichael Brasser2019-07-234-0/+63
| | | | | | | | | | Change-Id: I8d56836f1f075c7239b262454131062c10058026 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-239-18/+54
|\| | | | | | | Change-Id: I2a66e9344b72524431885bdf5f59fcaedb94c718
| * Silence warnings about null textures in uniformsMike Krus2019-07-221-0/+6
| | | | | | | | | | | | | | It's common while textures are loading Change-Id: I360c88c72fbd0a034aff07451fd49be17b348d40 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * Renderer: use last known good surface to reset render statesPaul Lemire2019-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were instead checking against the last surface used (which could be null) instead of the last known good surface to reset the render states. This could result in not resetting the render states and keeping dangling pointers around. To know if we can render, we check find the first non null surface in the list of RV. In most cases we can safelly assume that if first RV has a surface, all following ones will likely use the same surface. If we have no good surface we skip the rendering. However in the case you have a FG where the first RV has a surface but not the last one (which wouldn't really make sense but can happen if you mess up), we could end up in the above case where surface is nullptr though we have partially rendered something for the RV which had valid surfaces. Change-Id: I902b8c7a943ad2ca7e2f487873f73990cf8db433 Reviewed-by: Mike Krus <mike.krus@kdab.com>
| * Align RenderView::buildComputeRenderCommands with buildDrawRenderCommandsPaul Lemire2019-07-191-3/+14
| | | | | | | | | | | | | | State and parameter handling are the same between the two branches Change-Id: Ic8394a969184daead33253c9303c20ecf1a97484 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * RenderStates: fix override of nested RenderStatesPaul Lemire2019-07-187-14/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When merging states, make sure we don't add several states of the same types with possibly different values. We should only add states with type we don't already have. Since the FG traversal is done from leaf to root, we know that the states we already contain should override any state that may have been specified higher up in the FG branch. Change-Id: I9bd1eadd37e8addf740a4b85b2318f9be269fedb Task-number: QTBUG-76766 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-166-20/+101
|\| | | | | | | Change-Id: I0f68ab1277617c32b1c31f29d8793d23d9909208
| * QRay3D: normalize the direction vector internallyPaul Lemire2019-07-151-4/+4
| | | | | | | | | | | | | | | | | | It can be created with a non normalized dir vector but we should always perform the computations with a normalized dir vector for correct results. Change-Id: Ie9108de7ed2092f6b979a70ad9391267fe6c4696 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Joints: remove removed joints from dirty listPaul Lemire2019-07-153-0/+8
| | | | | | | | | | | | | | | | | | In case a joint is added and destroyed within the same loop of the event loop, we need to remove it from the list of dirty joints to process as this otherwise results in an assert. Change-Id: If2f4ece6e2d69a7801ce9c4ec2cb732f48895ad1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Expand documentation for CameraMichael Brasser2019-07-121-15/+88
| | | | | | | | | | Change-Id: Id886decd4f2bd83a2319b4ad792a15b7280cb448 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * Doc: Fix typo in property namePaul Wicking2019-07-101-1/+1
| | | | | | | | | | | | | | | | | | colorbuffer -> colorBuffer Fixes: QTBUG-76342 Change-Id: Ic63ac9b333710ebab17aa7c4ccd9e864f10e6fcf Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-272-1/+48
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Iae5fa92dfdf8012315c043e20950368e42451e20
| * Doc: Extend Qt3D documentationPaul Wicking2019-06-072-1/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds missing C++ and/or QML documentation for: * enum QBuffer::AccessType * QBuffer::accessType() * QBuffer::dataAvailable() * ForwardRenderer::externalRenderTargetSize * enumeration Qt3D.Render.Light::type * Qt3D.Render.Light::color * Qt3D.Render.Light::intensity Fixes: QTBUG-73071 Change-Id: I48b13cb8001558b20bd801b6f96f5b5933144d82 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Add doc to undocumented functions qt3dNico Vertriest2019-05-275-13/+92
| | | | | | | | | | Change-Id: Ic5183b31ee0df54e7a99a48f71ac04fc648f92e2 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-151-3/+3
|\| | | | | | | Change-Id: I903f92a7b910eee165a2dd708a2d5fb25192ab14
| * Fix Parameter priority sortingPaul Lemire2019-05-241-3/+3
| | | | | | | | | | | | | | Parameters defined on an effect have priority over those defined in a Technique. Change-Id: I49558a065b613d7ea9d1cbf0a64f6d5aad941cd3 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-05-291-1/+1
|\| | | | | | | Change-Id: I9e9214906c5cda56d0bcc98678c77be69189699d
| * Clean up warningsMike Krus2019-05-282-1/+2
| | | | | | | | | | Change-Id: I1ddad305359586481021e85f6e4a470d3a6521b0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Merge branch '5.12' into 5.13Paul Lemire2019-05-281-1/+1
|\| | | | | | | Change-Id: I8be64f0e027454e062383a13f3140dbc6df83336
| * QClearBuffers: fix wrong clearColor qml property name in docPaul Lemire2019-05-241-1/+1
| | | | | | | | | | Change-Id: I22ee256f266cb3359d1666e831d37b804d80d55a Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Clean up bounding box updatesMike Krus2019-05-251-37/+41
| | | | | | | | | | | | | | | | | | Use EntityAccumulator to collect all entities and use a single map/reduce call. This avoid allocations due to getting entity children and locking due to using one map/reduce per entity previously. Change-Id: Iac8eb315bfb302bc68dbdfc961bbc48beb8cd19a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Introduce EntityAccumulatorMike Krus2019-05-253-0/+184
| | | | | | | | | | | | | | | | | | | | Used to traverse scene graph (using EntityVisitor) and collect list of entity matching a predicate. By default, collects all entities, but can also collect those that have a certain type of component, or use a custom predicate Change-Id: I9da877d629fe146c1307f5afead7502c440aca9f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>