Hello

i created a 3d world with ground and buildings.For the shadows i used the stencill bufer and for better apearance the polygon ofset too.
But i have some visual problems

I hope the fotos and the code is usefull for you to help me eliminate this visual artifacts......



Code :
int DrawGLScene(GLvoid)									
{
 
 
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
 
 
	glLoadIdentity();	
	glTranslatef(tx,ty,tz);
    gluLookAt(objCamera.mPos.x,  objCamera.mPos.y,  objCamera.mPos.z,	
			  objCamera.mView.x, objCamera.mView.y, objCamera.mView.z,	
			  objCamera.mUp.x,   objCamera.mUp.y,   objCamera.mUp.z);
    glRotatef(rotWorld,-1.0, 0.0, 0.0);
	glScalef(2.0,2.4,1.8);
 
	shadowMatrix(floorShadow, floorPlane, lightPosition);
    glPushMatrix();
	glEnable(GL_STENCIL_TEST);
    glStencilFunc(GL_ALWAYS, 3, 0xffffffff);
    glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
 
	glPushMatrix();  
	CHAPEL();
	CANTEEN();
	glPopMatrix();
 
    Grass();
	Streets();
	Pavement();
	Alleys();
	Moor();
	Fields();
	Parkings();
	Pools();	
 
    glStencilFunc(GL_LESS, 2, 0xffffffff);  
    glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
 
		  glEnable(GL_POLYGON_OFFSET_FILL);
		  glPolygonOffset(-10, -0.2);
 
 
	glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glDisable(GL_LIGHTING); 
    glColor4f(0.0, 0.0, 0.0, 0.5); 
 
    glPushMatrix();
    glMultMatrixf((GLfloat *) floorShadow);
        CHAPEL();
	CANTEEN();
	glPopMatrix();
 
	//glPushMatrix();
	//CHAPEL();
	//CANTEEN();        [U][B]IF I USE HERE THEESE 2 BUILDINGS BOTH VISUAL ARTIFACTS AND F-FAIL DISAPEAR BUT THE BUILDINGS LOOK DARKER[/B][/U]
	//glPopMatrix();
 
    glDisable(GL_BLEND);
    glEnable(GL_LIGHTING);
 
		  glDisable(GL_POLYGON_OFFSET_FILL);
 
 
	glDisable(GL_STENCIL_TEST);
	glPopMatrix();
 
	DrawSky();
 
 
	return TRUE;



POLYGON OFSET -1000000, 0
1.JPG

POLYGON OFSET -100, 0
2.jpg

POLYGON OFSET -10, -0.2
3.jpg