summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Add property to Camera to enable frustum culling when neededAndy Nichols2019-08-2912-13/+27
| | | | | | | | | | By default frustum culling is disabled because for most scenes all items are always visible. There is a not insignificant cost to doing frustum culling, so it shouldn't be the default behavior. Change-Id: Ibc0c0a4bd1cf65a215256de9ec22ca1d97eb6de5 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Disable Depth Pre-pass by defaultAndy Nichols2019-08-291-1/+1
| | | | | | | | | | | This is an anti-optimization on tiled renderers and doesn't provide much performance benefit on even desktop hardware. This patch makes the depth pre-pass opt-in instead of opt-out. Change-Id: I73cdc0aac5e5c07977085eefd1fad7ba890d0fdb Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Remove some warnings from Qt3DSDMAnimation.hMahmoud Badri2019-08-282-7/+7
| | | | | Change-Id: Id3c6c202233283c6e05f78f59b9d75fff90344fc Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Unify timeline unit to millisecondMahmoud Badri2019-08-2621-277/+239
| | | | | | | | | | The studio and runtime had mixed timing units (seconds and milliseconds) . This commit unifies the timings to milliseconds. The values are however kept saved in the UIP file in seconds for backward compatibility and also cause it is more compact (ex: 1 vs 1000). Change-Id: Id3515ed90fdb8eb027c581aef9598b02b974a40e Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Add support for stereoscopic renderingKaj Grönholm2019-08-2316-8/+445
| | | | | | | | | | | Initial support for top-bottom and left-right stereoscopic rendering on OpenGL runtime. Add settings into viewer menu to control these. Task-number: QT3DS-3212 Task-number: QT3DS-3868 Change-Id: I5b22169fd407118998a43c1e601cb60b7e3fd6a8 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Support clearing image and buffer caches on demandMiikka Heikkinen2019-08-234-3/+21
| | | | | | | | | Needed to fix crash on reloading presentation in editor. Task-number: QT3DS-3894 Change-Id: I0fce49c91b18404e7d567a8d2101909a0fcc5148 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Add Float4 support to SetAttribute and GetAttributeJere Tuliniemi2019-08-211-7/+14
| | | | | Change-Id: I5b3ded94357e5bc2182b8c4555f3386d5c7e757f Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Fix component activation resetting user inputsJere Tuliniemi2019-08-217-69/+174
| | | | | | | | | | | | | | | | | | QT3DS-3778 is fixed by not rollbacking and executing the slide again when activated after deactivation. Thus, the component continues from the previous state. QT3DS-3767 is partly fixed by the same change, but attributes set prior to the first activation of the component are lost. This is fixed by storing the attribute changes and applying them after the first activation. Task-number: QT3DS-3778 Task-number: QT3DS-3767 Change-Id: I3917e66b56dd40a2804d6d74db38b2e21132187e Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* small fix in a method renamingMahmoud Badri2019-08-193-3/+3
| | | | | Change-Id: Ifc01d989ac5f362c22a1292110498e5801174463 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Fix issues with AO and multiple layersAntti Määttä2019-08-191-2/+1
| | | | | | | | | | | | The AO was implemented such that only one layer enabled AO parameters and all other used those. Moved the AO parameter update to render pass from prepare pass. Task-number: QT3DS-1888 Change-Id: I2d748351a9d762e66aeb0d483ceed0c203e94d36 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Janne Kangas <janne.kangas@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Add docs for Q3DSSurfaceViewer::setQmlEngine/qmlEngine methodsMiikka Heikkinen2019-08-191-6/+8
| | | | | | | Task-number: QT3DS-3563 Change-Id: Ia19a15b5ffe00e5de7aa8e96136d150b4fbb7b22 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Clear the QQuickWindow background before renderingMiikka Heikkinen2019-08-192-5/+0
| | | | | | | | | | | Now that we support transparent scene backgrounds, we should not set the QQuickWindow::setClearBeforeRendering(false). This will also allow using Studio3D elements that do not cover the entire window. Task-number: QT3DS-3740 Change-Id: I8293a5384405d46f721747934d8cc6beeea23e64 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix Easing animationMahmoud Badri2019-08-197-380/+193
| | | | | | | | | | | Changed the logic for easing animation evaluation. Also some cleanups in Qt3DSDMAnimation.h and removing some useless code. Task-number: QT3DS-3874 Change-Id: Ieaa68ec9027ce9f5ad13eba6d49f73c14d1a4a8c Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Check for datainput validity at setValueJanne Kangas2019-08-191-3/+7
| | | | | Change-Id: Ia54802faa760021e3afabc977f6d0bdcee31deca Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* remove the old bezier equation solversMahmoud Badri2019-08-166-300/+1
| | | | | | Change-Id: I4b6eb01e68b959a2dea5d01ccc4a3c2065018b32 Reviewed-by: Janne Kangas <janne.kangas@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Lazy load subpresentationsAntti Määttä2019-08-1513-150/+316
| | | | | | | Task-number: QT3DS-3731 Change-Id: Ifa7bc5fd3452e0a89576f040c232468af04ed39d Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Do not build glyphs needlesslyJanne Kangas2019-08-153-10/+5
| | | | | Change-Id: I863bcc161438422fd05d0df33de91b2e7ca4fa83 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Fix bezier curve equationMahmoud Badri2019-08-151-137/+123
| | | | | | | Task-number: QT3DS-3777 Change-Id: Id0a6bb1f824e2af494745ab9733e175ae7b4e1b0 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Fix caching of effect imagesAntti Määttä2019-08-151-2/+2
| | | | | | | Similar fix was done for the custom materials. Change-Id: I8fbb4b7df975d74d289616125ac9d98417d53475 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Discard datainput set value if it is the same as the last committed valueJanne Kangas2019-08-155-24/+55
| | | | | | | | | | | | | | | | | Store the latest value that was committed (sent out to runtime engine) and only create setValue call when the incoming value is actually different. Combined with batching, this should eliminate most performance impacts from client-side API spamming. Also, add "force" parameter to setValue C++ interface. It can be used to force a value change to runtime engine even if the value would be otherwise discarded. Change-Id: Iedd4df89a0d45b79f306dfd384745a94df8f26be Task-id: QT3DS-3861 Task-id: QT3DS-3842 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix custom shader textures that don't specify default valueMiikka Heikkinen2019-08-151-5/+2
| | | | | | | | | | | SImage instances were cached according to the default property value, instead of the actually used property value. In case the default value was not specified at all, SImage would be cached with empty key. Task-number: QT3DS-3859 Change-Id: Ie60bd5ec82f4ed7cad5d37732a6f5c01dcbdec9f Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix Float4 useJere Tuliniemi2019-08-151-0/+9
| | | | | | | | x, y, z and w coordinates were not parsed by the runtime. Task-number: QT3DS-3867 Change-Id: I4f5bbe016b8528b9b0f0d0beab40aa622f33e0e6 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Adapt distance field cache to 5.14Laszlo Agocs2019-08-142-0/+12
| | | | | | | | | | | | There is a new pure virtual in the base class in 5.14. It is not very relevant here since this glyph cache is not used in combination with the df text materials of Qt Quick. We can nonetheless implement the virtual and return the correct value. Task-number: QT3DS-3856 Change-Id: I97b807ec73a664488b63c8888bc8cd90a9c53589 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Fix datainput value setter for Q3DSPresentationJanne Kangas2019-08-144-2/+12
| | | | | | | | | Also set datainput value and dirty flag in Q3DSPresentation so that both are properly set for value changes from Q3DSDataInput and Q3DSPresentation APIs both. Change-Id: Ic7b2aa56a68bbe253de806051a5ab1201d5bec72 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Don't share surface between async init contextsMiikka Heikkinen2019-08-144-9/+29
| | | | | | | | | | | Some platforms can't handle sharing a surface between multiple active OpenGL contexts, so create a new QOffscreenSurface for asynchronous initialization purposes. Task-number: QT3DS-3862 Change-Id: I76f59bb81417c4522d40403dd5597add270dd5fc Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix multiple activation issuesJere Tuliniemi2019-08-134-8/+57
| | | | | | | | | | | | | | | | | | | | QT3DS-3766 had object have their master slide values when activated. This is fixed by applying initial values of the slide to inactive objects also. QT3DS-3768 had referenced materials not updating if the original material was changed while inactive. This is fixed by updating values of all materials even when they are inactive. QT3DS-3771 had objects be able to be activated from slides where they were not according to the editor. This is fixed by having a slide check when the user changes the activation state. Task-number: QT3DS-3766 Task-number: QT3DS-3768 Task-number: QT3DS-3771 Change-Id: I7898d693384b05b381d9bc775b68c0833447f496 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Batch setDataInputValue calls also on C++ sideJanne Kangas2019-08-137-26/+41
| | | | | | | | | | | | | | Collect/cache all set value calls to a batch within a frame, effectively discarding all except the most recent value(s) within a frame period. This decreases the performance impact of high-frequency value setter calls from external sources. Also, remove deprecated functionality from internal datainput setValue interface. Change-Id: I4165c97f96a4fe25796eb27d53802fbee507aa6c Task-id: QT3DS-3857 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Make runtime initialization optionally not block QMLMiikka Heikkinen2019-08-1322-111/+453
| | | | | | | | | | | | | | | | | Runtime initialization made non-blocking by offloading it to a worker thread. This causes various object thread affinities in runtime to be incorrect. This is relevant at least for the singaling, where having affinity to non-existing initialization thread would cause signals to not be delivered. To work around this issue, signal proxy thread affinitions and signal connections are set after initialization has completed. Similarly, behavior script QML engine initialization is deferred so that it can be done in correct thread. Task-number: QT3DS-3805 Change-Id: Ie8b64f4ecd93e4c422e369e625080652d67bde27 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Change Float4 to use QVector4DJere Tuliniemi2019-08-132-3/+4
| | | | | | | | | This fixes a bug on the editor side and makes Float4 be in line with the other types using QVector3D and QVector2D. Task-number: QT3DS-3824 Change-Id: Iee04c56575e91afa1e3e27ed02abbe50a72231e0 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Use reloadable textures with dynamic objectsAntti Määttä2019-08-1221-197/+325
| | | | | | | Task-number: QT3DS-3748 Change-Id: I0c5cd712960bd1caedb36828a159e90a52733dd2 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Batch datainput value changes per-frame for QML contextJanne Kangas2019-08-098-3/+61
| | | | | | | | | | | Group all changes in datainput values on QML side together and send a single per-frame command. This ameliorates the performance cost of frequent value updates, especially for projects with large amount of datainputs. Change-Id: Ib398f405dedb50ad3f5429f42024b3f490114dab Task-id: QT3DS-3759 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Add support for Float3 and Float4 property typesJere Tuliniemi2019-08-093-6/+13
| | | | | | | | | | | | | Float3 is an alternative naming for Vector, Rotation and Scale types inline with the Float2 naming. Float4 is an alternative to the Color type, but allows the editor to show each channel as an input box. Task-number: QT3DS-3824 Change-Id: I3f37712631015884d222743af32779b08c24fee8 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Fix build on musl libcSamuli Piippo2019-08-091-1/+1
| | | | | | | | Use bits/local_lim.h only with glibc as it's not available on musl libc. Change-Id: Ibffa4ab5649b544664f99b16e94d6865148eeeb5 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Clean up android buildTomi Korpipaa2019-08-0816-10241/+0
| | | | | Change-Id: I8b4783d47b0ac9bfd0e636dcfb564d52ae6522f2 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Fix distance field text bounding box calculationsKaj Grönholm2019-08-071-5/+7
| | | | | | | | | | First glyph was not properly taken into account for bounding box height calculations. Task-number: QT3DS-3799 Change-Id: I53565dec314e0f5749fe660aa3018b6643048101 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Initialize runtime after first Quick frame has been shownMiikka Heikkinen2019-08-072-4/+30
| | | | | | | | | | | This allows at least showing something on the screen while the presentation loads. The render thread is still blocked, so only a static QML scene can be shown. Task-number: QT3DS-3805 Change-Id: Ib0994b739506a445833b5fa5b39f2f5322dd17d2 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix format-security issuesSamuli Piippo2019-08-062-6/+6
| | | | | | | format not a string literal and no format arguments [-Wformat-security] Change-Id: I04c1d1598948b664b9d85036030c6f89fcf3c8b7 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Font rendering fixesMiikka Heikkinen2019-08-065-52/+84
| | | | | | | | | | | | | Runtime no longer create legacy text renderer if it is not necessary. Support for reloading project fonts added to distance field renderer. Legacy text renderer can now be taken into use via setting env variable Q3DS_DISTANCE_FIELD_DISABLED=true. Task-number: QT3DS-3744 Change-Id: I6f332255386aa4154ea1869feec795e08aec251f Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Ignore sourcepath when subpresentation is setKaj Grönholm2019-08-061-1/+3
| | | | | | | | | When UIP image has subpresentation set, don't try to load sourcepath as it contains same subpresentation ID and fails with a warning. Task-number: QT3DS-3723 Change-Id: I8d5a5045a78828e74f7bf7d81c1feecd75900e00 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Revert a bezier equation fixMahmoud Badri2019-08-011-10/+1
| | | | | | | | Revert a fix for the bezier equation as it caused other issues. Task-number: QT3DS-704 Change-Id: I5bfc5bef62999e3e3949c7d90ef4db1e509e8782 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Add custom shader recompilation support to the runtimeJere Tuliniemi2019-08-014-1/+62
| | | | | | | | Task-number: QT3DS-3356 Task-number: QT3DS-1693 Change-Id: Iffd961f28ab5d3de74e7c4cf2c0997696284f170 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Support changing property animation type and curve editorMahmoud Badri2019-08-018-133/+237
| | | | | | | | | Add support for changing property animation type to either of Linear, Easing, or Bezier. The core of the work will be in the Editor. Task-number: QT3DS-704 Change-Id: I69a174919917d22e61aec2da8f72ed6696e33bff Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Simplify the 2 methods that gets the animation arityMahmoud Badri2019-07-033-57/+54
| | | | | | | | | | | | | | | | Change the return type of the 2 methods below to only return the arity (num animation channels). It is enough to check if the arity is > 0 to know that the data type is animatable. This makes the methods usage much cleaner. GetDatatypeAnimatableAndArity() GetVariantAnimatableAndArity() You much also pull the commit with the same name in the qt3dstudio repo for the Editor to compile after this is pulled. Change-Id: I3e80d49aa6ddf893be43a359ddaf583f50df9180 Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Fix grouping in "Set datainput controller" menu, runtime partMiikka Heikkinen2019-06-283-8/+16
| | | | | | | | | | Properties were grouped according to property type, which was confusing. Changed the grouping to be by group, which makes more sense, and results in same ordering of properties as the inspector. Task-number: QT3DS-3373 Change-Id: I2b0cad93bbfb55efd697322d58d524eb89fed1df Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Fix custom shader properties not animating2.4Antti Määttä2019-06-281-34/+62
| | | | | | | | | | | | - Add color components for vec4 as additional properties and fix the AddEffectExtendedProperty function string building. - Optimize the functionality by removing multimple string conversions. Task-number: QT3DS-3715 Change-Id: I201e10da38a8ea4898a8c5c7b0ad77c41ece91c8 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
* Fix crash in format discoveryAntti Määttä2019-06-281-9/+9
| | | | | | | | | Simpleqml example crashes with the lambda approach. Change to regular function. Task-number: QT3DS-3721 Change-Id: I6cddd2b70c47bfb27fb2e87db02bf80a84285751 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Fix simpleqml exampleAntti Määttä2019-06-285-9/+24
| | | | | | | | | | | | | - Reset source when window changes because it will cause new renderer to be created and it would not have proper source without it. - Update the example codes and resources - Change how the init timer is initialized to get proper result each time the presentation gets reloaded. Task-number: QT3DS-3681 Change-Id: I64d4f6980b87b6efcbb906bb4ad241956ce0a7bc Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Fix progressive antialiasingAntti Määttä2019-06-288-30/+56
| | | | | | | | | | | | | | There were two problems with the antialiasing. The default materials inside container were never cleared dirty. The subpresentation rendering didn't correctly set the dirty flags when the same subpresentation is rendered multiple times. Task-number: QT3DS-1796 Change-Id: Ice1942ec4b919df009c59aa3ffdfc8efd430db1e Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Jari Karppinen <jari.karppinen@qt.io> Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
* Fix setting subpresentations via setAttributeMiikka Heikkinen2019-06-281-10/+25
| | | | | | | | | | | | | | Splitting the stringtable to static and dynamic parts broke cases where the string that was registered dynamically had already been registered to static side of the string table. This resulted the same string having two handles referring to it, which made equality checking unreliable. Task-number: QT3DS-3722 Change-Id: I5bf5f42935794f57b6947b877211f17263305b0f Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Jari Karppinen <jari.karppinen@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Fix link to third-party licensesMats Honkamaa2019-06-271-1/+2
| | | | | Change-Id: I5af22419ff45bb4ddea8f54aa43ed08e5a69b944 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>