diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-11-23 15:27:48 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-11-26 17:36:04 +0000 |
commit | 653fdeb073a525a676bf0c12511c3f74bad2095e (patch) | |
tree | 9c4e2f2f29e63a12a0a0f7799235cad9b71c738e /src/quick3d/imports/render/qt3dquick3drenderplugin.cpp | |
parent | 1324668b1b77c865c90a1352a61b0b3da3da39b1 (diff) |
Lights phase 1: infrastructure
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>
Diffstat (limited to 'src/quick3d/imports/render/qt3dquick3drenderplugin.cpp')
-rw-r--r-- | src/quick3d/imports/render/qt3dquick3drenderplugin.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp b/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp index 16613f5d3..04999c9c8 100644 --- a/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp +++ b/src/quick3d/imports/render/qt3dquick3drenderplugin.cpp @@ -60,7 +60,7 @@ #include <Qt3DRender/qtorusmesh.h> #include <Qt3DRender/qlayer.h> #include <Qt3DRender/qlayerfilter.h> -#include <Qt3DRender/qabstractlight.h> +#include <Qt3DRender/qlight.h> #include <Qt3DRender/qspotlight.h> #include <Qt3DRender/qdirectionallight.h> #include <Qt3DRender/qpointlight.h> @@ -237,7 +237,7 @@ void Qt3DQuick3DRenderPlugin::registerTypes(const char *uri) qmlRegisterType<Qt3DRender::QLayerFilter>(uri, 2, 0, "LayerFilter"); // Lights - qmlRegisterUncreatableType<Qt3DRender::QAbstractLight>(uri, 2, 0, "QAbstractLight", QStringLiteral("QAbstractLight is abstract")); + qmlRegisterType<Qt3DRender::QLight>(uri, 2, 0, "Light"); qmlRegisterType<Qt3DRender::QPointLight>(uri, 2, 0, "PointLight"); qmlRegisterType<Qt3DRender::QDirectionalLight>(uri, 2, 0, "DirectionalLight"); qmlRegisterType<Qt3DRender::QSpotLight>(uri, 2, 0, "SpotLight"); |