enabled blending.

fixed bug related to the bbox diagonal(from int to float)
This commit is contained in:
Paolo Cignoni cignoni 2009-07-20 15:49:58 +00:00
parent 88180b1923
commit f476cb6a41
2 changed files with 11 additions and 4 deletions

View File

@ -76,7 +76,7 @@ void ShadowMapping::runShader(MeshModel& m, GLArea* gla){
GLfloat g_mModelView[16];
GLfloat g_mProjection[16];
int diag = bb.Diag();
float diag = bb.Diag();
GLfloat lP[4];
glGetLightfv(GL_LIGHT0, GL_POSITION, lP);
@ -149,8 +149,10 @@ void ShadowMapping::runShader(MeshModel& m, GLArea* gla){
GLuint loc = glGetUniformLocation(this->_objectShaderProgram, "shadowMap");
glUniform1i(loc, 0);
m.Render(rm.drawMode, rm.colorMode, vcg::GLW::TMNone);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
m.Render(rm.drawMode, rm.colorMode, rm.textureMode);
glDisable(GL_BLEND);
//m.Render(vcg::GLW::DMSmooth, vcg::GLW::CMPerVert, vcg::GLW::TMPerWedge);
glDepthFunc((GLenum)depthFuncOld);
glUseProgram(0);

View File

@ -63,7 +63,7 @@ void VarianceShadowMapping::runShader(MeshModel& m, GLArea* gla){
GLfloat g_mModelView[16];
GLfloat g_mProjection[16];
int diag = bb.Diag();
float diag = bb.Diag();
GLfloat lP[4];
glGetLightfv(GL_LIGHT0, GL_POSITION, lP);
@ -141,7 +141,12 @@ void VarianceShadowMapping::runShader(MeshModel& m, GLArea* gla){
GLuint loc = glGetUniformLocation(this->_objectShaderProgram, "shadowMap");
glUniform1i(loc, 0);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
m.Render(rm.drawMode, rm.colorMode, rm.textureMode);
glDisable(GL_BLEND);
glDepthFunc((GLenum)depthFuncOld);
glUseProgram(0);