Commit 5fcb3fc3 authored by Pierre Kraemer's avatar Pierre Kraemer

Merge branch 'develop' into 'develop'

Develop

See merge request !35
parents e66c4530 bc2e1c32
...@@ -260,11 +260,9 @@ MapHandlerGen* Surface_Radiance_Plugin::importFromFile(const QString& fileName) ...@@ -260,11 +260,9 @@ MapHandlerGen* Surface_Radiance_Plugin::importFromFile(const QString& fileName)
mapParams.paramVBO = new Utils::VBO(); mapParams.paramVBO = new Utils::VBO();
mapParams.paramVBO->updateData(mapParams.param); mapParams.paramVBO->updateData(mapParams.param);
mapParams.radiancePerVertexShader = new Utils::ShaderRadiancePerVertex(); mapParams.radiancePerVertexShader = new Utils::ShaderRadiancePerVertex(SH_TYPE::get_resolution());
registerShader(mapParams.radiancePerVertexShader); registerShader(mapParams.radiancePerVertexShader);
mapParams.radiancePerVertexShader->compile(SH_TYPE::get_resolution());
mapParams.radiancePerVertexShader->setAttributeRadiance(mapParams.paramVBO, mapParams.radianceTexture, GL_TEXTURE1); mapParams.radiancePerVertexShader->setAttributeRadiance(mapParams.paramVBO, mapParams.radianceTexture, GL_TEXTURE1);
// compute map bounding box // compute map bounding box
......
...@@ -62,11 +62,11 @@ protected: ...@@ -62,11 +62,11 @@ protected:
static int index (int l, int m) { return l*(l+1)+m; } // compute indices in K_tab static int index (int l, int m) { return l*(l+1)+m; } // compute indices in K_tab
public: public:
ShaderRadiancePerVertex(); ShaderRadiancePerVertex(int resolution);
~ShaderRadiancePerVertex() ; ~ShaderRadiancePerVertex() ;
void compile(int resolution); void compile();
void setCamera(Geom::Vec3f camera) ; void setCamera(Geom::Vec3f camera) ;
......
...@@ -34,15 +34,17 @@ namespace Utils ...@@ -34,15 +34,17 @@ namespace Utils
#include "shaderRadiancePerVertex.geom" #include "shaderRadiancePerVertex.geom"
#include "shaderRadiancePerVertex.frag" #include "shaderRadiancePerVertex.frag"
ShaderRadiancePerVertex::ShaderRadiancePerVertex() : ShaderRadiancePerVertex::ShaderRadiancePerVertex(int resolution) :
m_vboPos(NULL), m_vboPos(NULL),
m_vboNorm(NULL), m_vboNorm(NULL),
m_vboParam(NULL), m_vboParam(NULL),
m_tex_ptr(NULL), m_tex_ptr(NULL),
m_tex_unit(-1), m_tex_unit(-1),
m_resolution(-1), m_resolution(resolution),
K_tab(NULL) K_tab(NULL)
{} {
compile();
}
ShaderRadiancePerVertex::~ShaderRadiancePerVertex() ShaderRadiancePerVertex::~ShaderRadiancePerVertex()
{ {
...@@ -50,13 +52,12 @@ ShaderRadiancePerVertex::~ShaderRadiancePerVertex() ...@@ -50,13 +52,12 @@ ShaderRadiancePerVertex::~ShaderRadiancePerVertex()
delete[] K_tab ; delete[] K_tab ;
} }
void ShaderRadiancePerVertex::compile(int resolution) void ShaderRadiancePerVertex::compile()
{ {
m_nameVS = "ShaderRadiancePerVertex_vs"; m_nameVS = "ShaderRadiancePerVertex_vs";
m_nameFS = "ShaderRadiancePerVertex_fs"; m_nameFS = "ShaderRadiancePerVertex_fs";
m_nameGS = "ShaderRadiancePerVertex_gs"; m_nameGS = "ShaderRadiancePerVertex_gs";
m_resolution = resolution;
const int nb_coefs = (m_resolution+1)*(m_resolution+1); const int nb_coefs = (m_resolution+1)*(m_resolution+1);
if (m_resolution != -1) if (m_resolution != -1)
{ {
......
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