QGIS API Documentation 3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
qgsambientocclusionblurentity.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsambientocclusionblurentity.cpp
3 --------------------------------------
4 Date : June 2022
5 Copyright : (C) 2022 by Belgacem Nedjima
6 Email : belgacem dot nedjima at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
17
18#include <QString>
19#include <Qt3DRender/QParameter>
20
21#include "moc_qgsambientocclusionblurentity.cpp"
22
23using namespace Qt::StringLiterals;
24
25QgsAmbientOcclusionBlurEntity::QgsAmbientOcclusionBlurEntity( Qt3DRender::QTexture2D *texture, Qt3DRender::QLayer *layer, QNode *parent )
26 : QgsRenderPassQuad( layer, parent )
27{
28 mAmbientOcclusionFactorTextureParameter = new Qt3DRender::QParameter( u"texture"_s, texture );
29 mMaterial->addParameter( mAmbientOcclusionFactorTextureParameter );
30
31 const QString vertexShaderPath = u"qrc:/shaders/ssao_factor_blur.vert"_s;
32 const QString fragmentShaderPath = u"qrc:/shaders/ssao_factor_blur.frag"_s;
33
34 mShader->setVertexShaderCode( Qt3DRender::QShaderProgram::loadSource( QUrl( vertexShaderPath ) ) );
35 mShader->setFragmentShaderCode( Qt3DRender::QShaderProgram::loadSource( QUrl( fragmentShaderPath ) ) );
36}
QgsAmbientOcclusionBlurEntity(Qt3DRender::QTexture2D *texture, Qt3DRender::QLayer *layer, QNode *parent=nullptr)
Constructor.
QgsRenderPassQuad(Qt3DRender::QLayer *layer, QNode *parent=nullptr)
Constructor.
Qt3DRender::QShaderProgram * mShader
Qt3DRender::QMaterial * mMaterial