MNE-CPP  0.1.9
A Framework for Electrophysiology
pervertexphongalphamaterial.cpp
Go to the documentation of this file.
1 //=============================================================================================================
35 //=============================================================================================================
36 // INCLUDES
37 //=============================================================================================================
38 
40 
41 //=============================================================================================================
42 // QT INCLUDES
43 //=============================================================================================================
44 
45 #include <Qt3DRender/qshaderprogram.h>
46 #include <QUrl>
47 
48 //=============================================================================================================
49 // USED NAMESPACES
50 //=============================================================================================================
51 
52 using namespace DISP3DLIB;
53 using namespace Qt3DRender;
54 
55 //=============================================================================================================
56 // DEFINE MEMBER METHODS
57 //=============================================================================================================
58 
60 : AbstractPhongAlphaMaterial(bUseSortPolicy, parent)
61 , m_pVertexGL3Shader(new QShaderProgram())
62 , m_pVertexES2Shader(new QShaderProgram())
63 {
64  init();
65  setShaderCode();
66 }
67 
68 //=============================================================================================================
69 
70 void PerVertexPhongAlphaMaterial::setShaderCode()
71 {
72  m_pVertexGL3Shader->setVertexShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/engine/model/materials/shaders/gl3/pervertexphongalpha.vert"))));
73  m_pVertexGL3Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/engine/model/materials/shaders/gl3/pervertexphongalpha.frag"))));
74 
75  m_pVertexES2Shader->setVertexShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/engine/model/materials/shaders/es2/pervertexphongalpha.vert"))));
76  m_pVertexES2Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/engine/model/materials/shaders/es2/pervertexphongalpha.frag"))));
77 
78  addShaderToRenderPass(QStringLiteral("pVertexGL3RenderPass"), m_pVertexGL3Shader);
79  addShaderToRenderPass(QStringLiteral("pVertexGL2RenderPass"), m_pVertexES2Shader);
80  addShaderToRenderPass(QStringLiteral("pVertexES2RenderPass"), m_pVertexES2Shader);
81 }
82 
83 //=============================================================================================================
pervertexphongalphamaterial.h
PerVertexPhongAlphaMaterial class declaration.
DISP3DLIB::AbstractPhongAlphaMaterial::init
virtual void init()
Definition: abstractphongalphamaterial.cpp:108
DISP3DLIB::PerVertexPhongAlphaMaterial::PerVertexPhongAlphaMaterial
PerVertexPhongAlphaMaterial(bool bUseSortPolicy=false, Qt3DCore::QNode *parent=nullptr)
Definition: pervertexphongalphamaterial.cpp:59
DISP3DLIB::AbstractPhongAlphaMaterial
This abstract class is used as a base class for all materials that are using the phong alpha lightini...
Definition: abstractphongalphamaterial.h:84
DISP3DLIB::AbstractPhongAlphaMaterial::addShaderToRenderPass
virtual void addShaderToRenderPass(const QString &sObjectName, Qt3DRender::QShaderProgram *pShaderProgramm)
Definition: abstractphongalphamaterial.cpp:161