summaryrefslogtreecommitdiffstats
path: root/src/render/backend
Commit message (Collapse)AuthorAgeFilesLines
* Unify license header usageAntti Kokko2016-01-2654-600/+762
| | | | | | | Update old header.LGPL3 to header.LGPL Change-Id: I8eac0cd6bbc276a56df487249cc459c0d4fab165 Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Refactor picking to use one thread per entityMike Krus2016-01-255-441/+630
| | | | | | | | | | | | | | Added triangle visitor by refactor the triangle volume extractor Added ability to do a ray intersection with a single volume without using a thread Added entity collector Use one thread for each entity Ignore entities that don’t have a pick object Removed list of triangle volumes stored on each entity Use triangle visitor to test each triangle by creating a single volume on the stack Added triangle and 3 vertex index to the pick event Change-Id: Id3fd53549bf3ea07805426ef868df174f30e176b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QAspectEngine/QAbstractAspects: get rid of setDataPaul Lemire2016-01-225-165/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | Getting rid of set data and the refactoring on setting the surface implies that: - Given the FrameGraph configuration, there may be several RenderViews each having a different RenderSurfaceSelector/Window - This means that the Renderer/QRenderAspect can't know about the surface before reading the scene - This means that the Renderer may be dealing with more than 1 window - This means that initialization, render and shutdown procedures will have to be updated accordingly Therefore the Renderer was refactored to: - Be initialized without knowing about a surface - For each RenderView, check the surface and if different from the previous one: * Make the context current with it * Create the appropriate glHelpers (as Surfaces may have != formats) TO DO: - Fix picking - Fix windows exposition - Fix shutdown / detection of all windows beging closed Change-Id: I49d070b05f46be4b26cfb57e494feba145d1da9c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Renderer/Scene3D: fixes to make it work without setDataPaul Lemire2016-01-221-14/+19
| | | | | Change-Id: Iec1d3bab2e3a5a25d1cbb5129addebd83b225580 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Updated picking-qml examplePaul Lemire2016-01-215-2/+31
| | | | | | | handle device pixel ratio and none full-window Scene3D Change-Id: Iadc504a00816d9363847bf9ec1e09d4b7c631666 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Port FrameGraphManager away from QResourceManagerTobias Koenig2016-01-204-9/+86
| | | | | Change-Id: I7399008adb0f612c78738f58f168fa38cf6ae845 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Protect against a null surface in the renderview processing logicSean Harmer2016-01-191-0/+8
| | | | | Change-Id: I31eab49aff2af5b9d2341709c506f9d5525994ac Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Make renderer us QSurface from RenderViewSean Harmer2016-01-171-16/+32
| | | | | Change-Id: I58180aea694de7a0c17e8ca9ba9f83755e3db419 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Increase frame allocator max object size a littleSean Harmer2016-01-171-1/+1
| | | | | | | | Adding the surface pointer to the RenderView pushed us over the old limit. Change-Id: Ibc28ffc2d56e6f768294dad971c00822e6aaffb6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Store the surface to use in the RenderViewSean Harmer2016-01-172-0/+5
| | | | | Change-Id: I4dbdfe9315dc3b0bb89119372301d24a292520d9 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Register renderer settings and set on rendererSean Harmer2016-01-175-0/+80
| | | | | Change-Id: I7f4a0c7a51721e8425f9e32aa1a0609fc3e5ee14 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add backend for renderer settingsSean Harmer2016-01-173-2/+162
| | | | | Change-Id: I7e87cb106681c384a1b431a362fa904afafb877a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add "We mean it" warningSean Harmer2016-01-171-0/+11
| | | | | Change-Id: Id52b55412be4e5e27476e05d1d66d226fcf5601e Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Move QCamera/QCameraLens to Qt3DRenderPaul Lemire2016-01-163-3/+3
| | | | | | | | Also get rid of Qt3DRender::QWindow and of the hard codes camera controller. Change-Id: I307735d01caf97b7a690b28de8dc99fc9866c35f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fixed RenderView Uniform setting for QNode valuesWieland Hagen2016-01-141-2/+2
| | | | | Change-Id: I3aac90e19019345892e08a2994ee04667a7058dc Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Renderer: handle compute and draw render commandsPaul Lemire2016-01-134-138/+161
| | | | | Change-Id: I629dff26ce02fad1deaea8557d09a52e6d672ad7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* RenderCommand: add a type flag (Draw/Compute)Paul Lemire2016-01-132-0/+8
| | | | | Change-Id: I5c194c73bd2e4db8895557bf5f69682420841b19 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* RenderView/GraphicsContext: support SSBO/UBO with buffer used as ParametersPaul Lemire2016-01-136-49/+117
| | | | | Change-Id: I347aa5deea6521b43b9033e2200ab2f8b272f671 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Rename QUniformPack to ShaderParameterPackPaul Lemire2016-01-136-16/+16
| | | | | | | | This will make it more clear that it also contains other things like UBO/SSBO which are pure Uniform values. Change-Id: I641246798b8c868d7bfdfde381221d9a97ed2d35 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* GraphicsContext: use GLBuffer instead of QOpenGLBufferPaul Lemire2016-01-132-35/+38
| | | | | | | | This will be needed to simplify the process of binding SSBO/UBO buffers. Change-Id: Ice3bb97381328c5bddf1c9e46af30b4814ff2572 Note: ShaderData UBO handling temporarly disabled. Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add handle type for GLBufferPaul Lemire2016-01-131-0/+2
| | | | | Change-Id: I000b8c22a566639a622563a56edef87c1256c9c8 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* RenderView: completed Compute code pathPaul Lemire2016-01-131-10/+26
| | | | | Change-Id: I7fb4569bfcb7b9a0427dbaa67edcf7e005bb5762 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Entity: add reference to QComputeJob componentPaul Lemire2016-01-132-0/+31
| | | | | Change-Id: I1a99115b78478ec143a83a2f768a7249d9038ac0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* RenderView: sliglty modified to later accommodate compute callsPaul Lemire2016-01-135-111/+147
| | | | | Change-Id: Ic821747677c9d2f117494d2ecfd89f47f982fa3f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QParameter: only copy QNodeId when parameter value is a QNodeSubclassPaul Lemire2016-01-131-9/+20
| | | | | | | | | | | | | This avoid doing useless clones and will be further improved to support UBO/SSBO when Buffer are used as a Parameter's value. QNode subclasses that can be used as the value of an attribute are: QAbstractTextureProvider -> default uniform block QShaderData -> UBO (could be made to work with SSBO as well) Buffer -> UBO / SSBO Change-Id: I4928b95107656afc64db1ef989dde5dde8a92df8 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* ComputeJobManager addedPaul Lemire2016-01-134-0/+29
| | | | | Change-Id: Ia3d1c209ea06ce6a6fd3aa87f4034d3eeaeffdda Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* ComputeJob: backend for QComputeJobPaul Lemire2016-01-133-2/+157
| | | | | Change-Id: I13fb35d0e6d31275463034c3e4bdd92c3f528a4e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* RenderView Compute handlingPaul Lemire2016-01-132-15/+26
| | | | | Change-Id: Ifbe93173010bf058f198990c62d5e93fea967a74 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rename UniformBuffer to GLBufferPaul Lemire2016-01-134-13/+13
| | | | | | | | This class could be reused for any kind of GLBuffer (not just uniform buffer) so rename it accordingly. Change-Id: I978696534f64fc3717ac135af94e9fe44aa23fba Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Shaders: retrieve SSBO blockPaul Lemire2016-01-132-2/+18
| | | | | Change-Id: I62065d30b197367c8e5e03099c3af034892c4038 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Avoid unnecessary detaching.Volker Krause2016-01-071-3/+3
| | | | | Change-Id: Ied910d38c400b34a38f6eaea9683107b079513ec Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix RenderViewJob crash on Renderer shutdownMauro Persano2016-01-071-0/+2
| | | | | | | | | | | | Set Renderer::m_running to zero to prevent crashes when Renderer::shutdown is called while a RenderViewJob is running. This only affects QtQuick/Scene3D. It's not a problem in the case of pure Qt3D, as Renderer::m_running is set to zero when Renderer::setSurface(0) is called before Renderer::shutdown. Change-Id: I41f8da7589c098c6df9d24792932a293df7982aa Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add a few more QVector::reserve calls.Volker Krause2016-01-072-0/+3
| | | | | | | Found by heaptrack, all relevant for per-frame allocations. Change-Id: I12ef71f6bd1bca2ca78f4bfbd295265d840b4232 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Avoid expensive multiple QString::arg usage on this hot path.Volker Krause2016-01-061-4/+3
| | | | | | | | | The string operations in here are still one of the largest contributors to per-frame allocations, but at least this spot is now down to three allocations per frame and per light. Change-Id: Ieab3b882c87e8fa8d4d4dedb46a3a482ebb07d6f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Use QList::reserve.Volker Krause2016-01-061-0/+6
| | | | | | | | The intermediate QLists are still not optimal here, as these methods are called per frame, but at least this is now down to one allocation each. Change-Id: I7705172aabc5e526c5123d70450d3ae2dec20d03 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Make parentEntityId privateKevin Ottens2015-12-181-1/+3
| | | | | | | | It is used only once in the whole of Qt3D and looks rather foreign to the rest of the nodes API. Change-Id: I6d8d40590a1f8a5c2019a8d16a7abff4f19ae9bb Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* The Renderer depends only on the QServiceLocatorKevin Ottens2015-12-183-7/+7
| | | | | | | | | This way the only thing Renderer knows about QRenderAspect is the enum controlling the render more (threaded or synchronous). We properly decoupled both now. Change-Id: I0023efec541d40f7b499da4355d5cd8b796d2194 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Move the time property to the rendererKevin Ottens2015-12-184-1/+20
| | | | | Change-Id: I60adff0ece408bb4ee21b9cbd329e21da2c1f95c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Pass the QBackendNodeFactory to setSceneRootKevin Ottens2015-12-183-6/+4
| | | | | | | This helps to reduce the dependencies from the Renderer to the QRenderAspect. Change-Id: Id54e38642061f787649ba3794cafb8b8bbbde3f1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Destroy allocators in aspect not the rendererKevin Ottens2015-12-183-3/+2
| | | | | | | | | Otherwise it was creating a weird confusion of responsibility. The aspect asked for the creation of the allocators while the renderer itself was asking for their destruction. Change-Id: Ib06a315b39dc654d5a9bb97d4d2153884c457443 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Make QBackendNodeFactory privateKevin Ottens2015-12-171-8/+9
| | | | | Change-Id: I0edb9fb0444d8a4a9b77550d5dd32d36d501683c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Move services() and jobManager() to the pimplKevin Ottens2015-12-171-1/+2
| | | | | | | This way we avoid leaking private types through public API. Change-Id: Ifb30d7e57d8b995bba8cf9a95ae77f8d7818d79a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Change the idiom to clear null job dependenciesKevin Ottens2015-12-161-1/+1
| | | | | | | | | | The "clearNull" method is kind of surprising so make QAspectJob API more usual. Also the "clearNull" method was only used twice so change the idiom to go through removeDependency if that one receives a null pointer. Change-Id: Ib74e1054ba52754b1a19d6c3e9268fa9ff14edaf Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Turn all services private for nowKevin Ottens2015-12-121-1/+1
| | | | | Change-Id: I9da605c77c5489b9bef4f07079e05f8babb9559f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rename Q3D*Event to Q*Event and handle namespaceMike Krus2015-12-102-2/+0
| | | | | | | | Q3DMouseEvent, Q3DWheelEvent, Q3DKeyEvent Also removed unused variables and fixed some formatting Change-Id: Ie4c531f2084875fe4d8b6ac9bafd2b3c085dead4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Move all raycasting code as private in Qt3DRenderKevin Ottens2015-12-104-58/+56
| | | | | Change-Id: I871cbc57166493f30ea307305d8664e2f8a8873f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Reduce specular reflectivity defaultsLaszlo Agocs2015-12-102-3/+3
| | | | | | | | 0.95 -> 0.01 to prevent eye-poppingly white specular highlights. Change-Id: I3e765bad13afe991053932e73cea13b95c950c1c Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* Do lighting calculation in world spaceLaszlo Agocs2015-12-101-4/+4
| | | | | | | | | | | | | | | | As opposed to (mostly) camera space. Oops. While somewhat hidden with point lights, the problem became apparent with directional lights. Now that we have proper directional lights, change the default light, that is used when no light components are specified at all, from point to directional since this is cheaper and provides less surprises with arbitrary scenes. Also remove the duplicate phongalpha vertex shader in the process. Change-Id: I295660a1400b16b69e1516672e31794312ee48d1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Make QFrameAllocator privateKevin Ottens2015-12-082-2/+2
| | | | | Change-Id: Id69a161da691322184d8ec5ed7a1b375cf2038ed Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Separate GLSL 1.00 and newer shader snippets for lightsLaszlo Agocs2015-12-071-1/+0
| | | | | | | | | | | | | | | | | | | | Many but not all OpenGL ES 2.0 implementations support dynamic indexing. For these the normal for loop is fine. For simple GLSL 1.00 compilers without dynamic indexing support (e.g. RPi) a separate, limited version is provided that supports a lower number of lights and uses copy-paste instead of the loop. Right now there is no sane way to choose which snippet to use as that requires the OpenGL context at minimum (and even then we could only rely on vendor/renderer checks). Therefore a QT3D_GLSL100_WORKAROUND environment variable is used for now. This is temporary until we figure out something more sophisticated. The default GL2/ES2 lighting shader is now equivalent to the GL3 version, supporting up to 8 lights. Change-Id: I0244c920a1f2c2516b130991996afca68207a7db Reviewed-by: Sean Harmer <sean.harmer@kdab.com>