summaryrefslogtreecommitdiffstats
path: root/src/extras
Commit message (Collapse)AuthorAgeFilesLines
* Remove qfirstpersoncameracontroller_p.h from defaults.priFriedemann Kleint2017-10-201-1/+0
| | | | | | | | Fixing warning: WARNING: Failure to find: defaults\qfirstpersoncameracontroller_p.h Change-Id: I81d38b43c41fbca22ad8d4cffc73fc4b2c6679c9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Connect the normal parameter to the right signalKevin Ottens2017-10-131-1/+1
| | | | | Change-Id: I62f1d637f595d576bd1c4df48ef32a0002e6aa18 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Have all the Phong variations based on a graphKevin Ottens2017-10-1325-307/+609
| | | | | | | | | This commit introduces a new layered graph file to deal with all the Phong material variations. It ports all the materials to using it, then of course it removes all the old frag implementations. Change-Id: Ia519eaf4cea3b6e3ff4dd5aa1cca2bedbfcbe7cb Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Doc: Add the correct namespace for QAbstractCameraControllerTopi Reinio2017-10-121-1/+1
| | | | | | | | Without the namespace QDoc fails to find the class documentation. Change-Id: I999846649a4e6df975f09dca169be9d83f99ae7a Reviewed-by: Andy Maloney <asmaloney@gmail.com> Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* Doc: add doc to undocumented methods in qt3dwindow.cppNico Vertriest2017-10-091-1/+27
| | | | | Change-Id: I450cdbd7cee58ae84f45ad82c5bc15489fe61771 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Fix dolly in/out speed calculationSean Harmer2017-10-061-1/+1
| | | | | Change-Id: Ie7fe80039a6cb88a0f1540ce252c9dee36d0afe1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add Qt3DExtras::QAbstractCameraControllerv5.10.0-beta1Andy Maloney2017-10-0310-843/+810
| | | | | | | | | | | | | | Abstracted the orbit and first person camera controllers into a base class. These two controllers shared a lot of similarities. This allows developers to easily create a custom camera controller by deriving from QAbstractCameraController and implementing one function. [ChangeLog][Qt3DExtras][] Added Qt3DExtras::QAbstractCameraController abstract base class to make implementing new camera controllers easier. Change-Id: I43cfbc03f7294b1740f199ac7ededa9578234974 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Since the ES2 includes use FP make sure it is definedKevin Ottens2017-09-273-0/+6
| | | | | Change-Id: Ibb735878c6c6b7f14eb26a0f98c200045b4979b6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Move phongFunction in its own include fileKevin Ottens2017-09-2719-269/+423
| | | | | | | | | Makes it cleaner overall since the light structs were shared with the metalrough includes and the gooch fragment shader but they didn't use the functions in there. Change-Id: I459ff0fc2d751a5be9296dc33dda0efcb06b917c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add textureScale to MetalRoughMaterialKevin Ottens2017-09-273-0/+35
| | | | | | | | | | This property was available in the textured phong variants but somehow we didn't implement it yet for metal/rough. This new parameter is not used yet, but will be in the next commit where we unify the vertex shaders. Change-Id: I0d5293f6413a4a0412d92d2d42bf700238938fc6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Move most vertex shaders into a unified oneKevin Ottens2017-09-2717-186/+105
| | | | | | | | | We currently do a bit more work than strictly needed in some cases, but that will change later on when this shader is converted into a graph. Changing now will make this future refactoring easier. Change-Id: I887601c18575bef79e25a23ed054aa336b1e860a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Remove the *alpha.frag from extrasKevin Ottens2017-09-277-120/+4
| | | | | | | | They are identical to their non-alpha counterparts at that point, so no need to keep them around. Change-Id: Ia3961670dc1d5c0f65711476c8dc6cc467df62c5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* PhongAlpha: encode the alpha in kdKevin Ottens2017-09-274-20/+12
| | | | | Change-Id: I331dd9b4adf7a412338daba6d11ca945dc290054 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Wrap adsModel into phongFunctionKevin Ottens2017-09-2521-130/+136
| | | | | | | This way the use is more similar to the one for metal/rough. Change-Id: I143df910f43e29ef622f24bd97a23c90a2c8ef68 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Base PerVertexColorMaterial on adsModelKevin Ottens2017-09-255-161/+8
| | | | | | | | Since this was the sole user of adModel we also remove it in the process. Change-Id: Ibb79bb05c10b33e69601624ea9ad1fdf8523fdbf Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Get rid of adsModelNormalMappedKevin Ottens2017-09-2213-262/+159
| | | | | | | | | | | | All materials and examples are ported away from it. It was really not related to normal mapping at all, somehow it was an implementation of adsModel working in tangent space instead of world space. Now we got it all in world space, just like for the metal/rough implementation. Change-Id: I3346277ce9b91328d70d914b319ac25f947fff0e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Port away from QBuffer::typeKevin Ottens2017-09-228-16/+16
| | | | | Change-Id: I910d1fa7099dc726e022cbf35702b0b58fbac64e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix a typo in 'metalrough.frag.json'Renato Araujo Oliveira Filho2017-09-191-1/+1
| | | | | | | Fix 'ambientOcclusionMap' layer name Change-Id: I64b25a6958c60728471909686db39e89f916d16a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QMetalRoughMaterial replaces QTexturedMetalRoughMaterialKevin Ottens2017-09-044-475/+11
| | | | | | | | | This is a complete drop in replacement now, no need to keep code for both. We use inheritance so that properties in QMetalRoughMaterial can be versioned properly. Change-Id: Ia95b40c5abd466fbb20e5b15ca4e6d167fb80ec3 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Use layers to have only one graph for Metal/RoughKevin Ottens2017-09-047-379/+428
| | | | | | | | | | | | | Both QMetalRoughMaterial and QTexturedMetalRoughMaterial use the same graph now. Also QMetalRoughMaterial does the job to be clever and activate the right layers depending on the type set on the properties (which is why they are now all variants). QMetalRoughMaterial can then be used as a drop in replacement for QTexturedMetalRoughMaterial. Change-Id: Ia52fe4608aca5558642599ed435f3cd9ac93e651 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QShaderLanguage to simplify protos and metal/roughKevin Ottens2017-09-042-41/+213
| | | | | | | | | | Thanks to those new enums and their support in the parameters system we can remove quite a few of the prototypes and give more expressivity in the material json files. Change-Id: I10780afca06c1c49e4bb99d90370abdc4c25919e Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Simplify node prototypes JSON using parametersKevin Ottens2017-09-042-35/+86
| | | | | | | | | Thanks to the parameters now being supported in the formats, we can simplify greatly the JSON file to have for instance a single sampleTexture prototype and not one prototype per possible texture name. Change-Id: I28f4f3e856f6cca0bbff579efb983bc13e0ea605 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-09-016-15/+48
|\ | | | | | | Change-Id: Ic4220f9957266c374f751d3612c60b81e9cea193
| * Doc: add doc to undocumented methods/propertiesNico Vertriest2017-08-304-11/+23
| | | | | | | | | | | | | | | | | | qmorphphongmaterial.h:57: warning: No documentation for 'Qt3DExtras::QMorphPhongMaterial::interpolator' qextrudedtextmesh.cpp: No documentation for 'Qt3DExtras::QExtrudedTextMesh::depth', ::font and ::text qextrudedtextgeometry.h:79: warning: No documentation for 'Qt3DExtras::QExtrudedTextGeometry::indexAttribute', ::normalAttribute and ::text Change-Id: Ib6bb0310be3b9e3a735bb90194a79dfb295c258b Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * Fix shader linking error on RPI/BRCMSergio Martins2017-08-251-3/+9
| | | | | | | | | | | | | | | | QOpenGLShader::link: ERROR:OPTIMIZER-3 (fragment shader, line 46) Support for for loops is restricted : right side of condition expression must be constant Task-number: QTBUG-59349 Change-Id: Id5806e597642e0805ef02fa1804ec4a9a8e4338c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Doc: add doc to undocumented methods qskyboxentity.cppNico Vertriest2017-08-211-1/+16
| | | | | | | | | | | | Change-Id: I3056be52f9203fbd99a3e5c01de71d79bafd2298 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Don't call deprecated QImage::byteSize() functionSean Harmer2017-08-221-1/+1
| | | | | | | | | | Change-Id: Ib2c1150e4612b378e5b04d0ea424f38af2c434c2 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* | Merge branch '5.9' into devSean Harmer2017-08-191-0/+19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/render/backend/renderer.cpp src/render/backend/renderview.cpp src/render/graphicshelpers/graphicscontext_p.h src/render/graphicshelpers/graphicshelperes2_p.h src/render/graphicshelpers/graphicshelpergl2_p.h src/render/graphicshelpers/graphicshelpergl3_2_p.h src/render/graphicshelpers/graphicshelpergl3_3_p.h src/render/graphicshelpers/graphicshelpergl4_p.h src/render/graphicshelpers/graphicshelperinterface_p.h src/render/jobs/pickboundingvolumejob.cpp tests/auto/animation/clipanimator/tst_clipanimator.cpp tests/auto/auto.pro tests/manual/manual.pro Also disabled the QQmlMetaType codepaths following commit 49a11e882059ee1729f776722e085dd21d378c36 in qtdeclarative. The QQmlMetaType codepaths will be re-enabled once a qt5.git integration has succeeded. Change-Id: Ia654d75425e6d406c472d19864383612208cad2b
| * Doc: add doc to undocumented methodsNico Vertriest2017-08-111-0/+19
| | | | | | | | | | | | | | | | - qtext2dentity.cpp - qabstractphysicaldevice.cpp Change-Id: I026ac031c366c979e17667c3635c1a391a5bba8a Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/devSean Harmer2017-07-116-24/+24
|\ \
| * | Merge remote-tracking branch 'origin/5.9' into devAndy Nichols2017-07-116-24/+24
| |\| | | | | | | | | | Change-Id: I4ceccd338a937a2ada231f568ed02c7a87bd6e80
| | * Apply slight z-offsets to distance field glyphsWieland Hagen2017-07-073-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | When rendering distance field text, z-fighting may occur between adjacent glyphs. To prevent this, we apply a very slight Z offset to each rendered glyph. Change-Id: I19f9808267547ae9521757c6022b4f65c1ca4ba5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| | * QTextureAtlas: pad sub-images with zeroes instead of border pixelsWieland Hagen2017-07-071-12/+11
| | | | | | | | | | | | | | | | | | | | | Fixes glitches in the distancefield text rendering Change-Id: If957904906025d7eeb974a8fa808f9e6fafd1b79 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| | * SkyboxEntity: Shaders should be usable by OpenGL 3.0Wieland Hagen2017-06-272-2/+2
| | | | | | | | | | | | | | | | | | Change-Id: Ia853e8e4eb2d13ec4805e79dad5f65b6fcf73cfc Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Introduce QSpriteSheetMike Krus2017-07-088-9/+640
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a generalised non-regular grid sprite sheet. Sprites are defined by a list of QSpriteSheetItem, essentially QRect for now (may introduce rotation later) Uses wrapper class to expose qml property list. Change-Id: I5a8d6804c32d59c27e1dc823c61d56bb169ca498 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Introduce QSpriteGridMike Krus2017-07-087-0/+669
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Takes a texture and a number of rows and columns. Uses a current index to compute a texture transform to map texture coordinates to a cell in the grid. Abstract base class to use in SpriteSheet which supports non regular grid sprite sheets (like a general atlas). Change-Id: Ia48bea22e2f687d8ae3ef1db4e41ae3c539e54d2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Port Metal/Rough materials to shader graphsKevin Ottens2017-07-0510-458/+542
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to validate the approach with a couple of functioning materials using the new shader generation system. Also allows to have a few prototypes in the default set of nodes. Clearly the system is still cumbersome to use as can be seen from the multiplication of prototypes, we shall improve that next by allowing more expressivity in the graph JSON to allow more control (clearly telling on the uniforms, return type for the functions, etc.). Change-Id: I3edfef65af288faa339661f20d5e640cf00e9234 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Add textureTransform to QTextureMaterialMike Krus2017-06-305-16/+51
|/ | | | | | | | | New property adds support for 3x3 matrix used to transform texture coordinates. Setting the existing textureOffset property will affect the new matrix. That matrix is now used in the shaders. Change-Id: I82778b048093e7e291c079e9d333a04a84c925f0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge branch '5.9.0' into 5.9Sean Harmer2017-05-209-250/+377
|\ | | | | | | Change-Id: Icb23dcb19d312559f5f4a71bde3dc26bf4a19408
| * Don't use seamless cubemap on GL <3.2Sean Harmer2017-05-171-2/+0
| | | | | | | | | | | | | | | | | | | | Otherwise it just floods with qWarning messages. This is only available on GL 3.2 or newer so only try it there. Task-number: QTBUG-60180 Change-Id: I8681c900ad5febc28a671305fa8c5d2e81662cab Reviewed-by: Oleg Evseev <ev.mipt@gmail.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * Ensure normal vector is normalized following interpolationSean Harmer2017-05-161-2/+4
| | | | | | | | | | | | | | | | | | Fixes "per-vertex" appearance of specular highlight in QMetalRoughMaterial. Task-number: QTBUG-60181 Change-Id: I03fd54ff997242fd987174d453642bd00076e26f Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
| * Match the Blinn-Phong specular power to be consistent with IBLSean Harmer2017-05-162-61/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | Use the same specular power as a function of roughness as used by Blinn-Phong in other engines and in Lys which is used to generate the image based lighting specular maps. During testing, noticed the specular highlight from punctual lights seems more like it's per-vertex based. Task-number: QTBUG-60181 Change-Id: Id379d59a5e1295c2cdf9bdabf246b7e0c0a9c499 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
| * Improve the roughness to mip level mappingSean Harmer2017-05-162-20/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We follow the approach used by Lys as detailed at: https://docs.knaldtech.com/doku.php?id=specular_lys Along with the perceptual linear roughness remapping as used by: UE4: http://graphicrants.blogspot.co.uk/2013/08/specular-brdf-reference.html Frostbite: http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf We should also check the punctual light implementation of Blinn Phong specular power based on the above references. Task-number: QTBUG-60181 Change-Id: I8ca6116d8d7847a8f200f366dcd11f693810608e Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
| * Fix speed regressions in ES2 shadersOleg Evseev2017-05-161-173/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The GLSL ES specification (up to at least 3.0) does not mandate support of dynamic indexing of uniform block arrays. For that reason loops in ES2 shaders were unrolled by calling separate functions, but it had leaded to rendering speed regressions. This patch reverts loops unrolling using separate functions and replaces dynamic indexing in place instead. Task-number: QTBUG-60183 Task-number: QTBUG-54994 Change-Id: Ieb036f442922de312b2941a0b8c511c0b4b3ec5a Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Oleg Evseev <ev.mipt@gmail.com>
| * Add a new mirrored property to QPlane(Mesh|Geometry)Kevin Ottens2017-05-055-7/+73
| | | | | | | | | | | | | | | | | | | | | | This is regularly necessary to be able to flip vertically the UV coordinates on the plane mesh depending if we are using a texture in model space coords or in window coords. Especially necessary now with Scene2D which outputs textures in window coords. This property is necessary to make it usable. Change-Id: I0fe7d3fdc125f1791492cf39ebe908bbc20f1db2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Fix build with QT_STRICT_ITERATORSSergio Martins2017-05-191-1/+1
| | | | | | | | | | | | | | | | Which also fixes potential bugs when comparing iterators from different containers in case a detach happens. Change-Id: I5e91f82177d46a0f06272035af837e8a8b196f81 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* | Implement PIMPL for Qt3DWindowJere Tuliniemi2017-05-154-51/+147
|/ | | | | | | | | | | | Added private members of Qt3DWindow to Qt3DWindowPrivate to hide implementation. m_aspectEngine is a normal pointer now so that it can be deleted from Qt3DWindow destructor. Screen connection happens after QWindow constructor now because it lacks a constructor that takes a d_ptr and a screen pointer. Task-number: QTBUG-60426 Change-Id: I08e431ec0ea570e5f2c5fb103bcf0fe16e1b23bc Reviewed-by: Antti Määttä <antti.maatta@qt.io>
* Fix -Werror=unused-parameter issueSean Harmer2017-04-271-1/+1
| | | | | Change-Id: Ibc77241e8d369224eda790b8dcfd900f330bed37 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Enable the seamless cubemap extension for SkyboxEntitySean Harmer2017-04-141-0/+5
| | | | | | | | Avoids nasty artifacts along cubemap face boundaries. Task-number: QTBUG-60180 Change-Id: I2fbc125efc0897526779eedaaabe5a9594315f9f Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Don't generate mips for skybox entity when using loaded textureSean Harmer2017-04-141-0/+1
| | | | | | | | | | | DDS file should contain mips if needed. This improves the start up time of applications using skybox entities a lot! I assume it was so slow because the mip generation had to be done on the CPU for cubemaps or because we're using compressed textures. Task-number: QTBUG-60182 Change-Id: I9760477063543b7be19bf98a94a65a1e62b8557a Reviewed-by: Mike Krus <mike.krus@kdab.com>