Commit d02167ed authored by Sylvain Thery's avatar Sylvain Thery

remove clipping using std::regex for gcc 4.8 (see volumeExplorer for clippig topo)

parent 001acd3b
......@@ -14,7 +14,7 @@ add_executable( frame_manip frame_manip.cpp ${frame_manip_moc} )
target_link_libraries( frame_manip ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
#need to define that we use Qt (only once per cmake directory!)
qt_use_cgogn_modules(frame_manip)
qt_wrap_cpp( texturesExample_moc texturesExample.h )
add_executable( texturesExample texturesExample.cpp ${texturesExample_moc} )
target_link_libraries( texturesExample ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
......@@ -40,10 +40,12 @@ qt_wrap_cpp( viewer_moc viewer.h )
add_executable( viewer viewer.cpp ${viewer_moc} ${viewer_ui} )
target_link_libraries( viewer ${CGoGN_LIBS} ${NUMERICAL_LIBS} ${CGoGN_EXT_LIBS} )
qt_wrap_ui( clipping_ui clipping.ui )
qt_wrap_cpp( clipping_moc clipping.h )
add_executable( clipping clipping.cpp ${clipping_ui} ${clipping_moc} )
target_link_libraries( clipping ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
IF (CGoGN_GCC_4_9)
qt_wrap_ui( clipping_ui clipping.ui )
qt_wrap_cpp( clipping_moc clipping.h )
add_executable( clipping clipping.cpp ${clipping_ui} ${clipping_moc} )
target_link_libraries( clipping ${CGoGN_LIBS} ${CGoGN_EXT_LIBS} )
ENDIF()
qt_wrap_ui( volumeExplorer_ui volumeExplorer.ui )
qt_wrap_cpp( volumeExplorer_moc volumeExplorer.h )
......
......@@ -73,16 +73,12 @@ void MyQT::clipping_onoff(bool x)
Geom::Vec3f normal = m_PlanePick->getAxisScale(2, pipo); // 2 = Z axis = plane normal
float d = -(pos*normal);
m_explode_render->setClippingPlane(Geom::Vec4f(normal[0],normal[1],normal[2],d));
m_sh1->setClipPlaneParamsAll(clip_id1, normal, pos);
m_sh2->setClipPlaneParamsAll(clip_id2, normal, pos);
m_topo_render->setClippingPlane(Geom::Vec4f(normal[0],normal[1],normal[2],d));
}
else
{
m_explode_render->setNoClippingPlane();
m_sh1->setClipPlaneParamsAll(clip_id1, Geom::Vec3f(0,0,1), Geom::Vec3f(0,0,999999.9f));
m_sh2->setClipPlaneParamsAll(clip_id2, Geom::Vec3f(0,0,1), Geom::Vec3f(0,0,999999.9f));
m_sh1->setClipColorAttenuationFactorRelative(0.0f,0.0f);
m_sh2->setClipColorAttenuationFactorRelative(0.0f,0.0f);
m_topo_render->setNoClippingPlane();
}
updateGL();
}
......@@ -206,7 +202,7 @@ void MyQT::cb_initGL()
{
// create the renders
m_topo_render = new Algo::Render::GL2::Topo3RenderMap<PFP>();
m_explode_render = new Algo::Render::GL2::ExplodeVolumeRender(true,true,true);
m_explode_render = new Algo::Render::GL2::ExplodeVolumeRender(true,true,true);
// SelectorDartNoBoundary<MAP> nb(myMap);
m_topo_render->updateData(myMap, position, 0.8f, 0.8f, 0.8f);
......@@ -217,8 +213,6 @@ void MyQT::cb_initGL()
m_explode_render->setBackColor(Geom::Vec4f(0.9f,0.9f,0.9f,1.0f));
m_explode_render->setColorLine(Geom::Vec4f(0.8f,0.2f,0.2f,1.0f));
m_sh1 = static_cast<Utils::ClippingShader*>(m_topo_render->shader1());
m_sh2 = static_cast<Utils::ClippingShader*>(m_topo_render->shader2());
registerShader(m_explode_render->shaderFaces());
registerShader(m_explode_render->shaderLines());
......@@ -227,15 +221,6 @@ void MyQT::cb_initGL()
m_frame = new Utils::FrameManipulator();
m_frame->setSize(m_WidthObj/2.0f);
m_sh1->insertClippingCode();
m_sh2->insertClippingCode();
clip_id1 = m_sh1->addClipPlane();
clip_id2 = m_sh2->addClipPlane();
m_sh1->setClipPlaneParamsAll(clip_id1, Geom::Vec3f(0,0,1), m_PosObj);
m_sh2->setClipPlaneParamsAll(clip_id2, Geom::Vec3f(0,0,1), m_PosObj);
m_explode_render->setClippingPlane(Geom::Vec4f(0,0,1,m_PosObj*Geom::Vec3f(0,0,-1)));
}
......@@ -370,9 +355,8 @@ void MyQT::cb_mouseMove(int buttons, int x, int y)
Geom::Vec3f normal = m_PlanePick->getAxisScale(2, pipo); // 2 = Z axis = plane normal
float d = -(pos*normal);
m_explode_render->setClippingPlane(Geom::Vec4f(normal[0],normal[1],normal[2],d));
m_topo_render->setClippingPlane(Geom::Vec4f(normal[0],normal[1],normal[2],d));
m_sh1->setClipPlaneParamsAll(clip_id1, normal, pos);
m_sh2->setClipPlaneParamsAll(clip_id2, normal, pos);
m_begX = x;
m_begY = y;
......@@ -484,28 +468,6 @@ int main(int argc, char **argv)
dock.slider_explode_face->setValue(100);
sqt.clipping_onoff(true);
// Utils::Chrono ch;
// ch.start();
// float vol = Algo::Geometry::Parallel::totalVolume<PFP>(myMap, position);
// vol += Algo::Geometry::Parallel::totalVolume<PFP>(myMap, position);
// vol += Algo::Geometry::Parallel::totalVolume<PFP>(myMap, position);
// vol += Algo::Geometry::Parallel::totalVolume<PFP>(myMap, position);
// std::cout << ch.elapsed()<< " ms // val="<<vol<< std::endl;
// std::cout << "Compute Volume ->"<< std::endl;
// ch.start();
// vol = Algo::Geometry::totalVolume<PFP>(myMap, position);
// std::cout << ch.elapsed()<< " ms val="<<vol<< std::endl;
// ch.start();
// vol += Algo::Geometry::totalVolume<PFP>(myMap, position);
// std::cout << ch.elapsed()<< " ms val="<<vol<< std::endl;
// ch.start();
// vol += Algo::Geometry::totalVolume<PFP>(myMap, position);
// std::cout << ch.elapsed()<< " ms val="<<vol<< std::endl;
// ch.start();
// vol += Algo::Geometry::totalVolume<PFP>(myMap, position);
// std::cout << ch.elapsed()<< " ms val="<<vol<< std::endl;
// et on attend la fin.
return app.exec();
}
......@@ -93,8 +93,8 @@ class MyQT: public Utils::QT::SimpleQGLV
int clip_id2;
// shader of toporender3
Utils::ClippingShader* m_sh1;
Utils::ClippingShader* m_sh2;
// Utils::ClippingShader* m_sh1;
// Utils::ClippingShader* m_sh2;
Utils::Chrono m_frame_ch;
unsigned int m_nbFrames;
......
......@@ -158,6 +158,10 @@ public:
Utils::GLSLShader* shader1() { return static_cast<Utils::GLSLShader*>(m_shader1); }
Utils::GLSLShader* shader2() { return static_cast<Utils::GLSLShader*>(m_shader2); }
void setClippingPlane(const Geom::Vec4f& plane);
void setNoClippingPlane();
/**
* set the with of line use to draw darts (default val is 2)
* @param dw width
......
......@@ -71,8 +71,8 @@ Topo3Render<PFP>::Topo3Render():
m_vbo3->setDataSize(3);
m_vbo4->setDataSize(3);
m_shader1 = new Utils::ShaderSimpleColor();
m_shader2 = new Utils::ShaderColorPerVertex();
m_shader1 = new Utils::ShaderSimpleColor(true,false);
m_shader2 = new Utils::ShaderColorPerVertex(true,false);
// binding VBO - VA
m_vaId = m_shader1->setAttributePosition(m_vbo1);
......@@ -109,6 +109,22 @@ Topo3Render<PFP>::~Topo3Render()
delete[] m_bufferDartPosition;
}
template<typename PFP>
void Topo3Render<PFP>::setClippingPlane(const Geom::Vec4f& plane)
{
m_shader1->setClippingPlane(plane);
m_shader2->setClippingPlane(plane);
}
template<typename PFP>
void Topo3Render<PFP>::setNoClippingPlane()
{
this->setClippingPlane(Geom::Vec4f(0.0f,0.0f,0.0f,0.0f));
}
template<typename PFP>
void Topo3Render<PFP>::setDartWidth(float dw)
{
......
......@@ -148,6 +148,10 @@ public:
Utils::GLSLShader* shader1() { return static_cast<Utils::GLSLShader*>(m_shader1); }
Utils::GLSLShader* shader2() { return static_cast<Utils::GLSLShader*>(m_shader2); }
void setClippingPlane(const Geom::Vec4f& plane);
void setNoClippingPlane();
/**
* set the with of line use to draw darts (default val is 2)
* @param dw width
......
......@@ -62,8 +62,8 @@ TopoPrimalRender<PFP>::TopoPrimalRender():
m_vbo1->setDataSize(3);
m_vbo2->setDataSize(3);
m_shader1 = new Utils::ShaderSimpleColor();
m_shader2 = new Utils::ShaderColorPerVertex();
m_shader1 = new Utils::ShaderSimpleColor(true,false);
m_shader2 = new Utils::ShaderColorPerVertex(true,false);
// binding VBO - VA
m_vaId = m_shader1->setAttributePosition(m_vbo1);
......@@ -98,6 +98,20 @@ TopoPrimalRender<PFP>::~TopoPrimalRender()
delete[] m_bufferDartPosition;
}
template<typename PFP>
void TopoPrimalRender<PFP>::setClippingPlane(const Geom::Vec4f& plane)
{
m_shader1->setClippingPlane(plane);
m_shader2->setClippingPlane(plane);
}
template<typename PFP>
void TopoPrimalRender<PFP>::setNoClippingPlane()
{
this->setClippingPlane(Geom::Vec4f(0.0f,0.0f,0.0f,0.0f));
}
template <typename PFP>
void TopoPrimalRender<PFP>::setDartWidth(float dw)
{
......
......@@ -177,6 +177,10 @@ public:
*/
~TopoGenRender();
void setClippingPlane(const Geom::Vec4f& plane);
void setNoClippingPlane();
/**
* set the with of line use to draw darts (default val is 2)
* @param dw width
......
......@@ -43,6 +43,8 @@ protected:
// shader sources
static std::string vertexShaderText;
static std::string fragmentShaderText;
static std::string vertexShaderClipText;
static std::string fragmentShaderClipText;
VBO* m_vboPos;
VBO* m_vboCol;
......@@ -50,10 +52,15 @@ protected:
CGoGNGLuint m_unif_alpha;
float m_opacity;
/// clipping
CGoGNGLuint m_unif_planeClip;
Geom::Vec4f m_planeClip;
void restoreUniformsAttribs();
public:
ShaderColorPerVertex(bool black_is_transparent = false);
ShaderColorPerVertex(bool withClipping = false, bool black_is_transparent = false);
/**
* set the VBO of position (vec3)
......@@ -71,6 +78,8 @@ public:
void setOpacity(float op);
float getOpacity() const { return m_opacity;}
void setClippingPlane(const Geom::Vec4f& plane);
};
} // namespace Utils
......
// ShaderColorPerVertex::fragmentShaderClipText
PRECISION;
VARYING_FRAG vec3 color;
VARYING_FRAG vec3 posClip;
uniform vec4 planeClip;
uniform float alpha;
FRAG_OUT_DEF;
void main()
{
if (dot(planeClip,vec4(posClip,1.0))>0.0)
discard;
#ifdef BLACK_TRANSPARENCY
if (dot(color,color) == 0.0)
discard;
#endif
FRAG_OUT=vec4(color,alpha);
}
// ShaderColorPerVertex::vertexShaderClipText
ATTRIBUTE vec3 VertexPosition;
ATTRIBUTE vec3 VertexColor;
uniform mat4 ModelViewProjectionMatrix;
VARYING_VERT vec3 color;
VARYING_VERT vec3 posClip;
INVARIANT_POS;
void main ()
{
posClip = VertexPosition;
color = VertexColor;
gl_Position = ModelViewProjectionMatrix * vec4 (VertexPosition, 1.0);
}
......@@ -43,22 +43,30 @@ protected:
// shader sources
static std::string vertexShaderText;
static std::string fragmentShaderText;
static std::string vertexShaderClipText;
static std::string fragmentShaderClipText;
// uniform locations
/// color
CGoGNGLuint m_unif_color;
Geom::Vec4f m_color;
/// clipping
CGoGNGLuint m_unif_planeClip;
Geom::Vec4f m_planeClip;
VBO* m_vboPos;
void restoreUniformsAttribs();
public:
ShaderSimpleColor(bool back_is_transparent = false);
ShaderSimpleColor(bool withClipping = false, bool back_is_transparent = false);
void setColor(const Geom::Vec4f& color);
unsigned int setAttributePosition(VBO* vbo);
void setClippingPlane(const Geom::Vec4f& plane);
};
} // namespace Utils
......
// ShaderSimpleColor::fragmentShaderClipText
PRECISION;
uniform vec4 color;
uniform vec4 planeClip;
VARYING_FRAG vec3 posClip;
FRAG_OUT_DEF;
void main()
{
if (dot(planeClip,vec4(posClip,1.0))>0.0)
discard;
#ifdef BLACK_TRANSPARENCY
if (dot(color,color) == 0.0)
discard;
#endif
FRAG_OUT=color;
}
// ShaderSimpleColor::vertexShaderClipText
ATTRIBUTE vec3 VertexPosition, VertexNormal;
uniform mat4 ModelViewProjectionMatrix;
VARYING_VERT vec3 posClip;
void main ()
{
posClip = VertexPosition;
gl_Position = ModelViewProjectionMatrix * vec4 (VertexPosition, 1.0);
}
......@@ -66,7 +66,7 @@ TopoGenRender::TopoGenRender(float bs):
m_vbo1->setDataSize(3);
m_vbo2->setDataSize(3);
m_shader1 = new Utils::ShaderSimpleColor();
m_shader1 = new Utils::ShaderSimpleColor(true,false);
// binding VBO - VA
m_vaId = m_shader1->setAttributePosition(m_vbo1);
......@@ -135,6 +135,19 @@ TopoGenRender::~TopoGenRender()
void TopoGenRender::setClippingPlane(const Geom::Vec4f& plane)
{
m_shader1->setClippingPlane(plane);
}
void TopoGenRender::setNoClippingPlane()
{
this->setClippingPlane(Geom::Vec4f(0.0f,0.0f,0.0f,0.0f));
}
void TopoGenRender::setDartWidth(float dw)
{
m_topo_dart_width = dw;
......
......@@ -33,46 +33,49 @@ namespace Utils
#include "shaderColorPerVertex.vert"
#include "shaderColorPerVertex.frag"
#include "shaderColorPerVertexClip.vert"
#include "shaderColorPerVertexClip.frag"
//std::string ShaderColorPerVertex::vertexShaderText =
// "ATTRIBUTE vec3 VertexPosition;\n"
// "ATTRIBUTE vec3 VertexColor;\n"
// "uniform mat4 ModelViewProjectionMatrix;\n"
// "VARYING_VERT vec3 color;\n"
// "INVARIANT_POS;\n"
// "void main ()\n"
// "{\n"
// " gl_Position = ModelViewProjectionMatrix * vec4 (VertexPosition, 1.0);\n"
// " color = VertexColor;\n"
// "}";
//
//
//std::string ShaderColorPerVertex::fragmentShaderText =
// "PRECISION;\n"
// "VARYING_FRAG vec3 color;\n"
// "FRAG_OUT_DEF;\n"
// "void main()\n"
// "{\n"
// " FRAG_OUT=vec4(color,0.0);\n"
// "}";
ShaderColorPerVertex::ShaderColorPerVertex(bool black_is_transparent)
ShaderColorPerVertex::ShaderColorPerVertex(bool withClipping, bool black_is_transparent)
{
m_nameVS = "ShaderColorPerVertex_vs";
m_nameFS = "ShaderColorPerVertex_fs";
m_nameGS = "ShaderColorPerVertex_gs";
if (withClipping)
{
m_nameVS = "ShaderColorPerVertexClip_vs";
m_nameFS = "ShaderColorPerVertexClip_fs";
m_nameGS = "";
std::string glxvert(*GLSLShader::DEFINES_GL);
glxvert.append(vertexShaderClipText);
std::string glxfrag(*GLSLShader::DEFINES_GL);
if (black_is_transparent)
glxfrag.append("#define BLACK_TRANSPARENCY 1\n");
glxfrag.append(fragmentShaderClipText);
loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str());
std::string glxvert(*GLSLShader::DEFINES_GL);
glxvert.append(vertexShaderText);
*m_unif_planeClip = glGetUniformLocation(this->program_handler(),"planeClip");
setClippingPlane(Geom::Vec4f (0.0f, 0.0f, 0.0f, 0.0f));
std::string glxfrag(*GLSLShader::DEFINES_GL);
if (black_is_transparent)
glxfrag.append("#define BLACK_TRANSPARENCY 1\n");
glxfrag.append(fragmentShaderText);
}
else
{
m_nameVS = "ShaderColorPerVertex_vs";
m_nameFS = "ShaderColorPerVertex_fs";
m_nameGS = "ShaderColorPerVertex_gs";
loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str());
std::string glxvert(*GLSLShader::DEFINES_GL);
glxvert.append(vertexShaderText);
std::string glxfrag(*GLSLShader::DEFINES_GL);
if (black_is_transparent)
glxfrag.append("#define BLACK_TRANSPARENCY 1\n");
glxfrag.append(fragmentShaderText);
loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str());
}
bind();
*m_unif_alpha = glGetUniformLocation(this->program_handler(), "alpha");
glUniform1f (*m_unif_alpha, 1.0f);
......@@ -99,12 +102,14 @@ unsigned int ShaderColorPerVertex::setAttributeColor(VBO* vbo)
return id;
}
void ShaderColorPerVertex::restoreUniformsAttribs()
{
bind();
bindVA_VBO("VertexPosition", m_vboPos);
bindVA_VBO("VertexColor", m_vboCol);
glUniform1f (*m_unif_alpha, m_opacity);
glUniform4fv(*m_unif_planeClip, 1, m_planeClip.data());
unbind();
}
......@@ -116,6 +121,16 @@ void ShaderColorPerVertex::setOpacity(float op)
unbind();
}
void ShaderColorPerVertex::setClippingPlane(const Geom::Vec4f& plane)
{
m_planeClip = plane;
bind();
glUniform4fv(*m_unif_planeClip, 1, plane.data());
unbind();
}
} // namespace Utils
} // namespace CGoGN
......@@ -32,47 +32,53 @@ namespace Utils
#include "shaderSimpleColor.vert"
#include "shaderSimpleColor.frag"
#include "shaderSimpleColorClip.vert"
#include "shaderSimpleColorClip.frag"
//std::string ShaderSimpleColor::vertexShaderText =
// "ATTRIBUTE vec3 VertexPosition, VertexNormal;\n"
// "uniform mat4 ModelViewProjectionMatrix;\n"
//// "INVARIANT_POS;\n"
// "void main ()\n"
// "{\n"
// " gl_Position = ModelViewProjectionMatrix * vec4 (VertexPosition, 1.0);\n"
// "}";
//
//
//std::string ShaderSimpleColor::fragmentShaderText =
// "PRECISION;\n"
// "uniform vec4 color;\n"
// "FRAG_OUT_DEF;\n"
// "void main()\n"
// "{\n"
// " FRAG_OUT = color;\n"
// "}";
ShaderSimpleColor::ShaderSimpleColor(bool black_is_transparent)
{
m_nameVS = "ShaderSimpleColor_vs";
m_nameFS = "ShaderSimpleColor_fs";
m_nameGS = "ShaderSimpleColor_gs";
// chose GL defines (2 or 3)
// and compile shaders
std::string glxvert(*GLSLShader::DEFINES_GL);
glxvert.append(vertexShaderText);
std::string glxfrag(*GLSLShader::DEFINES_GL);
if (black_is_transparent)
glxfrag.append("#define BLACK_TRANSPARENCY 1\n");
glxfrag.append(fragmentShaderText);
loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str());
ShaderSimpleColor::ShaderSimpleColor(bool withClipping, bool black_is_transparent)
{
if (withClipping)
{
m_nameVS = "ShaderSimpleColorClip_vs";
m_nameFS = "ShaderSimpleColorClip_fs";
m_nameGS = "";
// chose GL defines (2 or 3)
// and compile shaders
std::string glxvert(*GLSLShader::DEFINES_GL);
glxvert.append(vertexShaderClipText);
std::string glxfrag(*GLSLShader::DEFINES_GL);
if (black_is_transparent)
glxfrag.append("#define BLACK_TRANSPARENCY 1\n");
glxfrag.append(fragmentShaderClipText);
loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str());
*m_unif_planeClip = glGetUniformLocation(this->program_handler(),"planeClip");
setClippingPlane(Geom::Vec4f (0.0f, 0.0f, 0.0f, 0.0f));
}
else
{
m_nameVS = "ShaderSimpleColor_vs";
m_nameFS = "ShaderSimpleColor_fs";
m_nameGS = "";
// chose GL defines (2 or 3)
// and compile shaders
std::string glxvert(*GLSLShader::DEFINES_GL);
glxvert.append(vertexShaderText);
std::string glxfrag(*GLSLShader::DEFINES_GL);
if (black_is_transparent)
glxfrag.append("#define BLACK_TRANSPARENCY 1\n");
glxfrag.append(fragmentShaderText);
loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str());
}
*m_unif_color = glGetUniformLocation(this->program_handler(),"color");
//Default values
Geom::Vec4f color(0.1f, 0.9f, 0.1f, 0.0f);
setColor(color);
......@@ -86,6 +92,16 @@ void ShaderSimpleColor::setColor(const Geom::Vec4f& color)
unbind();
}
void ShaderSimpleColor::setClippingPlane(const Geom::Vec4f& plane)
{
m_planeClip = plane;
bind();
glUniform4fv(*m_unif_planeClip, 1, plane.data());
unbind();
}
unsigned int ShaderSimpleColor::setAttributePosition(VBO* vbo)
{
m_vboPos = vbo;
......@@ -100,6 +116,7 @@ void ShaderSimpleColor::restoreUniformsAttribs()
*m_unif_color = glGetUniformLocation(this->program_handler(), "color");
bind();
glUniform4fv(*m_unif_color, 1, m_color.data());
glUniform4fv(*m_unif_planeClip, 1, m_planeClip.data());
bindVA_VBO("VertexPosition", m_vboPos);
unbind();
}
......
......@@ -38,6 +38,8 @@ namespace Utils
*
***********************************************/
#ifdef CGOGN_GCC_4_9
ShaderMutator::ShaderMutator(const std:: string& shaderName, const std::string& vertShaderSrc, const std::string& fragShaderSrc, const std::string& geomShaderSrc)
{
......@@ -780,6 +782,106 @@ bool ShaderMutator::srcInsertCodeAtMainFunctionEnd(const std::string& insertedCo
return true;
}
#else
ShaderMutator::ShaderMutator(const std:: string& /*shaderName*/, const std::string& /*vertShaderSrc*/, const std::string& /*fragShaderSrc*/, const std::string& /*geomShaderSrc*/)
{
}
bool ShaderMutator::containsVariableDeclaration(shaderSrcType /*srcType*/, const std::string& /*variableName*/)
{
bool result = false;
return result;
}
bool ShaderMutator::setMinShadingLanguageVersion(shaderSrcType /*srcType*/, int /*version*/)
{
bool result = false;
return result;
}
bool ShaderMutator::changeIntConstantValue(shaderSrcType /*srcType*/, const std::string& /*constantName*/, int /*newVal*/)
{
return true;
}
bool ShaderMutator::changeFloatConstantValue(shaderSrcType /*srcType*/, const std::string& /*constantName*/, float /*newVal*/)
{
return true;
}
bool ShaderMutator::insertCodeBeforeMainFunction(shaderSrcType /*srcType*/, const std::string& /*insertedCode*/)
{
return true;
}
bool ShaderMutator::insertCodeAtMainFunctionBeginning(shaderSrcType /*srcType*/, const std::string& /*insertedCode*/)
{
return true;
}
bool ShaderMutator::insertCodeAtMainFunctionEnd(shaderSrcType /*srcType*/, const std::string& /*insertedCode*/)
{
return true;
}
/***********************************************
*
* Private Section
*
***********************************************/
bool ShaderMutator::srcIsCommented(size_t /*pos*/, const std::string& /*src*/)
{
return false;
}
bool ShaderMutator::srcIsOneLineCommented(size_t /*pos*/, const std::string& /*src*/)
{
return false;
}
bool ShaderMutator::srcContainsVariableDeclaration(const std::string& /*variableName*/, std::string& /*src*/)
{
return false;
}
bool ShaderMutator::srcSetMinShadingLanguageVersion(int /*version*/, std::string& /*modifiedSrc*/)
{