Commit 8d755aaa authored by Thomas Jund's avatar Thomas Jund

avec les obj et textures pour la ville

parent 002ed37a
......@@ -606,15 +606,16 @@ void generatePlanet(EnvMap& envMap)
{
unsigned int nx = envMap.geometry.size(0) / envMap.maxCellSize ;
unsigned int ny = envMap.geometry.size(1) / envMap.maxCellSize ;
if (nx < 1) nx = 1 ;
if (ny < 1) ny = 1 ;
if (nx < 1)
nx = 1 ;
if (ny < 1)
ny = 1 ;
Algo::Surface::Modelisation::Polyhedron<PFP> prim(envMap.map, envMap.position) ;
prim.cylinder_topo(nx, ny, true, true) ;
double pi = 3.14159265358979323846f ;
double xRadius = envMap.geometry.size(0) / 2 * pi ;
double yRadius = envMap.geometry.size(1) / 2 * pi ;
double xRadius = envMap.geometry.size(0) / 2 * M_PI;
double yRadius = envMap.geometry.size(1) / 2 * M_PI ;
prim.embedSphere((xRadius+yRadius)/2.0f) ;
}
......@@ -624,6 +625,7 @@ typename PFP::VEC3 parametrization(typename PFP::VEC3 p, float r,const Geom::Bou
{
p[0] = 2.0f*M_PI*(p[0]-bb.min()[0])/bb.size(0);
p[1] = ((2.0f*M_PI*(p[1]-bb.min()[1])/bb.size(1))-M_PI)/2.0f;
r += p[2];
return typename PFP::VEC3(2.0f*r*cos(p[0])*cos(p[1]),
2.0f*r*sin(p[0])*cos(p[1]),
......
......@@ -32,7 +32,7 @@ class ArticulatedObstacle;
#include "pfp.h"
//#define EXPORTING3
#define EXPORTING3
#ifdef EXPORTING3
#include "Utils/Shaders/shaderPhongTexture.h"
......@@ -108,6 +108,8 @@ public:
PFP::TVEC3 position ;
PFP::TVEC3 normal ;
Geom::BoundingBox<PFP::VEC3> bb;
PFP::MAP mapScenary ;
PFP::TVEC3 positionScenary ;
PFP::TVEC3 normalScenary ;
......
......@@ -58,8 +58,8 @@ public:
Utils::VBO* m_texcoordVBO;
// Utils::ShaderPhongTexture* m_shaderTex;
Utils::ShaderSimpleTexture* m_shaderTex;
Utils::ShaderPhongTexture* m_shaderTex;
// Utils::ShaderSimpleTexture* m_shaderTex;
Algo::Surface::Import::OBJModel<PFP2> m_obj;
unsigned int m_nbIndices;
#else
......
// ShaderCustomTex::fragmentShaderText
PRECISON;
uniform sampler2D textureUnit;
in vec3 N;
in vec2 fragTexCoord;
FRAG_OUT_DEF;
void main()
{
gl_FragData[0] = texture2D(textureUnit,fragTexCoord);
gl_FragData[1] = vec4( 0.5*normalize(N)+vec3(0.5), 1.0 );
}
\ No newline at end of file
// ShaderCustomTex::geometryShaderText
VARYING_IN vec2 texCoord[];
VARYING_OUT vec2 fragTexCoord;
VARYING_OUT vec3 N;
void main(void)
{
vec3 v1 = POSITION_IN(1).xyz - POSITION_IN(0).xyz;
vec3 v2 = POSITION_IN(2).xyz - POSITION_IN(0).xyz;
N = cross(v1,v2);
N = normalize(N);
int i;
for(i=0; i< NBVERTS_IN; i++)
{
gl_Position = POSITION_IN(i);
fragTexCoord = texCoord[i];
EmitVertex();
}
EndPrimitive();
}
#ifndef __SHADER_CUSTOMTEX__
#define __SHADER_CUSTOMTEX__
#include "Utils/GLSLShader.h"
#include "Geometry/vector_gen.h"
#include "Utils/clippingShader.h"
#include "Utils/textures.h"
#include "Utils/gl_def.h"
using namespace CGoGN;
class ShaderCustomTex : public Utils::ClippingShader
{
protected:
// shader sources
static std::string vertexShaderText;
static std::string fragmentShaderText;
static std::string geometryShaderText;
CGoGNGLuint m_unif_unit;
int m_unit;
Utils::GTexture* m_tex_ptr;
Utils::VBO* m_vboPos;
Utils::VBO* m_vboTexCoord;
void restoreUniformsAttribs();
public:
ShaderCustomTex();
/**
* choose the texture unit engine to use for this texture
*/
void setTextureUnit(GLenum texture_unit);
/**
* set the texture to use
*/
void setTexture(Utils::GTexture* tex);
/**
* activation of texture unit with set texture
*/
void activeTexture();
/**
* activation of texture unit with texture id
*/
void activeTexture(CGoGNGLuint texId);
unsigned int setAttributePosition(Utils::VBO* vbo);
unsigned int setAttributeTexCoord(Utils::VBO* vbo);
};
#endif
// ShaderCustomTex::vertexShaderText
ATTRIBUTE vec3 VertexPosition;
ATTRIBUTE vec2 VertexTexCoord;
uniform mat4 ModelViewProjectionMatrix;
VARYING_VERT vec2 texCoord;
INVARIANT_POS;
void main ()
{
gl_Position = ModelViewProjectionMatrix * vec4 (VertexPosition, 1.0);
texCoord = VertexTexCoord;
}
......@@ -53,7 +53,7 @@
#include "shaderCustom.h"
#define EXPORTING
//#define EXPORTING
using namespace CGoGN ;
......
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This image diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# Blender MTL File: 'City.blend'
# Material Count: 1
newmtl _untitled.009
Ns 0
Ka 0.000000 0.000000 0.000000
Kd 0.8 0.8 0.8
Ks 0.8 0.8 0.8
d 1
illum 2
map_Kd City.blend\AO_Buildings11.png
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -125,5 +125,9 @@ void main()
// gl_FragColor = vec4( (0.5 + 0.5*AO*edgeEnhancement) * texture2D(u_FrameBufferColor,gl_TexCoord[0]).xyz, 1.0 );
// else
// gl_FragColor = vec4( (0.5+0.5*edgeEnhancement) * texture2D(u_FrameBufferColor,gl_TexCoord[0]).xyz, 1.0 );
gl_FragColor = vec4( (0.5+0.5*edgeEnhancement) * texture2D(u_FrameBufferColor,gl_TexCoord[0]).xyz, 1.0 );
if( gl_TexCoord[0].x > 0.5 )
gl_FragColor = vec4( (0.25+0.75*edgeEnhancement) * texture2D(u_FrameBufferColor,gl_TexCoord[0]).xyz, 1.0 );
else
gl_FragColor = vec4( (1.0+0.0*edgeEnhancement) * texture2D(u_FrameBufferColor,gl_TexCoord[0]).xyz, 1.0 );
}
......@@ -82,11 +82,11 @@ void main()
//
// // if( gl_TexCoord[0].x > 0.5 )
// // {
edgeEnhancement = 1.0 - SobelAt(0,0);
// // edgeEnhancement = 1.0 - SobelAt(0,0);
// // }
// // else
// // {
// edgeEnhancement = SmoothAt(0,0);
edgeEnhancement = SmoothAt(0,0);
//
// float d = fetchDepth(0,0);
// if( d < 1.0 )
......@@ -125,5 +125,9 @@ void main()
// gl_FragColor = vec4( (0.5 + 0.5*AO*edgeEnhancement) * texture2D(u_FrameBufferColor,gl_TexCoord[0]).xyz, 1.0 );
// else
// gl_FragColor = vec4( (0.5+0.5*edgeEnhancement) * texture2D(u_FrameBufferColor,gl_TexCoord[0]).xyz, 1.0 );
if( gl_TexCoord[0].x > 0.5 )
gl_FragColor = vec4( (0.25+0.75*edgeEnhancement) * texture2D(u_FrameBufferColor,gl_TexCoord[0]).xyz, 1.0 );
else
gl_FragColor = vec4( (0.5+0.5*edgeEnhancement) * texture2D(u_FrameBufferColor,gl_TexCoord[0]).xyz, 1.0 );
}
......@@ -16,6 +16,7 @@
#include "Topology/generic/mapBrowser.h"
#include "env_generator.h"
#include <dirent.h>
using namespace CGoGN ;
......@@ -103,14 +104,16 @@ void EnvMap::init(unsigned int config, REAL width, REAL height, REAL minSize, RE
std::string filename2 = "./svg/mapBuild.svg" ;
Algo::Surface::Import::importSVG<PFP>(mapScenary, filename2, positionScenary, obstacleMarkS, buildingMarkS) ;
Geom::BoundingBox<PFP::VEC3> bb1, bb2 ;
bb1 = Algo::Geometry::computeBoundingBox<PFP>(map, position) ;
Geom::BoundingBox<PFP::VEC3> bb2 ;
bb = Algo::Geometry::computeBoundingBox<PFP>(map, position) ;
bb2 = Algo::Geometry::computeBoundingBox<PFP>(mapScenary, positionScenary) ;
bb1.addPoint(bb2.min());
bb1.addPoint(bb2.max());
bb.addPoint(bb2.min());
bb.addPoint(bb2.max());
// CityGenerator::planetify<PFP>(map, position, 100.0f, bb1);
// CityGenerator::planetify<PFP>(mapScenary, positionScenary, 100.0f, bb1);
std::cout << "bb " << bb.min() << " & " << bb.max() << std::endl;
// CityGenerator::planetify<PFP>(map, position, 100.0f, bb);
// CityGenerator::planetify<PFP>(mapScenary, positionScenary, 100.0f, bb);
std::vector<Dart> v;
TraversorF<PFP::MAP> tF(mapScenary);
......@@ -224,65 +227,123 @@ void EnvMap::init(unsigned int config, REAL width, REAL height, REAL minSize, RE
void EnvMap::initGL()
{
#ifdef EXPORTING3
PFP::MAP * nmap = new PFP::MAP();
std::vector<std::string> attrNames ;
Algo::Surface::Import::OBJModel<PFP2> * obj = new Algo::Surface::Import::OBJModel<PFP2>(*nmap);
obj->import("./meshRessources/cityTex/Building11.obj",attrNames);
std::vector<std::string> filenames;
std::vector<std::string> texturenames;
VertexAttribute<VEC3> position_Export = nmap->getAttribute<VEC3, VERTEX>(attrNames[0]) ;
TraversorV<PFP2::MAP> tV(*nmap);
for(Dart d = tV.begin() ; d != tV.end() ; d = tV.next())
std::string dir("./meshRessources/cityTex/");
DIR *dp;
struct dirent *dirp;
if((dp = opendir(dir.c_str())) == NULL)
{
position_Export[d] *= 100.0f;
position_Export[d] += VEC3(2000,0,0);
cout << "Error(" << errno << ") opening " << dir << endl;
return;
}
Utils::VBO * texcoordVBO = new Utils::VBO();
Utils::VBO * positionVBO = new Utils::VBO();
Utils::VBO * normalVBO = new Utils::VBO();
while ((dirp = readdir(dp)) != NULL)
{
if(string(dirp->d_name).find(".obj")!=string::npos)
{
filenames.push_back(dir+string(dirp->d_name));
std::cout << dir+string(dirp->d_name) << std::endl;
}
Utils::Texture<2,Geom::Vec3uc> * texture = new Utils::Texture<2,Geom::Vec3uc>(GL_UNSIGNED_BYTE);
if(string(dirp->d_name).find(".png")!=string::npos)
{
texturenames.push_back(dir+string(dirp->d_name));
if (texture->load("./meshRessources/cityTex/AO_Buildings11.png"))
texture->update();
else
std::cout << "problem : loading texture" << std::endl;
std::cout << dir+string(dirp->d_name) << std::endl;
}
}
texture->setWrapping(GL_CLAMP_TO_EDGE);
std::sort(filenames.begin(), filenames.end());
std::sort(texturenames.begin(), texturenames.end());
ShaderCustomTex * shaderTex = new ShaderCustomTex();
shaderTex->setAttributePosition(positionVBO);
shaderTex->setAttributeTexCoord(texcoordVBO);
shaderTex->setTextureUnit(GL_TEXTURE0);
shaderTex->setTexture(texture);
// filenames.push_back(std::string("./meshRessources/cityTex/Building11.obj"));
// texturenames.push_back(std::string("./meshRessources/cityTex/AO_Buildings11.png"));
glEnable(GL_TEXTURE_2D);
nmap->setBrowser(NULL);
Geom::BoundingBox<PFP::VEC3> bbTest ;
std::vector<VertexAttribute<VEC3> > position_nmap;
if (!obj->hasNormals())
for(unsigned int i = 0 ; i < filenames.size() ; ++i)
{
VertexAttribute<VEC3> normal = nmap->getAttribute<VEC3, VERTEX>("normal") ;
if(!normal.isValid())
normal = nmap->addAttribute<VEC3, VERTEX>("normal") ;
PFP::MAP * nmap = new PFP::MAP();
Algo::Surface::Geometry::computeNormalVertices<PFP2>(*nmap, obj->m_positions, normal) ;
obj->setNormalAttribute(normal);
}
std::vector<std::string> attrNames ;
Algo::Surface::Import::OBJModel<PFP2> * obj = new Algo::Surface::Import::OBJModel<PFP2>(*nmap);
obj->import(filenames[i],attrNames);
VertexAttribute<VEC3> position_Export = nmap->getAttribute<VEC3, VERTEX>(attrNames[0]) ;
position_nmap.push_back(position_Export);
TraversorV<PFP2::MAP> tV(*nmap);
for(Dart d = tV.begin() ; d != tV.end() ; d = tV.next())
{
position_Export[d] *= 100.0f;
position_Export[d] += VEC3(2000,0,0);
}
Geom::BoundingBox<PFP::VEC3> bbTest2 = Algo::Geometry::computeBoundingBox<PFP>(*nmap, position_Export) ;
bbTest.addPoint(bbTest2.min());
bbTest.addPoint(bbTest2.max());
unsigned int nbIndices = obj->createSimpleVBO_PTN(positionVBO,texcoordVBO,normalVBO);
Utils::VBO * texcoordVBO = new Utils::VBO();
Utils::VBO * positionVBO = new Utils::VBO();
Utils::VBO * normalVBO = new Utils::VBO();
m_map_Export.push_back(nmap);
m_obj_Export.push_back(obj);
Utils::Texture<2,Geom::Vec3uc> * texture = new Utils::Texture<2,Geom::Vec3uc>(GL_UNSIGNED_BYTE);
m_texture_Export.push_back(texture);
m_texcoordVBO_Export.push_back(texcoordVBO);
m_positionVBO_Export.push_back(positionVBO);
m_normalVBO_Export.push_back(normalVBO);
m_shaderTex_Export.push_back(shaderTex);
if (texture->load(texturenames[i]))
texture->update();
else
std::cout << "problem : loading texture" << std::endl;
texture->setWrapping(GL_CLAMP_TO_EDGE);
ShaderCustomTex * shaderTex = new ShaderCustomTex();
shaderTex->setAttributePosition(positionVBO);
shaderTex->setAttributeTexCoord(texcoordVBO);
shaderTex->setTextureUnit(GL_TEXTURE0);
shaderTex->setTexture(texture);
glEnable(GL_TEXTURE_2D);
nmap->setBrowser(NULL);
if (!obj->hasNormals())
{
VertexAttribute<VEC3> normal = nmap->getAttribute<VEC3, VERTEX>("normal") ;
if(!normal.isValid())
normal = nmap->addAttribute<VEC3, VERTEX>("normal") ;
Algo::Surface::Geometry::computeNormalVertices<PFP2>(*nmap, obj->m_positions, normal) ;
obj->setNormalAttribute(normal);
}
m_nbIndice_Export.push_back(nbIndices);
unsigned int nbIndices = obj->createSimpleVBO_PTN(positionVBO,texcoordVBO,normalVBO);
m_map_Export.push_back(nmap);
m_obj_Export.push_back(obj);
m_texture_Export.push_back(texture);
m_texcoordVBO_Export.push_back(texcoordVBO);
m_positionVBO_Export.push_back(positionVBO);
m_normalVBO_Export.push_back(normalVBO);
m_shaderTex_Export.push_back(shaderTex);
m_nbIndice_Export.push_back(nbIndices);
}
std::cout << "bb " << bbTest.min() << " & " << bbTest.max() << std::endl;
// unsigned int i =0;
// for(std::vector<PFP::MAP * >::iterator it = m_map_Export.begin() ; it != m_map_Export.end() ; ++it, ++i)
// {
//
// CityGenerator::planetify<PFP>(**it, position_nmap[i], 2000.0f, bbTest);
// }
// m_map_Export = new PFP2::MAP();
//
......
......@@ -61,16 +61,16 @@ void MovingMesh::initGL()
m_texture->setWrapping(GL_CLAMP_TO_EDGE);
// m_shaderTex = new Utils::ShaderPhongTexture();
m_shaderTex = new Utils::ShaderSimpleTexture();
m_shaderTex = new Utils::ShaderPhongTexture();
// m_shaderTex = new Utils::ShaderSimpleTexture();
m_shaderTex->setAttributePosition(m_positionVBO);
m_shaderTex->setAttributeTexCoord(m_texcoordVBO);
// m_shaderTex->setAttributeNormal(m_normalVBO);
m_shaderTex->setAttributeNormal(m_normalVBO);
m_shaderTex->setTextureUnit(GL_TEXTURE0);
m_shaderTex->setTexture(m_texture);
// m_shaderTex->setShininess(10.0f);
// m_shaderTex->setAmbient(0.1f);
// m_shaderTex->setSpecular(Geom::Vec4f(0.5));
m_shaderTex->setShininess(10.0f);
m_shaderTex->setAmbient(0.1f);
m_shaderTex->setSpecular(Geom::Vec4f(0.5));
glEnable(GL_TEXTURE_2D);
......@@ -93,6 +93,9 @@ void MovingMesh::initGL()
m_simpleColorShader->setColor(Geom::Vec4f(0.,1.,0.,0.));
m_positionVBO->updateData(position) ;
m_render->initPrimitives<PFP2>(map, Algo::Render::GL2::TRIANGLES) ;
m_render->initPrimitives<PFP2>(map, Algo::Render::GL2::LINES) ;
#endif
m_normalVBO->updateData(normal) ;
......@@ -191,8 +194,6 @@ void MovingMesh::draw()
m_shaderTex->disableVertexAttribs();
#else
m_positionVBO->updateData(position) ;
m_render->initPrimitives<PFP2>(map, Algo::Render::GL2::TRIANGLES) ;
m_render->initPrimitives<PFP2>(map, Algo::Render::GL2::LINES) ;
m_simpleColorShader->setColor(Geom::Vec4f(1.0,0.627,0.0,0.));
m_render->draw(m_simpleColorShader, Algo::Render::GL2::TRIANGLES);
......
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include <GL/glew.h>
#include "shaderCustomTex.h"
#include "shaderCustomTex.vert"
#include "shaderCustomTex.frag"
#include "shaderCustomTex.geom"
//std::string ShaderCustomTex::vertexShaderText =
// "ATTRIBUTE vec3 VertexPosition;\n"
// "ATTRIBUTE vec2 VertexTexCoord;\n"
// "uniform mat4 ModelViewProjectionMatrix;\n"
// "VARYING_VERT vec2 texCoord;\n"
// "INVARIANT_POS;\n"
// "void main ()\n"
// "{\n"
// " gl_Position = ModelViewProjectionMatrix * vec4 (VertexPosition, 1.0);\n"
// " texCoord = VertexTexCoord;\n"
// "}";
//
//
//std::string ShaderCustomTex::fragmentShaderText =
// "PRECISON;\n"
// "VARYING_FRAG vec2 texCoord;\n"
// "uniform sampler2D textureUnit;\n"
// "FRAG_OUT_DEF;\n"
// "void main()\n"
// "{\n"
// " gl_FragColor=texture2D(textureUnit,texCoord);\n"
// "}";
ShaderCustomTex::ShaderCustomTex()
{
m_nameVS = "ShaderCustomTex_vs";
m_nameFS = "ShaderCustomTex_fs";
m_nameGS = "ShaderCustomTex_gs";
std::string glxvert(*GLSLShader::DEFINES_GL);
glxvert.append(vertexShaderText);
std::string glxgeom = GLSLShader::defines_Geom("triangles", "triangle_strip", 3);
glxgeom.append(geometryShaderText);
std::string glxfrag(*GLSLShader::DEFINES_GL);
glxfrag.append(fragmentShaderText);
// loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str());
loadShadersFromMemory(glxvert.c_str(), glxfrag.c_str(), glxgeom.c_str(), GL_TRIANGLES, GL_TRIANGLE_STRIP, 3);
m_unif_unit = glGetUniformLocation(this->program_handler(), "textureUnit");
}
void ShaderCustomTex::setTextureUnit(GLenum texture_unit)
{
this->bind();
int unit = texture_unit - GL_TEXTURE0;
glUniform1iARB(*m_unif_unit,unit);
m_unit = unit;
}
void ShaderCustomTex::setTexture(Utils::GTexture* tex)
{
m_tex_ptr = tex;
}
void ShaderCustomTex::activeTexture()
{
glActiveTexture(GL_TEXTURE0 + m_unit);
m_tex_ptr->bind();
}
void ShaderCustomTex::activeTexture(CGoGNGLuint texId)
{
glActiveTexture(GL_TEXTURE0 + m_unit);
glBindTexture(GL_TEXTURE_2D, *texId);
}
unsigned int ShaderCustomTex::setAttributePosition(Utils::VBO* vbo)
{
m_vboPos = vbo;
return bindVA_VBO("VertexPosition", vbo);
}
unsigned int ShaderCustomTex::setAttributeTexCoord(Utils::VBO* vbo)
{
m_vboTexCoord = vbo;
return bindVA_VBO("VertexTexCoord", vbo);
}
void ShaderCustomTex::restoreUniformsAttribs()
{
m_unif_unit = glGetUniformLocation(this->program_handler(), "textureUnit");
bindVA_VBO("VertexPosition", m_vboPos);
bindVA_VBO("VertexTexCoord", m_vboTexCoord);
this->bind();
glUniform1iARB(*m_unif_unit,m_unit);
this->unbind();
}
......@@ -499,10 +499,10 @@ void SocialAgents::cb_redraw()
glPolygonOffset( 2.0f,2.0f) ;
#ifdef EXPORTING
m_Ground_Shader->enableVertexAttribs();
// m_Ground_Shader->enableVertexAttribs();
// glDrawArrays(GL_QUADS, 0, 4*N_THETA*N_PHI );
glDrawArrays(GL_POLYGON, 0, 4);
m_Ground_Shader->disableVertexAttribs();
// glDrawArrays(GL_POLYGON, 0, 4);
// m_Ground_Shader->disableVertexAttribs();
#endif
......@@ -513,6 +513,7 @@ void SocialAgents::cb_redraw()
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL) ;
glEnable(GL_LIGHTING);
glEnable( GL_MULTISAMPLE );
simulator.envMap_.draw();
dock.check_slide->setRange(0, simulator.envMap_.map.end().index) ;
......@@ -680,10 +681,10 @@ void SocialAgents::cb_redraw()
m_simpleColorShader->setColor(Geom::Vec4f(0.9,0.9,0.9,0.));
m_render->draw(m_simpleColorShader, Algo::Render::GL2::TRIANGLES);
if(simulator.config==5)
{
m_render_scenary->draw(m_flatShader_scenary, Algo::Render::GL2::TRIANGLES);
}
// if(simulator.config==5)
// {
// m_render_scenary->draw(m_flatShader_scenary, Algo::Render::GL2::TRIANGLES);
// }
break;
}
glDisable(GL_POLYGON_OFFSET_FILL) ;
......@@ -751,6 +752,8 @@ void SocialAgents::cb_redraw()
glActiveTexture( GL_TEXTURE0 );
glEnable( GL_TEXTURE_2D );
glBindTexture( GL_TEXTURE_2D, *fbo.getColorTexId(deferedColorAttachment) );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glActiveTexture( GL_TEXTURE1 );
glEnable( GL_TEXTURE_2D );
......
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