bugfix, clip alpha wasn't working in the GE, not happy with these functions, they probably need bigger changes not to assume all alpha requires face sorting with a disabled depth buffer,

This commit is contained in:
Campbell Barton 2008-06-15 09:43:24 +00:00
parent c76bce9e64
commit f63b70635c
2 changed files with 4 additions and 4 deletions

@ -542,7 +542,7 @@ BL_Material* ConvertMaterial(
material->amb = mat->amb;
// set alpha testing without z-sorting
if( ( validface && (!tface->transp)) && mat->mode & MA_ZTRA) {
if( ( validface && (!(tface->transp &~ TF_CLIP))) && mat->mode & MA_ZTRA) {
// sets the RAS_IPolyMaterial::m_flag |RAS_FORCEALPHA
// this is so we don't have the overhead of the z-sorting code
material->ras_mode|=ALPHA_TEST;
@ -598,7 +598,7 @@ BL_Material* ConvertMaterial(
material->ras_mode |= ( (tface->mode & TF_DYNAMIC)!= 0 )?COLLIDER:0;
material->transp = tface->transp;
if(tface->transp)
if(tface->transp&~TF_CLIP)
material->ras_mode |= TRANSP;
material->tile = tface->tile;
@ -947,7 +947,7 @@ RAS_MeshObject* BL_ConvertMesh(Mesh* mesh, Object* blenderobj, RAS_IRenderTools*
// Use texface colors if available
//TF_DYNAMIC means the polygon is a collision face
collider = ((tface->mode & TF_DYNAMIC) != 0);
transp = tface->transp;
transp = tface->transp &~ TF_CLIP;
tile = tface->tile;
mode = tface->mode;

@ -493,7 +493,7 @@ bool KX_BlenderMaterial::setDefaultBlending()
glDisable(GL_BLEND);
glEnable ( GL_ALPHA_TEST );
glAlphaFunc(GL_GREATER, 0.5f);
return true;
return false;
}
return false;
}