summaryrefslogtreecommitdiffstats
path: root/src/render/io/gltfparser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add support for loading scenes from glTF 0.8 filesAndy Nichols2015-08-081-1110/+0
| | | | | | | | | | | | | | | This patch includes a new scene parser plugin which enables the loading of glTF files (using the 0.8 spec) into Qt3D scenes. The gltf example has been updated to work with the current APIs and the asset files it used have been updated to match the glTF 0.8 spec requrements. Previously an unused copy of the GLTF scene parser was located in render/io. It was being built, but not used as only plugin based sceneloaders were loaded by the renderer. Now it should be usable and always available. Change-Id: Ic2e31e2b63a871559aad9bad90ec2820988a1571 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* QAbstractAttribute: Type abstracted with an enumPaul Lemire2015-08-071-1/+57
| | | | | | | Also added a dataSize property to know the number of components per vertice (1 - 4) Change-Id: Iaa7cee2a53958ed2ec2f603f3ffc7971c027991d Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* New Buffer API Frontend ClassesGiuseppe D'Angelo2015-08-071-6/+6
| | | | | | | | | | | | | | | - Switch QAbstractAttribute and QAbstractBuffer to QNode subclasses - Get rid of all shared pointer when dealing with these (needed to expose to QML and use the QObject ownership) - Introduce QGeometryRender, QGeometry, QAttributeProvider, QAttributeAggregator. A QMesh component now is: a QGeometryRenderer which specifies its QGeometry. The QGeometry refererences n attributes. Each attribute references a QAbstractBuffer. Change-Id: I49a10c11a605e5fe7c180af86a404f622e763f48 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Functors: remove dynamic_castPaul Lemire2015-07-281-18/+19
| | | | | | | | | | | | | | | Introduce a QAbstractFunctor class which QAbstractMeshFunctor and QTextureDataFunctor subclass Make all QAbstractFunctor subclasses implement an id() function (using QT3D_FUNCTOR(Class)). Use this id to compare to other QAbstractMeshFunctor and eventually static_cast into right type if possible using the functor_cast member function. Change-Id: Iface956e6cd818cbef204d8fa7bf2bc23c6ffa3f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add semicolon to Q_UNUSED expressionsMarc Mutz2015-06-111-2/+2
| | | | | | | | It compiles without, apparently, but it throws off QtCreator's parser, at least. Change-Id: I69939cdb3c28f39458488190b1169c152a339ccf Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Do not pass `this` to Private c-torKonstantin Ritt2015-05-201-6/+4
| | | | | | | For classes derived from QNodePrivate, it is not used anymore. Change-Id: I9573042500c2c7533687d251e72bac14cb793525 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* [.*SceneParser] Minor clean-upKonstantin Ritt2015-03-161-7/+7
| | | | | Change-Id: I171a3e44383f2f5160b24113de6d92725ed19fe9 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Nano optimization to GLTFParserKonstantin Ritt2015-03-041-3/+3
| | | | | | | | Do not load a identity matrix if we're going to initialize its values by hand. Change-Id: I7d745f4090a78ab4ecca99c313f15d689d32fc92 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Make scene parsers operate on URLs instead of raw filenamesLaszlo Agocs2015-02-131-2/+5
| | | | | | | | This way they are compatible with how mesh and texture source URLs are handled. Change-Id: Ifeee504fd3f5957d23f5cade92a73663488bdaf9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Copyright header change.Mika Salmela2015-02-091-20/+15
| | | | | | | | As for preparation for Qt5.5 release the copyright header is updated to correspond the current license requirements. Change-Id: I36632918b66f455539453b42c369689fb11298ec Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Make ctor of QAbstractTextureProvider protectedPaul Lemire2015-02-081-23/+25
| | | | | | | That enforces to use one of the subclasses. Change-Id: Idba7300ed322954ba6866c4a262ad4ee74c024e5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QTexture renamed to QAbstractTextureProviderPaul Lemire2015-02-081-4/+4
| | | | | | | | | | This is done prior to the whole texture API refactoring. Doc was also added, might need improvement later on but a base is present at least. Change-Id: I75589f14dfbfba7bc4250b2e0960670e020ed38a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* [QMeshData] Rename PrimitiveTypes to PrimitiveTypeKonstantin Ritt2015-01-051-1/+1
| | | | | Change-Id: I9f67e0906fc481491a604090a0ade1c8b9c2793c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* renderlogging.h -> renderlogging_p.hSean Harmer2014-11-191-1/+1
| | | | | Change-Id: I985366c47d2a1f721761c64b1870850071ace885 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QTransform refactoredPaul Lemire2014-10-301-1/+1
| | | | | | Change-Id: I9c05c37b7f9576b81169c30686de96c9267e4854 Task-number: QTBUG-41542 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QTechnique refactoredPaul Lemire2014-10-301-21/+21
| | | | | | Change-Id: I0389c19a52aa690b5eaa8c2a3e7dee6a2b17e565 Task-number: QTBUG-41533 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QTexture refactoringPaul Lemire2014-10-301-6/+3
| | | | | | | | | | | | | | Target is now set in the ctor from C++. On the QML side, there's a QTexture subclass for each target. WrapMode on s, t, r for texture, accessible as a grouped property in QML. Note: I left out the static fromImage as I didn't really understand their purpose. Please let me know what I'm missing. Change-Id: I16f75283ae459cbd8ab2d1ec53584b3022bc965b Task-number: QTBUG-41537 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QMeshData: enum for primitivesPaul Lemire2014-10-221-1/+1
| | | | | | | | | | Each value in the enums maps directly to the correct GLint for a given primitive patch. This allows to still return an int to be used directly by the renderer. This should also fix compilation error of ES2. Change-Id: I7ec54dcb2cbb02b67fa6225bb80fb7e691687e2c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QAbstractMeshData merged with QMeshData and moved to RendererPaul Lemire2014-10-221-3/+3
| | | | | | | That implied moving QAbstractMesh to Renderer as well. Change-Id: I9013bf0458b849f7805d214a70580a80e86d8c84 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QAbstractMesh: setDirty -> updatePaul Lemire2014-10-201-1/+1
| | | | | | Change-Id: I8e4094d69446ec8290fa34e4875f5e1cf822054c Task-number: QTBUG-41522 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QShaderProgram: remove source file properties, replace by helper methodPaul Lemire2014-10-181-2/+3
| | | | | | | | | | Only the source code QByteArray properties remain. The user is still able to load a shader from a source file by using the shaderFromSource helper method and assigning what it returns to one of the QByteArray source code properties. Change-Id: I5246498fa680ec74d095d7a45f0b1bce239efc13 Task-number: QTBUG-41536 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Have copy() only on QNodeKevin Ottens2014-10-161-6/+7
| | | | | | | | | | It was previously both on QNode and QNodePrivate. The one on QNodePrivate didn't give us much as it didn't eliminate the virtual of QNode. Change-Id: Ia1ea9dd831674109c84bd7005abe7fde3b1223fa Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Hide doClone implementations behind a macroKevin Ottens2014-10-151-8/+1
| | | | | | | | | This way we will avoid inconsistencies. It also means making some of the copy() implementations more clever. Change-Id: Ic79c9ec7c9c32f8951d5d9f5184592880bf8d5fd Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Silence warnings in GLTF parserSean Harmer2014-10-041-0/+2
| | | | | Change-Id: Ifaf0e94a01bbd8a8aff545dda086dd9ae00ed8a7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QNode refactoringPaul Lemire2014-10-031-19/+34
| | | | | | | | | | | | | | | | Move almost everything to private classes. Assimp loading restored. All examples working. QNode hierachy is now handled through QObject::setParent, addChild, removeChild are part of the private api. Note: commented QChangeArbiter unit tests as they can no longer work with this patch and will restore them when QChangeArbiter will have been made private. Task-number: QTBUG-41470 Task-number: QTBUG-41523 Change-Id: I4430974b3aa7f3744c38714b451b122e0cb4d0c9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* GLTFParser commented out parts to adapt to QParameter changesPaul Lemire2014-09-301-70/+70
| | | | | Change-Id: Ia44a602d6111c7622f921cf8e41bc4c33e670728 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Improved/Refactored cloning and doClone off all subclassesPaul Lemire2014-09-301-3/+7
| | | | | | | | Note: As we are using QScene during cloning, it is important that node hierarchy be created and added in the proper order (parent then child). Change-Id: I8fd53f7ca696ec9aca19cc70dc116ccba4154911 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Comparison operator for QAbstractMeshFunctor subclassesPaul Lemire2014-09-301-0/+6
| | | | | Change-Id: I18f0c46631615787a5505f7591514bfd33ac6bd0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QParameter new overloaded ctorsPaul Lemire2014-09-291-1/+1
| | | | | Change-Id: Ia6e3c3285884265b303485176109a4d2c80ccabe Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add support for remaining shader stages and rename some propertiesSean Harmer2014-09-211-2/+2
| | | | | | | | | | | Examples updated to reflect new QShaderProgram property names. Next commit will add a new example to test the handling of tessellation and geometry shader stages. We need to somehow expose buffers and image units to make use of compute shaders. Change-Id: Idf76cef97a42d5829402c8aa8cc4e288678a3407 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Texture renamed to QTexturePaul Lemire2014-08-191-7/+7
| | | | | Change-Id: I6f5570ce042b8d3ef44aa76c1fd8ce3a1dde4d3c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Texture subclass of QNodePaul Lemire2014-08-191-1/+1
| | | | | Change-Id: I0b6f3a6e4dfa75ce1cc29ee38bb709b8bad6a88f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rename MeshData -> QMeshDataSean Harmer2014-08-181-10/+10
| | | | | Change-Id: I23a466ebd29666bed1c56f29c6f049544a4eca23 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* The gltf parser is now privateSean Harmer2014-08-181-1/+1
| | | | | Change-Id: If6ff04047cb3befe532a0b83f09c8c6ca1c08a35 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Mark backend render classes as private and fix compilationSean Harmer2014-08-171-43/+44
| | | | | Change-Id: I1afb8408e03d4b5405e8ee82d1a3b6b4364d3f5d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Avoid naming classes DrawStateLouai Al-Khanji2014-08-151-4/+5
| | | | | | | | | | | Since winuser.h contains a DrawState #define, this tends to wreck havoc on Windows. This patch respectively renames QDrawState, Qt3D::Render::DrawState and Qt3D::Render::DrawStateSet to QRenderState, Qt3D::Render::RenderState and Qt3D::Render::RenderStateSet. While this is more invasive than just undefining DrawState, it should be more foolproof too. Change-Id: I9fa86e5bf1fe41fb4839bd146822cc43e26019e6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* GLTFParserMesh implements doClone and copy methodsPaul Lemire2014-08-131-6/+48
| | | | | Change-Id: Id79399535aae8b8e0f14e9edf40e05375803a64f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QAbstractMeshFunctorPaul Lemire2014-07-191-4/+16
| | | | | | | | | | | | | Each QAbstractMesh class now has to implement a QAbstractMeshFunctor class. When a mesh is set to dirty, the functor is sent through a QChangeArbiter notification to the backend. The backend, using the functor can then rebuild the mesh. There should be no issue if the frontend mesh is deleted while the backend is creating the mesh as the functor has no direct reference to the frontend element and contains all the data needed for a complete creation of the mesh. Change-Id: I4984f03a612e74c688bfb6cc2f19d9241b517457 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Renamed ShaderProgram to QShaderProgramPaul Lemire2014-07-091-2/+2
| | | | | Change-Id: I7a9fd824f1975791ee7448023d089e06c34de69d Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Renamed Camera to QCameraPaul Lemire2014-07-091-1/+1
| | | | | Change-Id: I8a37bd9d2f24d77c4f4a3aec41028df0b292d7c6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Renamed CameraLens to QCameraLensPaul Lemire2014-07-091-4/+4
| | | | | Change-Id: I3436d48f08f5eb29fd821538d9d88e12a48a305a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Renamed Parameter to QParameterPaul Lemire2014-07-091-46/+46
| | | | | Change-Id: I1377b93ca06a838a625d38db8b77ebcee438b203 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Automatic uniform bindingPaul Lemire2014-07-071-26/+26
| | | | | | | | | | | | | | | | | | If the shader contains a uniform with a standard uniform name, it will automatically be set. If a custom name is used within a shader for a standard uniform variable, the user can add a ParameterMapper with parameterName set to the Qt3D standardUniform name and shaderVariableName to the custom name. For user specified uniform parameters, if the parameter name is the same as the shader uniform name, the binding is done automatically. Otherwise, a ParameterMapper can be used. At the moment automatic binding for Attributes still has to be sorted out as default attribute names are dependent on a given MeshData. Change-Id: If244b26e5c2b01c8b319ba78c57fb1e131736dcb Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Prefixed Q to transformsPaul Lemire2014-07-061-2/+2
| | | | | | | QAbstractTransform also has a d-pointer. Change-Id: I577dc48d21545f4f5cd1320529951612cbef0739 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Renamed Transform to QTransformPaul Lemire2014-07-051-2/+2
| | | | | Change-Id: Ic7ee353afbc8872f5f5a85662acc190ccae4d178 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Renamed Entity to QEntityPaul Lemire2014-07-051-9/+9
| | | | | Change-Id: I16b3d967e1244e3d47bffd36f6284a0e9ef0a89f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Renamed Node to QNodePaul Lemire2014-07-051-1/+1
| | | | | Change-Id: I0a0ebde1c107db8831b596eab1e512a2062979f7 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Refactored QAbstractMesh, QMesh and QAbstractShapeMeshPaul Lemire2014-07-051-4/+19
| | | | | | | | | | | | The Backend now monitors QAbstractMesh elements instead of QMesh. QAbstractMesh subclasses have to implement a load method. For QMesh it uses the ObjLoader to create MeshData from a source file while QAbstractShapeMesh loads MeshData created by code. Each scene parser can then implement its own QAbstractMesh subclass. The loadmeshdatajobs has been corrected and works with QAbstractMesh. Change-Id: I5caae63a153f18eaae3b2f1bdbfa8995c63a2d23 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Refactoring of MeshData, Buffer, Mesh and AttributePaul Lemire2014-07-051-1/+1
| | | | | | | | | | | | They are now subclasses of the abstracts defined in the previous path. QAbstractMesh's source property was transferred to QMesh, this will allow to have ShapeMeshes subclass QAbstractMesh directly and not have a useless source property. MeshData, Buffer and Attribute moved to their own files and properly d-pointered. Change-Id: I6d09b00a17045826e16503f5fb2d8f8eb0f2abf2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QRenderPass renamed and d-pointeredPaul Lemire2014-07-051-1/+1
| | | | | Change-Id: I73a7f64491392eb24d8f2c8eb5ad4c0590e572ce Reviewed-by: Sean Harmer <sean.harmer@kdab.com>