Jump to content
  • Advertisement
Sign in to follow this  
michaudj

Begginner : Anti-Aliasing with GL_QUADS : see diagonal line

This topic is 3820 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here i tried some stuff to make a floor with black and white tile ( user define, but testing with black and white ). But when i make it move it create some ugly lines. So i try anti-aliasing... It seems like it works but, it makes a line the color of my background(0.5,0.5,05) diagonaly in each tile... I have put in comment of some of the thing i have tried.

	glClear(GL_DEPTH_BUFFER_BIT);

	glMatrixMode(GL_MODELVIEW);
	glPushMatrix();

	// Inclin of floor
	glRotatef(fAngleIncli,afVecRot[0],afVecRot[1],afVecRot[2]);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);


		// TODO : STILL NEED SOME TESTING
	if(ANTI_ALIASING_ON == (int)a2dCombin[ANTI_ALIASING][VALUE])
	{
		//glEnable(GL_BLEND);
		//glEnable(GL_POLYGON_SMOOTH);
		//glBlendFunc(GL_SRC_ALPHA_SATURATE,GL_ZERO); // GL_ONE
		//glHint(GL_POLYGON_SMOOTH_HINT,GL_FASTEST); // GL_NICEST
		//glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

		glEnable(GL_MULTISAMPLE_ARB);
	}










and the floor, // This is only 1 tile, i make a for depending on how many the user wants.
	glBegin(GL_QUADS);//Hauteur = Height and fDemiLarg= Half the total floor
		glVertex3f(-fDemiLarg + fPosX1, HAUTEUR, -fDemiLarg + fPosZ1);
		glVertex3f(-fDemiLarg + fPosX1, HAUTEUR, -fDemiLarg + fPosZ2);
		glVertex3f(-fDemiLarg + fPosX2, HAUTEUR, -fDemiLarg + fPosZ2);
		glVertex3f(-fDemiLarg + fPosX2, HAUTEUR, -fDemiLarg + fPosZ1);
	glEnd();	



Anyone know if it's normal since quad make 2 triangle ? Would it be easier to make texture of tile ? here is what i see
********
**     *
* *    *
*  *   *
*   *  *
*    * *
*     **
********



inside it's either black or white and the diagonale is black, grey or white depending on config or method called ( see comments ) [Edited by - michaudj on January 30, 2008 3:35:51 PM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!