summaryrefslogtreecommitdiffstats
path: root/src/render/shaders
Commit message (Collapse)AuthorAgeFilesLines
* Add new material QPerVertexColorMaterialLorenz2015-03-116-0/+147
| | | | | | | | The new QPerVertexColorMaterial class provides color per vertex rendering. Change-Id: Idc87c21a07c2c8cd1ebfd5bed54c300c55e307ba Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Remove default uniform values for lightPosition and intensityLaszlo Agocs2015-02-0218-36/+36
| | | | | | | | | | | | The ES2 variants of the shaders have a default uniform value of 0. To be compatible with the other versions, start specifying the values for lightPosition and Intensity from C++, just like we already do from QML. This way the default values are coming from one single unified place regardless of the shader version in use, and examples like simple-cpp will work identically to simple-qml, even on ES2. Change-Id: If60185d0d3039e4354da8cc6e6b21a0db0bae963 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Supply ES2 versions of the default material shadersLaszlo Agocs2015-02-022-0/+39
| | | | | | | | | This also means that the building of the default material has to be delayed until the OpenGL context is known. Change-Id: I09c0db35a035cb1cfd16b564071445c2dcd4e53c Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Clean up GL2-ES2 shadersLaszlo Agocs2015-01-266-107/+101
| | | | | | | | | | | | | | | | | | | Unify light intensity in the phong material and shaders. The GL3 version had 1, 1, 1 whereas the other two used 1, 0, 1. The former is more sensible, so standardize on that. We also remove the default uniform values for GL2 and 3. The defaults are now coming from one central place in PhongMaterial.qml. All fragment shaders need to be revamped since these are common for OpenGL 2.0 and OpenGL ES 2.0. The only way to get something that compiles with both is to have the float/vecX precision qualifiers inline. This is in line with how ShaderEffect items work with Qt Quick. On non-ES Qt will dynamically add the necessary empty defines for highp etc. Remove also comments about uniform blocks (since it is not an option for ES2) and clean up the default values (which are coming from QML). Change-Id: If9862b4f2faf0b877da4032dcfcd123f259aa168 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Start fixing up the ES2 shadersLaszlo Agocs2015-01-2611-28/+18
| | | | | | | | | | | | | | | Version 120 is wrong. Everything must function with the default 100. Set the default precision in fragment shaders. Remove default uniform values. These will need some replacement on the C++ side. For the time being we just ignore it. This makes the shaders compiling at least. Change-Id: I0072c8a2027883f531413a48f680bb002c7f8222 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* Default cpp materials + material-cpp examplePaul Lemire2014-12-3119-1/+816
| | | | | | | | | | | | | | | | | | | | | QDiffuseMapMaterial QDiffuseSpecularMapMaterial QNormalDiffuseMapMaterial QNormalDiffuseAlphaMapMaterial QNormalDiffuseSpecularMapMaterial material-cpp is mostly inspired from materials (QML) but nicer :). Note: there seems to be an issue with qrc and QUrl. The behavior is different between QML and C++. -In C++ we need to prefix with have qrc:/ and convert that to :/ (passing :/ directly returns "" when QUrl toString is called) -From QML no prefix is needed. -For QImage path, :/ should be used. Change-Id: Ib56fb9546c95c2872686a46ed048a290ab4a5b6f Task-number: QTBUG-41548 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Added QPhongMaterialPaul Lemire2014-12-224-0/+126
| | | | | | | | | QPhongMaterial is a default phong lightning implementation to be used in Qt3D scenes created from C++. Supports OpenGL 3.1, 2.0 and ES 2.0 Change-Id: I6f57ccf7ae2264cd0110de2081de841406a5efc4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add an example demonstrating more materialsSean Harmer2014-11-139-0/+419
| | | | | | Change-Id: I02c17262812fbfbd94287a0449027d985a2fe7ae Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add rollerball example to show rendering and physics basicsSean Harmer2014-07-182-0/+64
| | | | | | | | At present it only exercises the renderer but it will be extended to also cover the physics aspect too. Change-Id: I83217f09eeb3471b8a508fa8a8948410ad1e1d58 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Automatic uniform bindingPaul Lemire2014-07-071-6/+6
| | | | | | | | | | | | | | | | | | 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>
* Relocate the render aspect outside of coreSean Harmer2014-03-294-0/+73
Change-Id: I636442d2d71342fd248b90674176cede895feab2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>