summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix stereoscopic render layer cachingHEADmasterAntti Määttä2023-09-014-51/+66
| | | | | | | | | | | | | | | | | | Layer caching for stereoscopic rendering doesn't work, because 1) the layer has only one texture for the left and right eyes and it renders both eyes with the same texture thereby overwriting the left eye. 2) the stereoscopic cameras are always dirty causing it to always render. This patch adds second layer texture allowing the caching of both eyes and also fixes the dirty camera problem by using the main camera to calculate the camera dirty flags and stores them for the right eye so that it also renders when left eye was dirty. Task-number: QT3DS-4239 Change-Id: Ice46bb4828418eca628abcbb7bb6d21aacf48028 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Revert "Fix stereoscopic rendering caching"Antti Määttä2023-08-151-4/+6
| | | | | | | | | | This reverts commit 8b6678e551e50b511b85457cc341b0ebf34d02d3. Reason for revert: Breaks the stereoscopic rendering. Change-Id: I4c455f8101d0c2407710bd5f972c99d9455e28bf Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix stereoscopic rendering cachingAntti Määttä2023-06-021-6/+4
| | | | | | | | | | | The left/right camera are always dirty so they mess the view caching. Use the main camera instead for the caching variables, which is dirty only when changed. Task-number: QT3DS-4239 Change-Id: I08ac95ed61a2ca8e13e307a036eec8921d491919 Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Add support for controlling the stereoscopic eye convergenceKaj Grönholm2023-06-0117-21/+180
| | | | | | | | | | Add API for controlling rotation of left & right eye cameras. By adding some rotation, the eyes convergence distance can be adjusted to other than the default infinity. Add support for this into viewer application. Task-number: QT3DS-4238 Change-Id: I3a54893cd6295615016b3d00347c51eca581015b Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix UB on iterate and eraseRobert Griebl2023-05-151-9/+9
| | | | | | | | | The old code at least doesn't crash on Qt 5, but it's UB. The same code will crash on Qt 6 though. Change-Id: I53f7c683b4d3044921a0a34723b503885f454699 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Fix memory leak in Qt3DSRendererImplLayerRenderHelperAntti Määttä2022-08-293-46/+41
| | | | | | | | | | | | | | | | | | | | Two camera nodes are allocated but never freed. Every frame. This leads to a massive memory consumption. We are changing the memory model for these two nodes from dynamic memory allocation to automatic memory allocation. However, this only works when we keep the SLayerRenderHelper object longer alive. Otherwise we are holding addresses to temp object longer alive than allowed. That why the temporary creation of "thePrepResult" and then copy to the member "m_LayerPrepResult" will be avoided with this patch. Which saves us additional code executions. Change-Id: I564516e20616c2bbb979619cd71f26145e962db7 Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Increase glyph cache cap to 4 texturesEskil Abrahamsen Blomfeldt2022-06-161-1/+1
| | | | | | | | | Since the glyph cache in Qt 3D Studio does not implement glyph recycling, we need a little bit extra room to make sure we can accommodate large character sets. Change-Id: I80a98acc987ed1fc1b657fe199250454bc7f261d Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Fix crash when expanding glyph cache beyond one textureEskil Abrahamsen Blomfeldt2022-06-163-24/+34
| | | | | | | | | | | | | | | | | | | | | | | | | The textureInfo() function was returning pointers to the m_textures array, which would then be stored in the m_glyphTextures map and other places in the renderer. Then the function then later resized it, the renderer would be riddled with dangling pointers and crash pretty quickly. There is a preset maximum texture count, so we just make sure the array is the correct size to begin with and never resize it. In addition, this contains a port of 46d72a117df642135718b38995346267312c4808 and 9a53834f1e7fce2fc3b1ecc2a311faedbc371d37 from Qt Quick. Note: Glyph recycling does not seem to work, so you may end up running out of cache space. However, it will no longer crash, but glyphs will be missing instead. Fixes: QT3DS-4235 Change-Id: I7d9707ff95ac0838e7e6574714a06ac1c23986fa Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Take negative leading into accountTomi Korpipaa2021-10-081-0/+7
| | | | | | Fixes: QT3DS-4231 Change-Id: Icd2d811c8926e09ce0a33861f7e7282514d8c5f8 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Update SHATomi Korpipaa2021-10-081-1/+1
| | | | | Change-Id: Ia8b529be2cc74981593662336fd9be98374f69c6 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Disable force update for qmlstreamsAntti Määttä2021-04-281-0/+1
| | | | | | | | | | | | | This was added originally to fix a problem with the rendering. Normally RenderControl informs us to render the qml when the content changes, but this was somehow broken in earlier qt versions and animated qml content was not rendered correctly if we didn't force the rendering. This seems to be fixed now and we can disable forced rendering. Task-number: QT3DS-4228 Change-Id: I3da2b369fcb0ce25e755b2c0842771c7345ad856 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Check subprentation texture changeAntti Määttä2021-04-271-1/+2
| | | | | | | | | | | Do not replace subresentation texture every tume and subsequently mark subpresentation as dirty each time. Add check if the texture has changed and replace it only when it has. Task-number: QT3DS-4228 Change-Id: Ie7bfe1ddaf6ab9d147585d4ccd266a4512ed8323 Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix activation for datainput controlled componentsAntti Määttä2021-04-081-6/+6
| | | | | | | | | | | | | | | | | Remove the check for parent activation from the GotoSlideIndex activation check. The component activation check can only be passed if the component is actually active since that activates all it's children. Any parent being activated doesn't mean that the component should be activated. Add proper fix for QT3DS-4214 by checking if the component is datainput controlled active. The AboutToDeactivate checks if the component is dirty(implies activity change) and not explicitly active and returns true for data input controlled components even if it is active by data inputs. Task-number: QT3DS-4227 Change-Id: I9fcd4f947ba137d7c0e856da15a3d8480ed07c0e Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Revert "Fix component visibility when changing slides"Antti Määttä2021-04-062-25/+6
| | | | | | | | | Introduces regression for QT3DS-4214 This reverts commit 9c62fa3b6190991e7594da9a4d8b39e3ff8b5c2f. Change-Id: I7ce2be5369720d20b75ddd1d311dc29ab536112c Reviewed-by: Tony Leinonen <tony.leinonen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Set components always dirtyAntti Määttä2021-04-061-0/+2
| | | | | | | | | Task-number: QT3DS-4225 Task-number: QT3DS-4226 Change-Id: I2fc0d1dc606bbaed85264e678a7320208409c6bf Reviewed-by: Tony Leinonen <tony.leinonen@qt.io> Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Add frameDraw signal to QML APITony Leinonen2021-03-315-7/+236
| | | | | | | | | frameDraw was initially only added to C++ API. This patch adds frameDraw to the QML API with updated qmltypes file. Task-number: QT3DS-4224 Change-Id: I215368943e124d0fee1b80806ede841f9bc769ed Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix crashing with missing OpenGL contextJanne Koskinen2021-03-301-0/+4
| | | | | | | | | Safeguard. Loading sub-presentation with delayed loading causes resources to be loaded from job threads with no OpenGL context. Fixes: QT3DS-4213 Change-Id: I1b62741905284e2aacca63f832f3fa68bd784f8d Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Add documentation for frameDraw signalTony Leinonen2021-03-302-2/+11
| | | | | | | | The frameDraw was recently added and needed further documentation. Task-number: QT3DS-4220 Change-Id: Ic2bcfb112fdd91455e8c30437bfd652f1215d803 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix component visibility when changing slidesTony Leinonen2021-03-302-6/+25
| | | | | | | | | | | | GetActive did not get updated fast enough and returns wrong active state changing it to IsExplicitActive fixes this situation as slide switches change objects ExplicitActive state and can be accessed instantly. Task-number: QT3DS-4225 Change-Id: I2945ea74f1921c6599230ab6acbc5b17065a5405 Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix time calculation with data inputsAntti Määttä2021-03-246-13/+19
| | | | | | | | | | The time needs to be calculated after the time policy has been initialized. Task-number: QT3DS-4218 Change-Id: I62c215cbbf8ca6c8ed8881817e9e9a84415b8924 Reviewed-by: Tony Leinonen <tony.leinonen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Do not clear depth texturesAntti Määttä2021-03-241-2/+2
| | | | | | Task-number: QT3DS-4222 Change-Id: I0e871c4726227dd2830300fd0a79baf07990d85b Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix component activation after slide changeAntti Määttä2021-03-232-4/+3
| | | | | | | | | | | Fix component activation after slide change when the component parent was activated by data input. Data input activated nodes needs similar handling as user activated. Remove previous change since it did not affect the situation. Task-number: QT3DS-4217 Change-Id: I5ff5f5cc2d693987ef61bb0a8f9cec22ec8507f8 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix autotests after latest changesAntti Määttä2021-03-228-21/+41
| | | | | | Task-number: QT3DS-4221 Change-Id: I43947446a9ea28e55a834541a44dc6ca971d282a Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Remove overriding codeTony Leinonen2021-03-192-9/+1
| | | | | | | | | | | | | ComponentManager code was overriding gotoSlide data which caused problems with slide changes. If check was forcing queued slide changes to slide 1 when object was first activated. Task-number: QT3DS-4221 Change-Id: I614fd5e50dc96db0930de860a90a5f99656293f3 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Calculate newTime when commands are being processedTony Leinonen2021-03-192-10/+12
| | | | | | | | | | | newTime was calculated too early and the object did not have time to switch slides and have correct information. Calculating newTime at a later stage when the object has had time to switch slides. Task-number: QT3DS-4221 Change-Id: If04a29278c6d97e550ecb7f2e5975d02abcd01d4 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Apply queued changed when object is activeTony Leinonen2021-03-191-1/+3
| | | | | | | | | | | | Queued changes were only applied when the object was first activated. Moving the function call outside if applies changes when the item is active. Task-number: QT3DS-4221 Change-Id: I9bf7a5f262e08a3e2e290106f1dfcfd791064d8a Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Do not crash if signalproxy is nullTomi Korpipaa2021-03-181-1/+2
| | | | | | | | | Editor does not need to use this signal, so signalProxy can be null there. Task-number: QT3DS-4223 Change-Id: I236d49ba0d191bb68f7c0c834c143ffa0de401ca Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Add component to dirty list when switching slidesTony Leinonen2021-03-021-0/+4
| | | | | | | | | Components are not being updated after slide switch. Adding them to the dirty list for slide change fixes this. Task-number: QT3DS-4217 Change-Id: I9f6f2d9c23548156edbc790d14e99e0e43e5d8ad Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix building autotestsTomi Korpipaa2021-03-022-2/+2
| | | | | | | Change-Id: Id2482b212b20e47ab35dbf33accd1168655a319d Reviewed-by: Tony Leinonen <tony.leinonen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Render last animation frameTony Leinonen2021-02-251-1/+4
| | | | | | | | | | If timer reached the end of the animation the last frame wouldnt get rendered. Adding a last frame timer variable will render the last frame for the first time. Task-number: QT3DS-4219 Change-Id: I882aca4faa8e37d63bb8fcbbb214beb958c4e2d8 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* add signal when renderer is drawingTony Leinonen2021-02-1815-13/+47
| | | | | | | | | | | renderUpdate signal is emitted even if nothing is drawn, so add a new signal when renderer is actually drawing something to screen. Task-number: QT3DS-4211 Change-Id: I52d79c618850cc0f87fd9f4226187ed224d0b758 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Fix if structureTony Leinonen2021-02-181-7/+5
| | | | | | | | | | Last structure did not work exactly as intented. Task-number: QT3DS-4214 Change-Id: I5b691b5385c81eff7b6134268918b3c7b84a29da Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Add product_dependencies.yamlAntti Kokko2021-02-181-0/+3
| | | | | | | | Use this file to define and track what content ogl-runtime is built against. Change-Id: Ica86033b7c7780ff2b687f2d2fa5eebfd48f6a08 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Add case for datainput between slide changesTony Leinonen2021-01-262-8/+15
| | | | | | | | | | When a slide and objects properties are changed in the same frame the property changes are not getting applied. Task-number: QT3DS-4214 Change-Id: Iaa0a71939b1f2f8506642208735edcd02807f09b Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Fix scene change blackscreenTony Leinonen2021-01-151-0/+1
| | | | | | | | | When scene was changed there is a blackscreen between the scenes. setAlphaTest removes this. Task-number: QT3DS-4209 Change-Id: Id864018d6310fa8fcdc31828f7e1f91fccb87d0e Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Fix uninitialized texture bugTomi Korpipaa2021-01-151-20/+42
| | | | | | Task-number: QT3DS-4212 Change-Id: Ie14a0ac99c9395a7fe6bf8566b76aec697fda0dc Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Convert <br> to line break on runtimeTomi Korpipaa2020-11-192-0/+8
| | | | | | | Task-number: QT3DS-4202 Change-Id: Ia3ddaaec3938155216119917640244f96115452d Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix getting wrong text textureTomi Korpipaa2020-11-186-56/+34
| | | | | | | | | | eastl::hash occasionally returns the same hash for different numerical strings for some reason. Replace eastl::hash with qHashBits for CRegisteredString. Task-number: QT3DS-4203 Change-Id: Ied943d7489233792b84fb0f612e6019f11532909 Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Propagate custom material dirty flag correctlyAntti Määttä2020-11-161-1/+1
| | | | | | | | | The subpresentations are not updated correctly since the dirty flag is not set properly. Task-number: QT3DS-4204 Change-Id: I6c0d3cd256eebe10782b9608bcb1c795c8359305 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix crash when showing a certain presentation in viewerv2.8.0_5151v2.8.0Antti Määttä2020-10-221-0/+4
| | | | | | | | | | | | The presentation needs to have references to non-existing dynamic objects. This can happen when the effect or custom material have been removed outside the project and the project gets saved with lastest studio. Task-number: QT3DS-4195 Change-Id: Icc9f848d5c2280ac0da193b4e4750093ef019361 Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Tony Leinonen <tony.leinonen@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Remove shader cache export restrictionAntti Määttä2020-10-211-13/+20
| | | | | | Task-number: QT3DS-4145 Change-Id: I5710595aeb6c738af4c8e2d5182be8f1974dccbe Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Fix black screen in the editorAntti Määttä2020-10-214-24/+45
| | | | | | | | | Clear and destroy resource manager resources between switching projects. Task-number: QT3DS-4190 Change-Id: Id650481ab41038d4b274809f1ea87bf3e2271e49 Reviewed-by: Tony Leinonen <tony.leinonen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Allow changing some attributes when element is inactiveAntti Määttä2020-10-201-1/+12
| | | | | | | Task-number: QT3DS-4192 Change-Id: I83f4f651ecf9858595d45f6b070da1ff849ae08e Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix wrong lib paths in android buildv2.8.0-rc2Antti Määttä2020-10-167-0/+47
| | | | | | Task-number: QT3DS-3982 Change-Id: Ifc01400a6756e3ee66765a5b37fa9d805f58f99c Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Improve runtime build options documentationKaj Grönholm2020-10-163-4/+27
| | | | | | | Task-number: QT3DS-4185 Change-Id: Id23f07dc07547c37643081a5116b84be3ccd0d4b Reviewed-by: Tony Leinonen <tony.leinonen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix ghost images in presentationsAntti Määttä2020-10-162-2/+2
| | | | | | | | | Set default minification filter to not use mipmaps. Task-number: QT3DS-4188 Change-Id: I2263c8b17879e4ff1a69097ae0b04c3309003a67 Reviewed-by: Tony Leinonen <tony.leinonen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix rendering problems with ordered group and alphatest objectsAntti Määttä2020-10-162-80/+82
| | | | | | | | | | | | | | | | Change the logic of the ordered group rendering. Previously all objects in ordered group were drawn in one go as opaque objects and alpha-test objects were all rendered in transparent pass. - Change the logic so that ordered property only affects transparent objects when depth test is on and all if it is off. - Allow adding alpha-test objects to both opaque and transparent object lists and only draw the respective parts in the each pass. - Change transparent object rendering into one pass. Task-number: QT3DS-4155 Change-Id: I53fd6acfc0a887e01996306b5eef0c14c97e18ad Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Revert "Fix blending issues in ordered group"Antti Määttä2020-10-161-9/+3
| | | | | | | | | | The commit was basically no-op, except when rendering depth pass, which incorrectly draws the depth. This reverts commit 7cb740b7dc1e7a660eaaab41cff2e4d76a9fd99f. Change-Id: If6a5dd8ca0448569f177a81229710775bfb7985a Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix images having subpresentations and mipmapsAntti Määttä2020-10-161-4/+7
| | | | | | | | | Generate mipmaps each frame when they are used by images with subpresentations. Change-Id: Ic516d4e825ee81882601c4124381a5b3940d151d Reviewed-by: Tony Leinonen <tony.leinonen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix assert when loading qml streamerAntti Määttä2020-10-161-10/+13
| | | | | | | | Fix assert and memory leak when registering qml streamer if it has already been registered. Change-Id: I6af73abb2c9806622dfde4a75a67a08b3391b2a5 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>