summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Add stereoscopic QML exampleKaj Grönholm2018-12-0710-1/+562
| | | | | | | | | | This example demonstrates stereoscopic QML API using ViewerSettings. It contains simple presentation, optimal for stereoscopic viewing and allows opening also other uip files. Task-number: QT3DS-2695 Change-Id: I3003b312e2da23a83076f930227006d1e28724ef Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add a way to hook into the private API, with example and docsv2.2.0-beta1Laszlo Agocs2018-11-169-1/+344
| | | | | Change-Id: Ib46f4e753964eaad02f455f80962321fb64496c4 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make manylayersinquick example a manual test for nowLaszlo Agocs2018-11-167-309/+1
| | | | | | | Will not productize this in 2.2. Change-Id: I6be378671efba1e99f289955a230ac95bdc91a8d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add another View3D exampleLaszlo Agocs2018-10-297-1/+309
| | | | | | | | | | | As we should demo the case where View3D's are inside a ListView's delegate. Will crash eventually when scrolling. That needs to be fixed separately in the engine. Change-Id: I32fd35608c98e182b7e22a92f4f5f9b69a387c5d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make layersinquick work with non-core GL contextsLaszlo Agocs2018-10-121-2/+13
| | | | | Change-Id: I5b040615ee0115d0b59fe2c33e28979e5cdc20b6 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Bring View3D and Studio3DProfiler back as publicLaszlo Agocs2018-10-129-1/+499
| | | | | | | This reverts commit 0752ab7e7b7c3d2e5daa6023c4ea93c84b8e45ec. Change-Id: Ie2f71e19a8a05fd1d2554934a9dba235dca9933c Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Mark View3D and Studio3DProfiler as internal for nowLaszlo Agocs2018-08-239-499/+1
| | | | | | | | | | Also move the example to tests/manual. Hide all public references to these types for now. They are fully usable of course. To be re-enabled in a later release. Change-Id: Ib7f6a53eed131280307821e1f63ddac9856e33fe Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Add support for SSAA and MSAA in View3DLaszlo Agocs2018-08-223-1/+68
| | | | | Change-Id: I5958d6391504d57c8c11c31ccc8b3de0d1a038fc Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Add Object3D infraLaszlo Agocs2018-08-175-183/+1
| | | | | | | | | | | | | Use Group (and Node) to crystalize the concepts. Fix also some issues in Studio3DEngine. Also changes the pureqml example to a manual test since Studio3DEngine and friends are marked as internal for now, so shipping examples for them along with the regular examples is not desirable yet. Change-Id: I8ab0ad50d1b846cadb6927fcb38afe9dff576c2e Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Add doc page for layersinquick exampleLaszlo Agocs2018-08-152-0/+65
| | | | | | | And add the missing property docs for View3D Change-Id: I9c4725710da66543633ba1337ca45934227f79b6 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Enable HighDpiScaling for the QML examplesLaszlo Agocs2018-08-152-0/+2
| | | | | | | | | | On macOS this is the default anyways. On Windows machines however the devicePixelRatio will not be > 1 without AA_EnableHighDpiScaling. Set this flag in the examples to indicate we are capable of handling this. (and also test-drive this a bit better on non-Apple machines as well) Change-Id: Iafd30536e527dbc3ab764be44287ff3651106093 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Yet another imgui scissor fixLaszlo Agocs2018-08-151-1/+1
| | | | | Change-Id: I8834a4ff0564f42331c4ccc2ca89629cc1c13fd4 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Move layersinquick example over to Quick-based profileuiLaszlo Agocs2018-08-141-1/+20
| | | | | | | So that it now works on both normal and separatedViews mode. Change-Id: I220e9e221b6cc8702fd83b02031a9eb7593e7791 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Introduce Studio3DEngine and Layer3DLaszlo Agocs2018-08-145-1/+183
| | | | | | | | | | | | | | ...and the ImGui integration for Qt Quick since in the new world Qt 3D is not used to create the final, composited image and therefore the profile ui must be moved over to be rendered by Qt Quick. Each Layer3D has hard-coded content for now (a camera, a light, and a sphere model). The new types are marked as internal for the time being. Change-Id: I9cc7cff4d8252f6dbd344fc972fef31f0db6da73 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Add an optional separated engine-view mode to Studio3DLaszlo Agocs2018-08-146-1/+347
| | | | | | | | | | | | | | | | | | | | Adding View3D items to the Qt Quick scene allows turning off layer composition in the main presentation, and instead accessing each layer's texture as an individual visual QQuickItem. This way the 3D layers can be placed anywhere and be blended freely in the 2D scene, while avoiding all the trouble multiple Studio3D items would cause. This also moves composition into the Qt Quick domain, providing a more sensible story for creating 2D-3D UIs. While post-processing effects are still active even in separated views mode, it is now possible to use ShaderEffect instead. MSAA and SSAA layers are not handled currently and are left as a future exercise for those who like mind-boggling complexity. Task-number: QT3DS-2032 Change-Id: I08128b65d0344c609f8dea15f9562ccfd19140a6 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Update example presentations to new UIP versionTomi Korpipaa2018-05-308-7/+7
| | | | | | | | Task-number: QT3DS-1820 Change-Id: I5c7d13572385617f698ed08c33b5acc0636aaa49 Reviewed-by: Janne Kangas <janne.kangas@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Add layer to barrel.uipMäättä Antti2018-05-181-0/+1
| | | | | | | | | Fix the presentation file to specify layer in master slide. Otherwise the file can not be edited in the studio. Change-Id: I4bb42e182b7acc147edecdd2e34e7f823468deed Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
* Revamp simplewidget exampleLaszlo Agocs2018-05-1513-26/+344
| | | | | | | | | | | | | | ...and move the Q3DSDataInput usage demonstration to simplewindow (since the new presentation has no data input) The simplewidget now uses the old "SampleProject" (the simple speedometer), since this is already featured on the example's documentation screenshot anyway. The Corona effect has been dropped. Remove also a leftover entry in the barrel project's .uia. Change-Id: I3188b24236c566f4919c655b8d024375c7fc7d06 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* simpleoffscreen: add doc landing pageLaszlo Agocs2018-05-152-0/+47
| | | | | Change-Id: I5b21a3ff376ec7d37697058956ee2795a4c860d2 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* qmldatainput: add doc landing pageLaszlo Agocs2018-05-152-0/+55
| | | | | | | The contents is imported from 1.x, the screenshot is new. Change-Id: I25e5fa0dc192aa8d71eb7b589d0e433dc15dce2a Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* simplewindow: add doc landing pageLaszlo Agocs2018-05-152-0/+51
| | | | | Change-Id: I4ffdd4bd41466611276028ba47ade306f816e51b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* simplewidget: add doc landing pageLaszlo Agocs2018-05-152-0/+48
| | | | | Change-Id: I0ff549a315971e6cffec10f4901ec16dc1cabf68 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Start adding example doc pagesLaszlo Agocs2018-05-142-0/+51
| | | | | | | First for simpleqml. Change-Id: I88037aec8ad90fc702862c1de7b1eb7d5126f311 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* simpleqml: Drop fire event and subpresentation testsLaszlo Agocs2018-05-142-34/+0
| | | | | | | | | | | Make the example more like an example and drop features that are used for testing. The qml stuff also causes performance degradation on some systems (esp. on AMD on Windows) so it's not a good showcase. Change-Id: Ia113180669056fb935a9dfcbfab2a4595b2345c5 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make calling Q3DS::surfaceFormat() optional for Studio3DLaszlo Agocs2018-05-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Our standard pattern is to expect applications to call QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat()); after creating the Q(Gui)Application, in order to ensure all OpenGL stuff and Qt Quick uses the format the runtime has determined to be ideal. With Studio3D however this is not always feasible - the Qt Quick scene may be hosted in an application that knows nothing about 3D and surface format gotchas. Therefore, make Studio3D force using the QQuickWindow's format() in case it is different from the ideal one. (if there was a setDefaultFormat(), as recommended, then the version/profile would match). At the same time drop Q3DSEngine::surfaceFormat() as an API on Q3DSEngine. There is no need for this (there's always the public Q3DS::surfaceFormat()) and not having this makes future steps towards getting rid of the globals easier. Task-number: QT3DS-1645 Change-Id: I43e8c0da4aa17e03eb2c49755eb064dd2dc3d0ce Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Update simple Runtime 2.0 qmldatainput exampleJanne Kangas2018-05-144-9/+18
| | | | | | | | | Add textstring control, add shadows and floor rectangle for better visualization. Task-number: QT3DS-1491 Change-Id: I0dc40acc7e465cf530b9776e462bc4dde395fe90 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Make the offscreen example a console appLaszlo Agocs2018-05-081-1/+1
| | | | | | | This one does not open a window and prints some messages. Better see them. Change-Id: I63fc3c78b29b9a721a651c247a72060cf10f8212 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Integrate latest datainput UIP format changesJanne Kangas2018-05-038-1/+343
| | | | | | | | | | | | Parse special char "$" denoting datainput name in UIP parser. Add Variant type datainput. Fix timeline controller goToTime calculation. Add example (without textstring controller due to bug QT3DS-1413). Add new datatypes to profiling UI. Task-ID: QT3DS-1477 Change-Id: Iba0fa0ef19c8380e6961bce8d8846c776065aa30 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* SubPresentationSettings and QmlStreamLaszlo Agocs2018-04-273-18/+46
| | | | | | | | | It is now possible to define QML subpresentation contents in-line inside a SubPresentationSettings/QmlStream element inside the Studio3D. Task-number: QT3DS-1487 Change-Id: I31665d939eb0e1c804c7ce54febe7df475e9ccba Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add getAttribute to Q3DSElement for API symmetryLaszlo Agocs2018-04-271-0/+15
| | | | | | | | | | We added it everywhere elso too, even where it was missing in 1.x, so have it here too. And add something to the example. Change-Id: Ie82ee80807384f9cc1f00064af5e593f3f534ca6 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Add Q3DSSceneElementLaszlo Agocs2018-04-271-2/+26
| | | | | | | | | | Exposed to QML as SceneElement. "Conveniently" duplicates more stuff from Q3DSPresentation. Go figure. Task-number: QT3DS-1014 Change-Id: Id3af13592cbddafd2081a0eae50fb2dd4c2f3229 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Add Q3DSDataInputLaszlo Agocs2018-04-239-2/+62
| | | | | | | | | | | | | | | | | | | | | | | | | Exposed as DataInput in the QML API. Also fixes a parsing issue with controlledproperty attributes in the Logic section. (namely that the attribute as not parsed if it was in an Add/Set). This involves some reorganizing of how the data is collected since we now need to accumulate both from the Scene and Logic sections. Also fixes cloning (Alias node) of controlledproperty data. Also adds a presentationLoaded() signal to Q3DSWidget and Q3DSSurfaceViewer because applications may want to act whenever a new scene is loaded (e.g. call setValue on some Q3DSDataInput object). Studio3D handles this internally and DataInputs magically just work, setting the values even when doing a reload or changing the source filename. Also adds a command 'datainput' to the console to allow quicker investigation of data input connections in the scene. Task-number: QT3DS-1404 Change-Id: Id2436490721e3386ba8604ca29ad4bda785521d2 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add profile ui toggling to widget exampleLaszlo Agocs2018-04-191-0/+6
| | | | | | | | | | the qml one has been updated before but there is no way to toggle the view from the widget example. Add this, especially because seeing the framerate for the widget is important - right now Q3DSWidget still suffers from being locked to ~30 FPS for some reason. Change-Id: I4beb6ecef2df74a5ca6ccd74fea1da4baf73712d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* simpleqml: Show second window only when neededLaszlo Agocs2018-04-101-2/+5
| | | | | Change-Id: I76a85bf2e3ba660edd06b51595af2365e4565c09 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add API for toggling profile UI and disable the implicit togglesLaszlo Agocs2018-03-262-4/+21
| | | | | | | | | | | | | | | | | | | | | In the viewer profiling is enabled by default and the built-in toggles (F10, backtick, double double click) or the menu item (when using widgets) can be used to bring up the UI. For applications none of these is ideal. Instead, provide a Q3DSPresentation property that can be used to toggle the UI. Therefore, an application will typically do profilingEnabled: true on its Presentation and then set profileUiVisible to true when it wants to. This way we are not tied to the sometimes not ideal keyboard and mouse shortcuts in real applications. Rename Q3DSEngine::profileUiEnabled to autoToggleProfileUi because that's what it really is. It merely enables or disables the built-in keyboard and mouse shortcuts for toggling, nothing more. Change-Id: If49ed7bc2575b7e81c2f6101dba307a639c3c011 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Q3DSPresentation: add profilingEnabled propertyLaszlo Agocs2018-03-261-0/+1
| | | | | | | | | | | | Have a way in the public API to enable the profile UI and to load presentations with QObject tracking enabled. The private API separates these two but for simplicity the public API has a single flag for both. Defaults to disabled which is what applications need in production. During development one can just do profilingEnabled: true. Change-Id: I228d7936897b6891bf4727ade126b4dbda72f73f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* simpleqml: Avoid buttons stealing keyboard focusLaszlo Agocs2018-03-211-0/+10
| | | | | Change-Id: Ic093f3fc122b1c09ad82760e59dcd69ede550822 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add goToSlide variantsLaszlo Agocs2018-03-201-0/+13
| | | | | Change-Id: I7598a167b4c10a38b9e824189491e08271083c50 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* more API: go to time, slide by name, get/setAttribteLaszlo Agocs2018-03-201-0/+7
| | | | | Change-Id: I43cfd846fc2c37f27d50995920094ab4c2e31b4d Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Implement slideEntered/Exited signals in the public APILaszlo Agocs2018-03-201-0/+14
| | | | | | | | Needs some rework internally since this needs passing around more data in our internal event struct. Change-Id: I879f11a279bea424b981358f27115969e5980c55 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Q3DSPresentation public API: fireEvent and a few enablersLaszlo Agocs2018-03-201-0/+7
| | | | | | | | | | | | | Some of the to-be-added APIs involve the silly element path concept which we cannot avoid now. So move the lookup function to Q3DSEngine and add the opposite that constructs a Scene.Layer.BlahBlah type of path from an object. The duplication of overrides for Q3DSPresentationController functions is now avoided by implemented some of the handleXxxxx functions in the base class (the ones that just forward to Q3DSEngine). Change-Id: I67cca6c0f56e545c1ba4dbf040dff26273bf823f Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Add support for EmitSignal in actionsLaszlo Agocs2018-03-191-0/+7
| | | | | | | | | | | | | This is just a way to notify the user application code about something happening. Hook it up to a signal in Q3DSEngine (for private API users) and Q3DSPresentation (public API). The node path is omitted since the concept of 3DS1 horrible absolute paths is not desirable in 2.0 and there is nothing one can do with it in the public API anyway. Demonstrate it in the simpleqml example and actionevent.uip. Change-Id: I3096ffc20ab5a401195a4da4e4f37208e571ab6c Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Solve some sizing issues with the offscreen exampleLaszlo Agocs2018-02-281-0/+3
| | | | | | | | | | | Frames 2, 3, ... are now sized correctly. The first frame is still incorrect in the sense that it renders at the presentation's size into the FBO that is the application-provided size. Not clear what causes that. Task-number: QT3DS-1248 Change-Id: Idde9a72847f0996a8b58fb89d80eb3a67fed5ff2 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix readback in the offscreen exampleLaszlo Agocs2018-02-281-0/+1
| | | | | | Task-number: QT3DS-1042 Change-Id: I047b64ef1e8bcb641d48df9148183cdcf60ad088 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add Q3DSSurfaceViewer APILaszlo Agocs2018-02-1411-0/+618
| | | | | | | | | | | | | | | | | | | | | Same disclaimer as for widgets, rendering is not perfect yet. Offscreen readback is broken for reasons not known. (QT3DS-1042) When rendering offscreen (and then reading back to generate images for example), the global animation time cannot be controlled yet. (to be handled in QT3DS-1041) As a bonus, Qt 3D apparently does not like when the event loop is never pupmped (because the application returns right away from main()) and tends to deadlock upon cleanup. Worked around with a processEvents in the example, needs a better solution later. The API is revised somewhat when compared to 3DS1. Fixed frameUpdate naming, now uses normal Qt patterns for create-destroy, etc. Change-Id: Iee0c39483831b68fbc1889922d54b3cc5e8726e2 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add Q3DSWidgetLaszlo Agocs2018-02-124-2/+134
| | | | | | | | | | There is one tiny little issue: for reasons only Qt3D knows it is locked to 30 FPS (at best, it even flickers when getting busy). Let's revisit this once the Qt3D renderer fixes are in place. Task-number: QT3DS-839 Change-Id: I6c315914523106e17a39f2e601a9b51f236fc318 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Port Studio3D properties and signalsLaszlo Agocs2018-02-083-4/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | Add the following: Signals: frameUpdate - emitted on every frame action invocation presentationReady - emitted upon each successful presentation load Properties: running - emitted on presentation load. Some semantics cannot really be ported over since the engines work differently. There's also a lack of true -> false -> true transition when opening another presentation but that's assumed to be acceptable. error - error messages from parsing and others is now collected in a string (and no widget dialog is shown when using Studio3D) ignoredEvents - input events can be disabled. Unlike 3DS1 we use a proper property with a flag-based API in Qt style. Change-Id: I608840d5c8dceb169541441de635a576ac014e30 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add basic public API structureLaszlo Agocs2018-02-081-4/+7
| | | | | | | | | Say hello to Q3DSPresentation / Presentation in QML. While the internals are quite different from 3DS1, we can now start providing an API very close to the old runtime. Change-Id: I425bd869fbe00b8af7b5166fdab17f4d91a7764b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Studio3D: handle qt_Opacity correctlyLaszlo Agocs2018-02-063-0/+73
| | | | | Change-Id: I42c0c2ed468d1f7e741e5a46e0aa72cccb936108 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add an event log windowLaszlo Agocs2018-02-061-0/+1
| | | | | | | | | | | | | | | | | | | Say hello to the log window, invokable either from the Scene info pane, or by pressing ` (the latter should be an easy and familiar shortcut to toggle; the window/item needs to have focus though). The creation of the first Q3DSEngine will kick off capturing the Qt debug/warning messages. The Qt message handler is still called. The captured content is always pushed to the current main presentation's profiler and is thus available in the log window (until cleared). All this enables introducing performance hints, markers for interesting events (e.g. material rebuilds or other unideal events) in the future since the messages are available in one central place regardless of the platform and the methods of launching the app. Change-Id: I6b75e149482b66689dd3d7ba2ff8c2039866c739 Reviewed-by: Andy Nichols <andy.nichols@qt.io>