| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
It was still based on the old assumption that each entity will
have at most one light component only. This is not true anymore
so use the correct count.
Change-Id: I17d709aed60ec160062bacf1d9de30bea51f5d28
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>
|
|
|
|
|
| |
Change-Id: I42fab1c8d0cb225c6ba0ed14deb6a3b66498702f
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
|
|
|
|
|
|
|
|
| |
Probably long overdue. Remove unused variants and rename diffuse to
default.
Change-Id: Ib94f1ba448f8bbfb7b10c7e4ca8bb90b1111a284
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now with 100% more specular components.
Enable proper lights in the default material.
May break example since parameters like lightPosition,
lightIntensity and diffuse do not exist anymore.
The light calculation function is rearranged to have the diffuse
and specular colors as output parameters. This way the diffusemap,
diffusespecularmap, etc. materials can be migrated easily later on.
Change-Id: Id0c69467aaaf6865d554aa2c4f302df7aab6563c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
| |
Change-Id: I768d701656d29d99d74eedab08df0be9939f034e
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
| |
Change-Id: I60a36fe289991143e82ac89f44f4dfbc59e01355
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
|
|
| |
Equivalent to what the default material provides.
Change-Id: Id38deff0b341250b4d2befae75bd4d44f18daab0
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Assumes the following in the shaders:
const int MAX_LIGHTS = 8;
struct Light {
vec3 position;
... // properties from QLight and its subclasses
};
uniform Light lights[MAX_LIGHTS];
uniform int lightCount; // only when dynamic indexing is supported
Change-Id: I8f5e9c6718110594f220f79e81f48b48213555f2
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
| |
Change-Id: Ica74c5c1fe79a849dcd0dab8c57f47ea70311424
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QAbstractLight becomes QLight and gets its own backend node. This way we can
easily gather all lights for the scene and filter them when building render
commands.
Both the frontend and backend remain a subclass of (Q)ShaderData
but will not be part of the ordinary ShaderData component list. This
prevents mixing up ShaderDatas and Lights but allows reusing the same
underlying infrastructure so that properties can automatically be
transformed for example. It is worth noting that the position property for
lights is now removed: the position is determined by the entity's (to which
the light component belongs) position.
A number of changes are made to ShaderData itself as backend subclassing
with different managers is not straightforward.
For now the distance between the rendered entity and the entity with
the light component is calculated and lights will be chosen based on
this distance. A framegraph node for controlling this will be added
in future patches.
No uniform setting or shader changes are included here.
Task-number: QTBUG-48834
Change-Id: I43a6c5f9420d4254d798c558bd58680b2b09eceb
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
| |
Change-Id: I97908683dafe265f0d9f2e159362ee0c52488d7d
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
|
|
|
| |
On systems without VAO support the pointer is null. This is the case
of plain GLES2 systems, like the Raspberry Pi.
Change-Id: Id4b608ce0001c6d499c7c808182649bd14c485e0
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
|
|
|
|
|
| |
Change-Id: I366876f68040dd571524d9d7137a2f7916a5b757
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: Iacfcfce5d4a339acd29bcaacffb38ce339220ad2
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I662577e6dd337b1f056f73b4a11262e902d4dde2
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The goal is to make the Renderer a subclass of this interface. That way the
QRenderAspect can abstract all the rendering part, which will allow us to not
be tied down to the rendering technology.
We can imagine in a later step that we could add support for DirectX/Vulkan or
any other rendering API by just creating a new IRenderer implementation.
Change-Id: Ie3bd59f5d06c579da81b6e3553f26f1da765101f
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: Ie73abf79f4314d036c6abc353167528852390091
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
Will allow to retrive a vector of TriangleBoundingVolumes given a
GeometryRenderer/Geometry/Attributes and Buffers
Change-Id: Ieb1040b2c190ef2a8c03b92e2ecb8739832d7b43
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
|
|
|
|
|
| |
Change-Id: I0585281d2ba3e109b8ab8e45762e5101f7ea2163
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
|
|
|
|
|
| |
Change-Id: I3f2b3984a33db9e56cb6d5f4000b54fed37c0d75
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In some cases the VAO was being created but there wasn't any input
attributes specified on the shader at that time which skipped the
specification of the attributes in updateBuffersAndAttributes(). We now
track whether the VAO has been specified as part of the VAO object
itself.
This way, the first time the VAO is actually used to draw something we
can ensure the attributes have been specified.
Also skip the draw calls if the primitive count is zero.
Change-Id: Iad0a1cff4677ab33369057a6000f0f4a18dc5c58
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
|
|
|
|
|
| |
Change-Id: I7b4f96351ec889d4817762f7de6d6378eaf0e14a
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I82ed00b73595330df9a6b7b870433e5c919a99a0
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: Idec2f0ee5f3ace590421698293742932e8843aae
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
| |
Change-Id: I34625b2b8beab9b7bd5b2dde44666614c35632e7
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The transformations are applied in the following order:
1) Scale
2) Rotation
3) Translation
When we come to decompose this will be important.
Change-Id: I11e4b76f402fc0e9eef273d99f5975084400b4e1
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
| |
Change-Id: I76f3612d8d09060e09e6cd739751dcabcfd86a8f
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
| |
Change-Id: If6a5be9bbabd61da4464b1b1dd4b94551a8e5053
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I175a2bd4ed2ed59f070b8371495cc573941f1c1d
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I0580578ca27b8b32ddf3d8c29b5bab192e24c166
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I67866ea75e39a2c20b6422deb067c792cee9ff36
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I8d505034b24c3ec00b93ace02e5a4fe450939478
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
|
|
| |
The Renderer will have an instance of it so that the managing nodes part can
be removed from the Renderer class (should make it easier to test in the long
run).
Change-Id: Ia85833adff5d0bb383b6cb7bc44869141e1d4985
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Under some cases a VAO could be allocated but never created as at a given
point in time there was no attributes found for the current shader (which can
happen if the shader isn't yet loaded). Then the next frame, the attributes
would have been loaded and the VAO allocated and the renderer would assume
then that the VAO had been created. Eventually that would then crash as a draw
call would be performed with an empty and never created VAO.
Now check that a VAO is created and if not request creation to make sure that
the VAO is always created when setting the attributes/trying to draw.
Change-Id: Idf3fa45fabc574c0a0e82a38283c5848b32e15a4
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
|
|
|
|
|
|
| |
Change-Id: I338d55d8c6f81a55ecc61a247b9a1791bd25bb7d
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
| |
Change-Id: I404d35ff9e159d47c53660220cf5899b6df1cf89
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
| |
Change-Id: I33f0b1e01b20ffcf56fe0c758e07b99f410dba40
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
| |
Change-Id: I52d1e770855d402f0403baf159ef824204d2d947
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
| |
Change-Id: I6381480d080bb3160035b190d94a9593aad3d9ab
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
| |
Change-Id: Ifd869107ce102ed4b962d2be35f793e9c72a60d6
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
| |
Change-Id: I9f2442b49d825a36bef7036ee0893a17464bd73c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
Now Qt3D sceneloaders plugins follow the same pattern as the rest of Qt.
This also makes the loading much more standard and less error prone.
Change-Id: Ibb5aae0a16d9d197a9c34fe2885dd5435e68d7eb
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
|
|
|
|
|
|
|
| |
These includes seem to be left over from previous iterations.
Change-Id: I58945b72c354bfa8ebbe687d52d3eb146f021f70
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This API change is part of an effort to remove anything specific to one
graphics API (in this case OpenGL) from the public APIs. In addition to
the name of the class being changed, the QGraphicsApiFilter::Api has
been refactored to reference the Graphics API, rather than an OpenGL
API. Now this list includes OpenGL, and OpenGLES, but could also include
Vulkan, DirectX, or any other graphics rendering API we wish to support
in the future. Right now the properties in this class are still
reflective of the OpenGL APIs, and may need to be extended with other
properties in the future for other rendering technologies.
The QGraphicsApiFilter::Profile enum has also been changed to be more
more clear. So for now there are enums NoProfile, CoreProfile, and
CompatibilityProfile.
Task-number:QTBUG-49078
Change-Id: Ib5f9c3b7adee5badec6bce8a12b23683eb43b4cb
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
|
|
|
|
|
|
|
| |
Also remove some unnecessary includes.
Change-Id: I35539566e530f7800bbbe7884be65a93a7ee91eb
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
|
|
|
|
|
|
| |
Change-Id: I4ca133aebad0c088296ab293f95f0a6d76d18395
Task-number: QTBUG-39946
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously there was only and enable property for the QNode subclass
QComponent, but now all QNode subclasses should also have an enable
property. This means that it is now possible to disable a QEntity which
would also disable all of its children. This is a bit tricky though
because each Aspect needs to now check if the corresponding QEntities
are disabled or not before processing. This has been accounted for
with RenderEntity in the Renderer already, but will need to be respected
in each Aspect.
This behavior is similar to the Unity3D GameObject active property which
disabled the entity and disables all components.
Change-Id: I5233b2b43f04aa5dfa7910eac6a88a9da656a997
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
|
|
|
|
|
| |
Change-Id: I4982f08d18c855a57f621af28b13cc876f20eb16
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
|