Commit f34546ec authored by Maire Nicolas's avatar Maire Nicolas

Clipping avec sections de plans supprimé, le code devenait trop bordelique. ->...

Clipping avec sections de plans supprimé, le code devenait trop bordelique. -> Rajouter ça en tant que clipping différent, comme les spheres.
Un peu plus de cleanup dans shaderMutator.
parent cb3bcd83
......@@ -115,17 +115,6 @@ public:
*/
Geom::Vec3f getClipPlaneOrigin(int planeIndex = 0);
/**
* set the color attenuation factor for clipping
* @param colorAttenuationFactor color attenuation factor
*/
void setClipColorAttenuationFactor(float colorAttenuationFactor);
/**
* get the color attenuation factor for clipping
*/
float getClipColorAttenuationFactor() { return m_colorAttenuationFactor; }
/**
* set the clip planes count
* - inserts plane clipping instructions into vertex and fragment shader source code
......@@ -140,11 +129,6 @@ public:
*/
int getClipPlanesCount() { return (int)m_clipPlanes.size(); }
/**
* update uniforms (get their locations and send their values again) for clipping
*/
void updateClippingUniforms();
/**
* display all clipping planes
*/
......@@ -198,13 +182,29 @@ public:
* set the planes display size
* @param size the new size
*/
void setPlaneDisplaySize(float size) { m_clipPlanesDisplaySize = size;sendClippingPlanesUniform();updateAllClippingPlanesVBOs(); }
void setPlaneDisplaySize(float size) { m_clipPlanesDisplaySize = size;/*sendClippingPlanesUniform();*/updateAllClippingPlanesVBOs(); }
/**
* get the planes display size
*/
float getPlaneDisplaySize() { return m_clipPlanesDisplaySize; }
/**
* set the color attenuation factor for clipping
* @param colorAttenuationFactor color attenuation factor
*/
void setClipColorAttenuationFactor(float colorAttenuationFactor);
/**
* get the color attenuation factor for clipping
*/
float getClipColorAttenuationFactor() { return m_colorAttenuationFactor; }
/**
* update uniforms (get their locations and send their values again) for clipping
*/
void updateClippingUniforms();
private:
......@@ -230,7 +230,7 @@ private:
* update clip planes parameters arrays
* @param planeIndex index of the plane
*/
void updateClippingPlanesArrays(int planeIndex);
void updateClippingPlaneArray(int planeIndex);
/**
* update VBO for one plane
......@@ -264,48 +264,10 @@ private:
*/
std::vector<float> m_clipPlanesEquations;
/**
* clip planes first vectors array (size = 3*(planes count))
* - ** only used for sending planes data to shader **
*/
std::vector<float> m_clipPlanesFirstVectors;
/**
* clip planes second vectors array (size = 3*(planes count))
* - ** only used for sending planes data to shader **
*/
std::vector<float> m_clipPlanesSecondVectors;
/**
* clip planes origins array (size = 3*(planes count))
* - ** only used for sending planes data to shader **
*/
std::vector<float> m_clipPlanesOrigins;
/**
* clip planes equations vector uniform id
*/
GLint m_unif_clipPlanesEquations;
/**
* clip planes first vectors uniform id
*/
GLint m_unif_clipPlanesFirstVectors;
/**
* clip planes second vectors uniform id
*/
GLint m_unif_clipPlanesSecondVectors;
/**
* clip planes origins uniform id
*/
GLint m_unif_clipPlanesOrigins;
/**
* clip planes size uniform id
*/
GLint m_unif_clipPlanesDisplaySize;
/**
* color attenuation factor
......@@ -347,11 +309,6 @@ private:
*/
float m_clipPlanesDisplaySize;
/**
* use advanced plane clipping ?
*/
bool m_useAdvancedPlaneClipping;
};
......
This diff is collapsed.
......@@ -30,12 +30,14 @@ namespace CGoGN
namespace Utils
{
/***********************************************
*
* Public Section
*
***********************************************/
ShaderMutator::ShaderMutator(const std:: string& shaderName, const std::string& vertShaderSrc, const std::string& fragShaderSrc, const std::string& geomShaderSrc)
{
// Store the shader name
......@@ -322,8 +324,7 @@ bool ShaderMutator::srcIsCommented(size_t pos, const std::string& src)
return true;
// Now look for multi-line comments
size_t i;
for (i = pos; i > 0; i--)
for (size_t i = pos; i > 0; i--)
{
if (src[i] == '/')
{
......@@ -366,8 +367,7 @@ bool ShaderMutator::srcIsOneLineCommented(size_t pos, const std::string& src)
}
// Look backward in the source to see if there is any "//"
size_t i;
for (i = pos; i > 0; i--)
for (size_t i = pos; i > 0; i--)
{
// As soon as a '\n' is found, any other "//" will not affect this line anymore
if (src[i] == '\n')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment