2022-06-08 12:47:24 +00:00
|
|
|
// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
|
2024-02-23 14:41:04 +00:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
2014-09-04 14:54:05 +00:00
|
|
|
|
2016-05-07 14:33:52 +00:00
|
|
|
#ifndef GBUFFER_H
|
|
|
|
#define GBUFFER_H
|
2014-09-04 14:54:05 +00:00
|
|
|
|
2016-05-07 14:33:52 +00:00
|
|
|
#include <Qt3DRender/QRenderTarget>
|
|
|
|
#include <Qt3DRender/qtexture.h>
|
|
|
|
#include <Qt3DRender/QRenderTargetOutput>
|
2014-09-04 14:54:05 +00:00
|
|
|
|
2016-05-07 14:33:52 +00:00
|
|
|
class GBuffer : public Qt3DRender::QRenderTarget
|
2014-09-04 14:54:05 +00:00
|
|
|
{
|
2014-09-11 09:23:21 +00:00
|
|
|
public:
|
2016-05-07 14:33:52 +00:00
|
|
|
explicit GBuffer(Qt3DCore::QNode *parent = 0);
|
2014-09-04 14:54:05 +00:00
|
|
|
|
2016-05-07 14:33:52 +00:00
|
|
|
enum Attachments {
|
|
|
|
Color = 0,
|
|
|
|
Position,
|
|
|
|
Normal,
|
|
|
|
Depth,
|
|
|
|
AttachmentsCount
|
|
|
|
};
|
|
|
|
|
|
|
|
Qt3DRender::QAbstractTexture *colorTexture() const;
|
|
|
|
Qt3DRender::QAbstractTexture *positionTexture() const;
|
|
|
|
Qt3DRender::QAbstractTexture *normalTexture() const;
|
|
|
|
Qt3DRender::QAbstractTexture *depthTexture() const;
|
2014-09-04 14:54:05 +00:00
|
|
|
|
2014-09-11 09:23:21 +00:00
|
|
|
private:
|
2016-05-07 14:33:52 +00:00
|
|
|
Qt3DRender::QAbstractTexture *m_textures[AttachmentsCount];
|
2014-09-11 09:23:21 +00:00
|
|
|
};
|
2014-09-04 14:54:05 +00:00
|
|
|
|
2016-05-07 14:33:52 +00:00
|
|
|
#endif // GBUFFER_H
|