| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As opposed to (mostly) camera space. Oops.
While somewhat hidden with point lights, the problem became apparent with
directional lights.
Now that we have proper directional lights, change the default light, that is
used when no light components are specified at all, from point to directional
since this is cheaper and provides less surprises with arbitrary scenes.
Also remove the duplicate phongalpha vertex shader in the process.
Change-Id: I295660a1400b16b69e1516672e31794312ee48d1
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
| |
Change-Id: I61a4e072c1a2e00cdbcee917aa557e56fb8cb7c0
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
| |
Change-Id: If57f6818fb6c40a9b88b7a2e91088e3daddb435e
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Having a dedicated type field is required not just to make the shaders
cleaner but also to avoid incorrect results when lights get moved around in
the scene. Currently the shaders rely on the direction uniform to distinguish
directional lights from the others, but this cannot work when the elements
in the lights uniform array change, potentially leaving type-specific members
like direction set when a point light takes the same index.
Change-Id: I170e4b471c8cd9b4a23eca49690239c01944b3e6
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The interpretation of lightDir was different for point and directional
lights: it was surface-to-light for point lights, but light-to-surface
for directional.
Fix this by getting rid of lightDir and instead setting up s (surface-to-light)
correctly.
Change-Id: I0bc6947dc94622d7a95f55fd65b3baf43fd11528
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
|
|
|
|
|
| |
Remove duplicated vertex shaders in the process.
[normal]diffusespecularmap.vert is the same as [normal]diffusemap.vert
hence there is no need for the former.
Change-Id: If448005c593c765551ca239af6789df2f6e53af6
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
| |
Change-Id: I91a6db87836c0e37af10d8de90e431240a7851e2
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
| |
On the ES2 path only the first light is taken into account for now.
Change-Id: Ia8974bedddaa43539563149e718284076a519b5e
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
|
|
|
|
|
| |
Change-Id: Ie082b7885e4465181c8c38e17bf0ce17543154b9
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
|
|
|
|
|
| |
Change-Id: I692e7ad9cdd63c2098e799c41937b2a4440f9c70
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
|
|
|
|
|
|
|
|
| |
The original version has no specular component so leave that out
in this version as well. To make this simple, introduce adModel().
Change-Id: I474485a19163ec55e6f6e025d94d8172297e847c
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
|
|
|
|
|
| |
Change-Id: I2cde7e7aca754efb8a0ca4bb81716e6b42169e62
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
| |
Change-Id: I79cac9384a258bfd3e106beba1aebb44c5f15491
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
|
|
|
| |
The old name is more future proof since we may get an adModel()
function too later on.
Change-Id: I2dc14c26e14f5afc4217727589e18b1774727a2d
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
|
|
| |
This also means that (Q)PhongMaterial is now lights capable.
Change-Id: I8191fa6dfe96dadafdc9a2db47066650a8c96ee6
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
However, take only the first light into account in order to keep pure
ES2 devices working. We will need to figure something out later.
NB this leads to a funny but totally correct effect in examples with
multiple animated lights since the light that is taken into account is
the one closest to the center of the lit entity.
Change-Id: If2ad7c0bd5db177e48d763e1e1c86e65add45c8d
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
|
|
|
| |
Probably long overdue. Remove unused variants and rename diffuse to
default.
Change-Id: Ib94f1ba448f8bbfb7b10c7e4ca8bb90b1111a284
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is useful for backgrounds or other simple texturing use cases
where lighting is not desired.
Also includes a texture coordinate offset property so the texture
coordinates can easily be animated.
C++ version to follow later.
Change-Id: I8f6eba1ce28402bf59a18989884640018f473320
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
|
|
|
|
|
|
|
| |
cpp version to follow
Change-Id: I7d6f48f6c9b54810fb127dfe6371ede026f129bf
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
|
|
| |
Edge inking will come later. So many techniques to choose from.
Change-Id: Ibbea66c09c158bebba5d8efaf08d18417fa9b161
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
|
|
|
|
|
|
|
| |
Cpp classes to follow
Change-Id: If2479917aa516cf5da37111ae6a5886a8e24e9e7
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
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>
|